• Create Account

### #ActualPixelSmasher

Posted 07 February 2013 - 12:39 PM

Sorry it was like I was talking to myself ^^

I've already encountered this problem while coding PCF, the problem was located in

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize);

I remember that the solution was something like:

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize + float2(0.5, 0.5));


EDIT : or it could be something similar when you compute your offsets in:

float2 offset = float2(x, y) * (1.0f / ShadowMapSize);


Try:

float2 offset = (float2(x, y) + float2(0.5, 0.5)) * (1.0f / ShadowMapSize);


### #6PixelSmasher

Posted 07 February 2013 - 12:38 PM

Sorry it was like I was talking to myself ^^

I've already encountered this problem while coding PCF, the problem was located in

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize);

I remember that the solution was something like:

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize + float2(0.5, 0.5));


EDIT : or it could be something similar when you compute your offsets in:

float2 offset = float2(x, y) * (1.0f / ShadowMapSize);


Try:

float2 offset = (float2(x, y) + float2(0.5, 0.5)) * (1.0f / ShadowMapSize);


### #5PixelSmasher

Posted 07 February 2013 - 12:35 PM

Sorry it was like I was talking to myself ^^

I've already encountered this problem while coding PCF, the problem was located in

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize);

I remember that the solution was something like:

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize + float2(0.5, 0.5));


EDIT : or it could be something similar when you compute your offsets in:

float2 offset = float2(x, y) * (1.0f / ShadowMapSize);


Try:

float2 offset = float2(x + 0.5, y + 0.5) * (1.0f / ShadowMapSize);


### #4PixelSmasher

Posted 07 February 2013 - 12:34 PM

Sorry it was like I was talking to myself ^^

I've already encountered this problem while coding PCF, the problem was located in

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize);

I remember that the solution was something like:

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize + float2(0.5, 0.5));


EDIT : or it could be something similar when you compute your offsets in:

float2 offset = float2(x, y) * (1.0f / ShadowMapSize);


### #3PixelSmasher

Posted 07 February 2013 - 12:33 PM

Sorry it was like I was talking to myself ^^

I've alreday encountered this problem while coding PCF, the problem was located in

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize);

I remember that the solution was something like:

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize + float2(0.5, 0.5));


EDIT : or it could be something similar when you compute your offsets in:

float2 offset = float2(x, y) * (1.0f / ShadowMapSize);


### #2PixelSmasher

Posted 07 February 2013 - 12:31 PM

Sorry it was like I was talking to myself ^^

I've alreday encountered this problem while coding PCF, the problem was located in

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize);

I remember that the solution was something like:

float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize + float2(0.5, 0.5));


PARTNERS