Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

Sample Distribution

  • Last UpdatedJan 24, 2023
  • 2 minute read

The Sample Distribution technique can better fit the Shadow maps generation by scanning the Scene pixels.

Advantage and disadvantage

The advantage is having better shadows without the need to increase the Shadow maps size or the number of partitions.

The disadvantage is that by being calculated on each frame it may introduce artifacts like shimmering, since shadow pixels are not stable.

Uses of Sample Distribution

Sample distribution can be used for two things:

  • newFarComputation

  • aabbComputation

nearFarComputation

When you enable the csm/sample_distribution/nearFarComputation parameter, the code automatically calculates the Z range of the pixels inside the Scene that requires shadows.

This creates better fit for Shadow maps by calculating the precise znear and zfar of the scene pixels that needs shadows. See Setting the Z Range.

aabbComputation

When you enable the csm/sample_distribution/aabbComputation parameter, the code automatically calculates the range (in X,Y,Z) of the pixels inside the scene that requires shadows.

This creates better fit for Shadow maps by calculating the precise bounding box of the scene pixels that needs shadows.

For maximum precision, both these techniques should be used.

tolerance

The csm/sample_distribution/tolerance parameter may be required to fix precision issues due to the calculation of the Z and AABB ranges.

Tolerance makes the values calculated by the Sample Distribution a bit larger. The tolerance value is expressed as a percentage increase of the computed optimal values, both in negative and positive directions.

Increasing the tolerance value diminishes the Shadow maps fitting. Use it only to fix these kind of errors, but do not make the value too large.

In This Topic
TitleResults for “How to create a CRG?”Also Available in