texelFetch

This topic contains 5 replies, has 2 voices, and was last updated by  dgu 2 years, 9 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #31928

    dgu
    Member

    Hello

    Dear Team ,what would be the best translation or equivalent for texelFetch in opengl es 2 ???
    same question about dFdx
    any idea ?

    david

    #39326

    what would be the best translation or equivalent for texelFetch in opengl es 2 ?

    Assuming a 2D texture, disable anisotropic filtering and use texture2DLod(), providing it a texture coordinate that maps to to the center of a texel. For instance, for a texture N wide, tc=(tf_tc+0.5)/N

    same question about dFdx

    That’s a bit more tricky because these functions “peek” at the values of the function in neighboring fragments/threads to compute their result.

    Probably best to see if you can get what you need from filtered texture accesses, which use this derivative information to determine how to do filtering. In fact, you could “sense” the LOD with a specially-built MIPmapped texture.

    #39327

    dgu
    Member

    Thanks alot for the clear answer, the khronos group definition was not very clear for that.
    dFdx is really tricky, opengles 2 got so much restriction but…no real choices.
    thanks alot

    #39328

    A quick follow-up. While disabling anisotripic filtering (along with trilinear filtering) would be needed for raw texture2d(), for texture2dLod() it probably isn’t needed — I think this function implicitly bypasses anisotropic filtering.

    #39329

    dgu
    Member

    Hello Dark Photon , i dont follow you here 🙂 you mean by enabling EXT_texture_filter_anisotropic ?

    #39330

    dgu
    Member

    thanks alot , the texelFetch prob solved

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.