Class SphericalHarmonicsL2Utils
A collection of utility functions used to access and set SphericalHarmonicsL2 in a more verbose way.
Namespace: UnityEngine.Rendering
Syntax
public class SphericalHarmonicsL2Utils
Methods
GetCoefficient(SphericalHarmonicsL2, Int32)
Get a spherical harmonics coefficient.
Declaration
public static Vector3 GetCoefficient(SphericalHarmonicsL2 sh, int index)
Parameters
Type | Name | Description |
---|---|---|
SphericalHarmonicsL2 | sh | The SphericalHarmonicsL2 data structure to get information from. |
Int32 | index | The index of the coefficient that is requested (must be less than 9). |
Returns
Type | Description |
---|---|
Vector3 | The value of the requested coefficient. |
GetL1(SphericalHarmonicsL2, out Vector3, out Vector3, out Vector3)
Returns the L1 coefficients organized in such a way that are swizzled per channel rather than per coefficient.
Declaration
public static void GetL1(SphericalHarmonicsL2 sh, out Vector3 L1_R, out Vector3 L1_G, out Vector3 L1_B)
Parameters
Type | Name | Description |
---|---|---|
SphericalHarmonicsL2 | sh | The SphericalHarmonicsL2 data structure to use to query the information. |
Vector3 | L1_R | The red channel of all coefficient for the L1 band. |
Vector3 | L1_G | The green channel of all coefficient for the L1 band. |
Vector3 | L1_B | The blue channel of all coefficient for the L1 band. |
GetL2(SphericalHarmonicsL2, out Vector3, out Vector3, out Vector3, out Vector3, out Vector3)
Returns all the L2 coefficients.
Declaration
public static void GetL2(SphericalHarmonicsL2 sh, out Vector3 L2_0, out Vector3 L2_1, out Vector3 L2_2, out Vector3 L2_3, out Vector3 L2_4)
Parameters
Type | Name | Description |
---|---|---|
SphericalHarmonicsL2 | sh | The SphericalHarmonicsL2 data structure to use to query the information. |
Vector3 | L2_0 | The first coefficient for the L2 band. |
Vector3 | L2_1 | The second coefficient for the L2 band. |
Vector3 | L2_2 | The third coefficient for the L2 band. |
Vector3 | L2_3 | The fourth coefficient for the L2 band. |
Vector3 | L2_4 | The fifth coefficient for the L2 band. |
SetCoefficient(ref SphericalHarmonicsL2, Int32, Vector3)
Set a spherical harmonics coefficient.
Declaration
public static void SetCoefficient(ref SphericalHarmonicsL2 sh, int index, Vector3 coefficient)
Parameters
Type | Name | Description |
---|---|---|
SphericalHarmonicsL2 | sh | The SphericalHarmonicsL2 data structure to store information on. |
Int32 | index | The index of the coefficient that is set (must be less than 9). |
Vector3 | coefficient | The values of the coefficient is set. |
SetL0(ref SphericalHarmonicsL2, Vector3)
Set L0 coefficient.
Declaration
public static void SetL0(ref SphericalHarmonicsL2 sh, Vector3 L0)
Parameters
Type | Name | Description |
---|---|---|
SphericalHarmonicsL2 | sh | The SphericalHarmonicsL2 data structure to store information on. |
Vector3 | L0 | The L0 coefficient to set. |
SetL1(ref SphericalHarmonicsL2, Vector3, Vector3, Vector3)
Set all L1 coefficients per channel.
Declaration
public static void SetL1(ref SphericalHarmonicsL2 sh, Vector3 L1_R, Vector3 L1_G, Vector3 L1_B)
Parameters
Type | Name | Description |
---|---|---|
SphericalHarmonicsL2 | sh | The SphericalHarmonicsL2 data structure to store information on. |
Vector3 | L1_R | The red channels for each L1 coefficient. |
Vector3 | L1_G | The green channels for each L1 coefficient. |
Vector3 | L1_B | The blue channels for each L1 coefficient. |
SetL1B(ref SphericalHarmonicsL2, Vector3)
Set the blue channel for each of the L1 coefficients.
Declaration
public static void SetL1B(ref SphericalHarmonicsL2 sh, Vector3 L1_B)
Parameters
Type | Name | Description |
---|---|---|
SphericalHarmonicsL2 | sh | The SphericalHarmonicsL2 data structure to store information on. |
Vector3 | L1_B | The blue channels for each L1 coefficient. |
SetL1G(ref SphericalHarmonicsL2, Vector3)
Set the green channel for each of the L1 coefficients.
Declaration
public static void SetL1G(ref SphericalHarmonicsL2 sh, Vector3 L1_G)
Parameters
Type | Name | Description |
---|---|---|
SphericalHarmonicsL2 | sh | The SphericalHarmonicsL2 data structure to store information on. |
Vector3 | L1_G | The green channels for each L1 coefficient. |
SetL1R(ref SphericalHarmonicsL2, Vector3)
Set the red channel for each of the L1 coefficients.
Declaration
public static void SetL1R(ref SphericalHarmonicsL2 sh, Vector3 L1_R)
Parameters
Type | Name | Description |
---|---|---|
SphericalHarmonicsL2 | sh | The SphericalHarmonicsL2 data structure to store information on. |
Vector3 | L1_R | The red channels for each L1 coefficient. |