Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Using textureGrad with cube map

  1. #1
    Junior Member Newbie
    Join Date
    May 2010
    Posts
    6

    Using textureGrad with cube map

    Hello,

    I have a code in glsl which samples an env map from a given direction.

    uniform samplerCube envSampler;
    varying vec3 direction;
    vec4 envColor = texture(envSampler, direction);

    I want to use textureGrad to specify explicit gradient for mipmap level computation.

    uniform samplerCube envSampler; (LINEAR_MIPMAP_LINEAR)
    varying vec3 direction;
    vec4 envColor = texture(envSampler, direction, dFdX(direction), dFdY(direction));

    If I read the spec correctly this should give the same result, but in practice it does not. Actually I have slight difference for mipmap level (and sometimes more than one level variation). And I do not multisampling for this test.

    Am I completely wrong ?

  2. #2
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Posts
    783
    See "comparable quality" in Issue (4) in the extension that introduced this function: ARB_shader_texture_lod.

  3. #3
    Junior Member Newbie
    Join Date
    May 2010
    Posts
    6
    Thanks a lot!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •