Hello all
I am currently facing an odd issue with mipmaps. The terrain im rendering has several layers of textures and they are not all scaled the same. Therefore i have created my shader like this:
cbuffer DataBuffer : register(c1)
{
float4 texScale;
};
//.....
float4 tex1 = texture0.Sample(texSampler, texCoord * texScale.x);
float4 tex2 = texture1.Sample(texSampler, texCoord * texScale.y);
float4 tex3 = texture2.Sample(texSampler, texCoord * texScale.z);
float4 tex4 = texture3.Sample(texSampler, texCoord * texScale.w);
The problem is, that this generates extremely bad results, it almost seems like the mipmaps are not used at all, see:
This also holds true if the buffer containing texScale holds 4 times the value 1 (verified using 2 different frame inspectors)
If i change the code to this:
float4 tex1 = texture0.Sample(texSampler, texCoord);
float4 tex2 = texture1.Sample(texSampler, texCoord);
float4 tex3 = texture2.Sample(texSampler, texCoord);
float4 tex4 = texture3.Sample(texSampler, texCoord);
It looks ok:
This is extremely strange especially when i see that texScale is also 1/1/1/1 and then it creates completely wrong results.
For the verification, see:
Is there something im missing about texture sampling?
Thanks in advance,
Plerion