Results 1 to 4 of 4

Thread: texture2D vs textureLOD

  1. #1
    Junior Member Newbie
    Join Date
    May 2012
    Posts
    23

    texture2D vs textureLOD

    Hello Everybody.
    Can anybody explain me in short what is the difference between texture2D and textureLod, and when one should be preferred over the other?

    Thanks,
    Heinrich

  2. #2
    V-man
    Guest

    Re: texture2D vs textureLOD

    According to
    http://www.opengl.org/registry/doc/G...ll.1.40.05.pdf

    texture2D has been deprecated in favor of texture. However, if you are targeting GLSL 1.10 , you can still use texture2D.

    texture2D is used in the fragment shader.
    textureLod is used in the vertex shader since the derivatives are not computed. There are no derivatives because a vertex is just a point. You need to select the mipmap yourself.

    Some texture functions (non-“Lod” and non-“Grad” versions) may require implicit derivatives. Implicit
    derivatives are undefined within non-uniform control flow and for vertex shader texture fetches.

  3. #3
    Junior Member Newbie
    Join Date
    May 2012
    Posts
    23

    Re: texture2D vs textureLOD

    Ok, and what is mipmap? (if this question is too stupid fell free not to answer...).

  4. #4
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,675

    Re: texture2D vs textureLOD


Similar Threads

  1. Texture2D
    By ultrablox in forum Vulkan
    Replies: 6
    Last Post: 08-02-2016, 07:59 AM
  2. Does textureLod perform filtering?
    By imported_JoshKlint in forum OpenGL: GLSL
    Replies: 2
    Last Post: 05-16-2016, 02:34 AM
  3. GLSL textureLod(): proper values for the lod parameter?
    By RealtimeSlave in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 06-06-2015, 01:06 AM
  4. textureLod + textureQueryLod == texture?
    By imported_Groovounet in forum OpenGL: GLSL
    Replies: 16
    Last Post: 09-29-2011, 11:59 AM
  5. TextureLod
    By Kiwaiii in forum OpenGL: GLSL
    Replies: 4
    Last Post: 06-15-2010, 11:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean