-
public class LightManager.ShadowCascades
-
-
Method Summary
Modifier and Type Method Description static voidcomputeUniformSplits(@NonNull() @Size(min = 1) Array<float> splitPositions, @IntRange(from = 1, to = 4) int cascades)Utility method to compute cascadeSplitPositions according to auniform split scheme. static voidcomputeLogSplits(@NonNull() @Size(min = 1) Array<float> splitPositions, @IntRange(from = 1, to = 4) int cascades, float near, float far)Utility method to compute cascadeSplitPositions according to alogarithmic split scheme. static voidcomputePracticalSplits(@NonNull() @Size(min = 1) Array<float> splitPositions, @IntRange(from = 1, to = 4) int cascades, float near, float far, float lambda)Utility method to compute cascadeSplitPositions according to apractical split scheme. -
-
Method Detail
-
computeUniformSplits
static void computeUniformSplits(@NonNull() @Size(min = 1) Array<float> splitPositions, @IntRange(from = 1, to = 4) int cascades)
Utility method to compute cascadeSplitPositions according to auniform split scheme.
- Parameters:
splitPositions- a float array of at least size (cascades - 1) to write the splitpositions intocascades- the number of shadow cascades, at most 4
-
computeLogSplits
static void computeLogSplits(@NonNull() @Size(min = 1) Array<float> splitPositions, @IntRange(from = 1, to = 4) int cascades, float near, float far)
Utility method to compute cascadeSplitPositions according to alogarithmic split scheme.
- Parameters:
splitPositions- a float array of at least size (cascades - 1) to write the splitpositions intocascades- the number of shadow cascades, at most 4near- the camera near planefar- the camera far plane
-
computePracticalSplits
static void computePracticalSplits(@NonNull() @Size(min = 1) Array<float> splitPositions, @IntRange(from = 1, to = 4) int cascades, float near, float far, float lambda)
Utility method to compute cascadeSplitPositions according to apractical split scheme.
The practical split scheme uses uses a lambda value to interpolate between the logrithmicand uniform split schemes. Start with a lambda value of 0.5f and adjust for your scene.
See: Zhang et al 2006, "Parallel-split shadow maps for large-scale virtual environments"- Parameters:
splitPositions- a float array of at least size (cascades - 1) to write the splitpositions intocascades- the number of shadow cascades, at most 4near- the camera near planefar- the camera far planelambda- a float in the range [0, 1] that interpolates between log anduniform split schemes
-
-
-
-