Some time ago I wrote a program demonstrating shadowmapping (using GLSlang). It worked OK. However, I decided to play with soft shadows. I want to sample the shadowmap 5 times, but only the first call works - next calls return 1.0.
I tried both sampling from a single texture unit and sampling from 5 texture units (containing identical textures). Basically, it seems that
float f0 = shadow2DProj(ShadowTex,TexCoord).x;
float f1 = shadow2DProj(ShadowTex1,TC1).x;
float f2 = shadow2DProj(ShadowTex2,TC2).x;
float f3 = shadow2DProj(ShadowTex3,TC3).x;
float f4 = shadow2DProj(ShadowTex4,TC4).x;
f = f0+f1+f2+f3+f4;
and
float f0 = shadow2DProj(ShadowTex,TexCoord).x;
float f1 = shadow2DProj(ShadowTex,TC1).x;
float f2 = shadow2DProj(ShadowTex,TC2).x;
float f3 = shadow2DProj(ShadowTex,TC3).x;
float f4 = shadow2DProj(ShadowTex,TC4).x;
f = f0+f1+f2+f3+f4;
are equal to
float f0 = shadow2DProj(ShadowTex,TexCoord).x;
float f1 = 1.0;
float f2 = 1.0;
float f3 = 1.0;
float f4 = 1.0;
f = f0+f1+f2+f3+f4;
and not equal to
float f0 = shadow2DProj(ShadowTex,TexCoord).x;
float f1 = f0;
float f2 = f0;
float f3 = f0;
float f4 = f0;
f = f0+f1+f2+f3+f4;
Each of the texture instruction works, but only when it is the first one.
Any help will be appreciated…
I have Radeon 9800 and Catalyst 4.8