Package com.google.android.filament
Class LightManager.ShadowCascades
- java.lang.Object
-
- com.google.android.filament.LightManager.ShadowCascades
-
- Enclosing class:
- LightManager
public static class LightManager.ShadowCascades extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ShadowCascades()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcomputeLogSplits(float[] splitPositions, int cascades, float near, float far)Utility method to computeLightManager.ShadowOptions.cascadeSplitPositionsaccording to a logarithmic split scheme.static voidcomputePracticalSplits(float[] splitPositions, int cascades, float near, float far, float lambda)Utility method to computeLightManager.ShadowOptions.cascadeSplitPositionsaccording to a practical split scheme.static voidcomputeUniformSplits(float[] splitPositions, int cascades)Utility method to computeLightManager.ShadowOptions.cascadeSplitPositionsaccording to a uniform split scheme.
-
-
-
Method Detail
-
computeUniformSplits
public static void computeUniformSplits(@NonNull @Size(min=1L) float[] splitPositions, @IntRange(from=1L,to=4L) int cascades)Utility method to computeLightManager.ShadowOptions.cascadeSplitPositionsaccording to a uniform split scheme.- Parameters:
splitPositions- a float array of at least size (cascades - 1) to write the split positions intocascades- the number of shadow cascades, at most 4
-
computeLogSplits
public static void computeLogSplits(@NonNull @Size(min=1L) float[] splitPositions, @IntRange(from=1L,to=4L) int cascades, float near, float far)Utility method to computeLightManager.ShadowOptions.cascadeSplitPositionsaccording to a logarithmic split scheme.- Parameters:
splitPositions- a float array of at least size (cascades - 1) to write the split positions intocascades- the number of shadow cascades, at most 4near- the camera near planefar- the camera far plane
-
computePracticalSplits
public static void computePracticalSplits(@NonNull @Size(min=1L) float[] splitPositions, @IntRange(from=1L,to=4L) int cascades, float near, float far, float lambda)Utility method to computeLightManager.ShadowOptions.cascadeSplitPositionsaccording to a practical split scheme.The practical split scheme uses uses a lambda value to interpolate between the logrithmic and 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 split positions 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 and uniform split schemes
-
-