texelFetch

Hello



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

same question about dFdx

any idea ?



david

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.

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

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.

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

thanks alot , the texelFetch prob solved