0

Today when I read the part of Moving the Light in Texel-Sized Increments in the msdn document Common Techniques to Improve Shadow Depth Maps to try to solve the problem of shadow map shimmering, I cannot under the meaning of the variable fCascadeBound here.

FLOAT fWorldUnitsPerTexel = fCascadeBound /
        (float)m_CopyOfCascadeConfig.m_iBufferSize;
        vWorldUnitsPerTexel = XMVectorSet( fWorldUnitsPerTexel, fWorldUnitsPerTexel,                         0.0f, 0.0f );

What is the cascade bound? Why the texel-size increment can be computed like this? I hope anyone can explain it to me.

1 Answers1

0

fCascadeBound is named from "Cascaded Shadow Maps" (here is an example in OpenGL of what they are).

It's probably here because they use it with cascaded shadow maps, which mean that it's the size of the frustum of one of the cascade.

Image of cascaded shadow maps with multiple frustums.

As for why it can be computed like this, it's because you're taking the size of one pixel in the depth buffer (1.0f / (float)m_CopyOfCascadeConfig.m_iBufferSize) and then computing how much space it would take in the frustum, so you multiply it to the size of the pixel. It then gives you fCascadeBound / (float)m_CopyOfCascadeConfig.m_iBufferSize.

TOOL
  • 70
  • 1
  • 10