SDSM : Lamba and minimum distance

Started by
-1 comments, last by Alundra 7 years ago

Hi,
SDSM is a good improvement on the shadow quality.
You find the min and max distance from the depth buffer.
You then compute the split like that :


const float Lambda = 0.5f;
const UInt32 NumCascades = 4;
const float ClipRange = CameraComponent->GetFarClipPlane() - CameraComponent->GetNearClipPlane();
m_CascadeSplitArray[ 0 ] = MinDistance * ClipRange;
m_CascadeSplitArray[ NumCascades ] = MaxDistance * ClipRange;
const float Range = m_CascadeSplitArray[ NumCascades ] - m_CascadeSplitArray[ 0 ];
const float Ratio = m_CascadeSplitArray[ NumCascades ] / m_CascadeSplitArray[ 0 ];
for( UInt32 Split = 1; Split < NumCascades; ++Split )
{
  const float p = static_cast< float >( Split ) / static_cast< float >( NumCascades );
  const float Log = m_CascadeSplitArray[ 0 ] * CMath::Pow( Ratio, p );
  const float Uniform = m_CascadeSplitArray[ 0 ] + ( Range * p );
  m_CascadeSplitArray[ Split ] = Lambda * ( Log - Uniform ) + Uniform;
}

I use a Lamba of 0.5f but is it needed to set this value in the scene properties ?
Another issue is when you are very near from a geometry then you got this issue :
s8d9.png
The only solution is to have a property to set a minimum on the range of the min/max from the SDSM pass ?
Thanks

This topic is closed to new replies.

Advertisement