Cheezy pixel-shader-magnifying-glass effects, anybody?
float4 evaluate(float2 tc, float2 d, float x0)
{
float xd=tc.x-x0,
y=(1/2-1),
u=-(2*xd/0.01)*(2*xd/0.01),
E=exp(u/2);
float4 minmaxrms = tex1Dbias(sTex, float4(
tc.x + xd*y*E,
0, 0,
log2(2048*d.x * (1 + y*E*(1+u)))
));
// alpha 1 indicates biased texture
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
...
Zao, I've noticed when mucking around with LOD bias/mipmap levels that min/max levels are being averaged at lower LOD levels. As I understand the effect code, this isn't as much of a big deal with the default effect, because well, it completely ignores LOD and thus has massive aliasing issues of its own. But how possible do you think it would be to manually populate the mipmaps, by computing the max/min of the higher resolution texture samples, instead of letting DirectX average samples together?
And for the ultimate nitpick: Could you populate the .g value of minmaxrms with rms^2, so that sample averaging at lower LOD levels is meaningfully accurate?