PDA

View Full Version : textureGrad implementation



Gessos Paul
07-17-2016, 07:42 AM
I am a little confused about what can be a possible implementation of textureGrad for 2d textures.
min/mag: linear_mipmap_linear / linear.
Implementation must be based on texelFetch.
Texture dimensions are w/h.

Which lod is chosen when du/dx=5 and dv/dy=20? (du/dy=dv/dx=0).

I am trying procedural texturing and this info will be helpful.

GClements
07-17-2016, 11:39 AM
I am a little confused about what can be a possible implementation of textureGrad for 2d textures.
min/mag: linear_mipmap_linear / linear.
Implementation must be based on texelFetch.
Texture dimensions are w/h.

Which lod is chosen when du/dx=5 and dv/dy=20? (du/dy=dv/dx=0)

The LoD will be log2(20)~=4.32.

The calculation is given in 8.14.1 of the OpenGL 4.5 specification.