Class ShadowUtils
Inheritance
System.Object
ShadowUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Syntax
Methods
Asfloat(Int32)
Declaration
public static float Asfloat(int val)
Parameters
Type |
Name |
Description |
System.Int32 |
val |
|
Returns
Type |
Description |
System.Single |
|
Asfloat(UInt32)
Declaration
public static float Asfloat(uint val)
Parameters
Type |
Name |
Description |
System.UInt32 |
val |
|
Returns
Type |
Description |
System.Single |
|
Asint(Single)
Declaration
public static int Asint(float val)
Parameters
Type |
Name |
Description |
System.Single |
val |
|
Returns
Type |
Description |
System.Int32 |
|
Asuint(Single)
Declaration
public static uint Asuint(float val)
Parameters
Type |
Name |
Description |
System.Single |
val |
|
Returns
Type |
Description |
System.UInt32 |
|
CalcGuardAnglePerspective(Single, Single, Single, Single, Single)
Declaration
public static float CalcGuardAnglePerspective(float angleInDeg, float resolution, float filterWidth, float normalBiasMax, float guardAngleMaxInDeg)
Parameters
Type |
Name |
Description |
System.Single |
angleInDeg |
|
System.Single |
resolution |
|
System.Single |
filterWidth |
|
System.Single |
normalBiasMax |
|
System.Single |
guardAngleMaxInDeg |
|
Returns
Type |
Description |
System.Single |
|
ClearPrecision(GPUShadowAlgorithm)
Declaration
public static GPUShadowAlgorithm ClearPrecision(GPUShadowAlgorithm gpuAlgo)
Parameters
Returns
ExtractAlgorithm(GPUShadowAlgorithm)
Declaration
public static ShadowAlgorithm ExtractAlgorithm(GPUShadowAlgorithm gpuAlgo)
Parameters
Returns
ExtractDirectionalLightMatrix(VisibleLight, UInt32, Int32, Single[], Single, UInt32, UInt32, out Matrix4x4, out Matrix4x4, out Matrix4x4, out Matrix4x4, out Vector4, out ShadowSplitData, CullResults, Int32)
Declaration
public static Matrix4x4 ExtractDirectionalLightMatrix(VisibleLight vl, uint cascadeIdx, int cascadeCount, float[] splitRatio, float nearPlaneOffset, uint width, uint height, out Matrix4x4 view, out Matrix4x4 proj, out Matrix4x4 deviceProj, out Matrix4x4 vpinverse, out Vector4 lightDir, out ShadowSplitData splitData, CullResults cullResults, int lightIndex)
Parameters
Type |
Name |
Description |
VisibleLight |
vl |
|
System.UInt32 |
cascadeIdx |
|
System.Int32 |
cascadeCount |
|
System.Single[] |
splitRatio |
|
System.Single |
nearPlaneOffset |
|
System.UInt32 |
width |
|
System.UInt32 |
height |
|
Matrix4x4 |
view |
|
Matrix4x4 |
proj |
|
Matrix4x4 |
deviceProj |
|
Matrix4x4 |
vpinverse |
|
Vector4 |
lightDir |
|
ShadowSplitData |
splitData |
|
CullResults |
cullResults |
|
System.Int32 |
lightIndex |
|
Returns
Type |
Description |
Matrix4x4 |
|
ExtractPointLightMatrix(VisibleLight, UInt32, Single, out Matrix4x4, out Matrix4x4, out Matrix4x4, out Matrix4x4, out Vector4, out ShadowSplitData)
Declaration
public static Matrix4x4 ExtractPointLightMatrix(VisibleLight vl, uint faceIdx, float guardAngle, out Matrix4x4 view, out Matrix4x4 proj, out Matrix4x4 deviceProj, out Matrix4x4 vpinverse, out Vector4 lightDir, out ShadowSplitData splitData)
Parameters
Type |
Name |
Description |
VisibleLight |
vl |
|
System.UInt32 |
faceIdx |
|
System.Single |
guardAngle |
|
Matrix4x4 |
view |
|
Matrix4x4 |
proj |
|
Matrix4x4 |
deviceProj |
|
Matrix4x4 |
vpinverse |
|
Vector4 |
lightDir |
|
ShadowSplitData |
splitData |
|
Returns
Type |
Description |
Matrix4x4 |
|
ExtractPrecision(GPUShadowAlgorithm)
Declaration
public static ShadowPrecision ExtractPrecision(GPUShadowAlgorithm gpuAlgo)
Parameters
Returns
ExtractSpotLightMatrix(VisibleLight, Single, out Matrix4x4, out Matrix4x4, out Matrix4x4, out Matrix4x4, out Vector4, out ShadowSplitData)
Declaration
public static Matrix4x4 ExtractSpotLightMatrix(VisibleLight vl, float guardAngle, out Matrix4x4 view, out Matrix4x4 proj, out Matrix4x4 deviceProj, out Matrix4x4 vpinverse, out Vector4 lightDir, out ShadowSplitData splitData)
Parameters
Type |
Name |
Description |
VisibleLight |
vl |
|
System.Single |
guardAngle |
|
Matrix4x4 |
view |
|
Matrix4x4 |
proj |
|
Matrix4x4 |
deviceProj |
|
Matrix4x4 |
vpinverse |
|
Vector4 |
lightDir |
|
ShadowSplitData |
splitData |
|
Returns
Type |
Description |
Matrix4x4 |
|
ExtractVariant(GPUShadowAlgorithm)
Declaration
public static ShadowVariant ExtractVariant(GPUShadowAlgorithm gpuAlgo)
Parameters
Returns
InvertOrthographic(ref Matrix4x4, ref Matrix4x4, out Matrix4x4)
Declaration
public static void InvertOrthographic(ref Matrix4x4 proj, ref Matrix4x4 view, out Matrix4x4 vpinv)
Parameters
Type |
Name |
Description |
Matrix4x4 |
proj |
|
Matrix4x4 |
view |
|
Matrix4x4 |
vpinv |
|
InvertPerspective(ref Matrix4x4, ref Matrix4x4, out Matrix4x4)
Declaration
public static void InvertPerspective(ref Matrix4x4 proj, ref Matrix4x4 view, out Matrix4x4 vpinv)
Parameters
Type |
Name |
Description |
Matrix4x4 |
proj |
|
Matrix4x4 |
view |
|
Matrix4x4 |
vpinv |
|
InvertView(ref Matrix4x4, out Matrix4x4)
Declaration
public static void InvertView(ref Matrix4x4 view, out Matrix4x4 invview)
Parameters
Type |
Name |
Description |
Matrix4x4 |
view |
|
Matrix4x4 |
invview |
|
Pack(ShadowAlgorithm, ShadowVariant, ShadowPrecision)
Declaration
public static GPUShadowAlgorithm Pack(ShadowAlgorithm algo, ShadowVariant vari, ShadowPrecision prec)
Parameters
Returns
Unpack(GPUShadowAlgorithm, out ShadowAlgorithm, out ShadowVariant, out ShadowPrecision)
Declaration
public static void Unpack(GPUShadowAlgorithm gpuAlgo, out ShadowAlgorithm algo, out ShadowVariant vari, out ShadowPrecision prec)
Parameters
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.