Skip to main content
GameDev.net gamedev.net
🔒 Locked

Poisson-disk shadows filtering

Started by wh1sp3rik Apr 5, 2013 at 5:47 PM 0 replies 1.4k views
Original Post
wh1sp3rik
wh1sp3rik

Hello,

I am trying to understand, how this technique is working.

I am using standard PCF technique


// PCF 3x3
for(int x = -pcf; x<=pcf; ++x )
{
   for(int y = -pcf; y<=pcf; ++y )
   {
	 float realDepth  = shadowTexture.SampleLevel(ss,float2(lightWorldPosition.x*0.5+(cascade*0.5)+shadowTexel.x*x, -lightWorldPosition.y+shadowTexel.y*y),0 );
	 if( lightWorldPosition.z > realDepth+bias ) {} else shadowFinalColor += 1.0;
   }
}

shadowFinalColor/=(2*pcf+1)*(2*pcf+1);

But for good looking shadows, i have to use higher pcf values, which is not a good way. Also, my code can be better i know, it¨s just for testing.

What's a easiest way to get possion.disk filtering working ? I will be happy with some snippets.

thank you very much !

DirectX 11, C++

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.