GLSL texture2DGrad and texture2D

Started by
0 comments, last by Tree Penguin 15 years, 9 months ago
Hi. Because of manual tiling in a fragment shader, I need to supply texture coordinate derivatives myself to avoid mipmapping artifacts at the texture borders, as you can see here. I first tried texture2DLod, but that doesn't support anisotropic filtering. texture2DGrad does (according to the GLSL and g80 specs) but I am having a hard time replicating the AF quality (or even getting AF at all) I get with a normal texture2D call. My question is, shouldn't these two calls (below) give the same results. If not, what am I doing wrong? If so, is there any other reason these two lines would have different outcomes? texture2D(sampler, tc); texture2DGrad(sampler, tc, dFdx(tc.x), dFdy(tc.y)); Thanks!
Advertisement
Sorry, it appears I should've used

texture2DGrad(sampler, tc, dFdx(tc), dFdy(tc));

as ddx and ddy are vec2 parameters and dFdx and dFdy give you the same type as you feed them.

Another afternoon wasted on misreading something :(.

This topic is closed to new replies.

Advertisement