Question

I found this link which explains a little about pcf shadow mapping. I looked through the code sample provided and I cannot work out what the offset array is. I'm assuming it is an array of float2 and I know that it will offset the pixel to give the neighbouring ones. I just can't figure out what the offset should be set too.

Link: http://www.gamerendering.com/2008/11/15/percentage-closer-filtering-for-shadow-mapping/

Here is the code

float result;
result = shadow2DProj(shadowMap,texCoord+offset[0]);
result += shadow2DProj(shadowMap,texCoord+offset[1]);
result += shadow2DProj(shadowMap,texCoord+offset[2]);
result += shadow2DProj(shadowMap,texCoord+offset[3]);
result /= 4.0; // now result will hold the average shading

I must just be missing something simple

Any help is appreciated

Thank you,

Mark

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top