habe compiler fehler was ich nicht verstehe.
Code: Alles auswählen
float2 projectTexCoord;
float depthValue;
//PCF sampling for shadow map
float sum = 0;
float x, y;
float2 smTex;
//perform PCF filtering on a 4 x 4 texel
for (y = -1.5; y <= 1.5; y += 1.0)
{
for (x = -1.5; x <= 1.5; x += 1.0)
{
smTex = projectTexCoord.xy + texOffset(x,y);
sum += shaderShadowMapTexture.Sample( SMSampleType, smTex).r;
}
}
float sunFactor = sum / 16.0f;
depthValue += sunFactor; // so geht nicht?? fehler! obwohl beides float ist
depthValue ist auch float
wenn ich so mache geht alles:
Code: Alles auswählen
float sunFactor = 0.01f / 16.0f;
depthValue += sunFactor;
und so kommt compiler Fehler?!:
Code: Alles auswählen
float sunFactor = sum / 16.0f;
depthValue += sunFactor;
wenn ich das hier auskommentiere: depthValue += sunFactor; geht wieder alles??
Code: Alles auswählen
float sunFactor = sum / 16.0f;
//depthValue += sunFactor;