float3 color = 0;
float weights = 0;
for (float sampleX = -1; sampleX <= 1; sampleX += 2 / 25)
{
for (float sampleY = -1; sampleY <= 1; sampleY += 2 / 25)
{
float weight = 1;
weights += weight;
color.rgb += weight * tex2D(someSampler, texCoord).rgb;
}
}
color.rgb /= weights;
I don't think that the contrast errors are related to gamma as I'm not really calculating anything with the colors. It think they are somehow related to floating point precision errors. Is there any solution to my problem? Note that the weights may vary.
If you don't see the differences: The blacks aren't as black anymore...