PDA

View Full Version : dFdx dFdy textureGrad and texture



yjh1982
08-23-2010, 09:52 PM
texture and textureGrad have any diffrence?
because I found use texture and set GL_LINEAR have same effect.
I thinked texture no filter and textureGrad filter...


but since texture filter also,what mean is:
vec2 dPdx = dFdx( index );
vec2 dPdy = dFdy( index );
textureGrad(texID, index, dPdx, dPdy);?

ZbuffeR
08-23-2010, 11:55 PM
http://www.opengl.org/wiki/GLSL_Sampler#Gradient_texture_access

yjh1982
08-24-2010, 12:47 AM
thus mean :function texture don't select mipmap,and function textureGrad do?

ZbuffeR
08-24-2010, 03:09 AM
textureGrad allow to *change* the mipmap that would be used by the default algorithm, by tweaking the gradient values which are then used by the card to select the appropriate mipmap level(s).