Imagination PowerVR SDK Blog

texelFetch


#1

Hello



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

same question about dFdx

any idea ?



david


#2
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.

#3

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


#4

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.


#5

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


#6

thanks alot , the texelFetch prob solved