Hi guys,
Right now I offset my shadowmap lookups with an array of constant values. I'm not sure if that's such a good idea since every pixel has the same sampling pattern.
I think the way to go is to fill a texture with random offset values but I don't know how to access them that way, what should I use for the uv values ?
I'm doing this now:
static const float2 Offsets[8] =
{
float2(0.560991f, 0.741455f),
...
};
for(int i=0;i<8;i++){
occluder=tex2D(ShadowMap,input.proj.xy+Offsets[i]*0.001f).x;
sum += (occluder < receiver) ? 0 : 1;
}
shadow=sum/8;
I'd like a better way that isn't terribly complicated. Thanks a lot.