samplerCubeShadow and texture offset
- by Irbis
I use sampler2DShadow when accessing a single shadow map. I create PCF in this way:
result += textureProjOffset(ShadowSampler, ShadowCoord, ivec2(-1,-1));
result += textureProjOffset(ShadowSampler, ShadowCoord, ivec2(-1,1));
result += textureProjOffset(ShadowSampler, ShadowCoord, ivec2(1,1));
result += textureProjOffset(ShadowSampler, ShadowCoord, ivec2(1,-1));
result = result * 0.25;
For a cube map I use samplerCubeShadow:
result = texture(ShadowCubeSampler, vec4(normalize(position), depth));
How to adopt above PCF when accessing a cube map ?