Jump to content
  • Advertisement
Sign in to follow this  
grunt123

PCF shadow filter using Gather() function

This topic is 2859 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

I'm not exactly sure how to create pcf shadow filter with gather function properly. If i do depth-compare with each of four components returned by the function, (and the add them up and divide the result by filter size), i'm getting aliasing visual glitch.

I've been trying to do bilinear interpolation on the four components returned by the function and then do depth-compare, but wasn't very successful (still visual glitch) Is there something i'm missing?

(i know that you can use samplecompare or gathercmp (shader 5.0 only) ...but want to know if there's any way to do pcf filter with gather function.)

Share this post


Link to post
Share on other sites
Advertisement
Averaging the samples doesn't really give great results. What you really want is to weight each sample based on its coverage. Typically this is done by getting the fractional component of the unnormalized texture coordinate (in other words, multiplied with the texture dimensions) and using that to lerp between your samples.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!