Jump to content
  • Advertisement
Sign in to follow this  

SDSM : Lamba and minimum distance

This topic is 622 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :
The only solution is to have a property to set a minimum on the range of the min/max from the SDSM pass ?

Edited by Alundra

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!