I am trying to export my game for HTML5 so I converted project to GLES2 from GLES3. The game heavily depends on shaders. In GLES3 I was using texelFetch to access some data in shader script but once I converted it to GLES2 I get following error:

"texelFetch(sampler2D, ivec2, int)" is supported only on high-end platform!

Is there any other way to access sampler2D values? texture( sampler2D, UV) doesn't work because it doesn't return exact values (I searched and found out that it applies some filters but I'm not sure what that means)

Why can't you use texture()? I've never had any problems with it.

The second function only applies a filter if you setup the sampled texture to do so. Most if not all Godot textures have a filter property. If you disable that along with mipmaps you are guaranteed to have no filters applied to the texture.

Also when converting from texelFetch to texture, bare in mind that their coordinate systems are different. The first one has a range of (0, texture size), while the other has the range of (0, 1).

    @SIsilicon28 said: The second function only applies a filter if you setup the sampled texture to do so. Most if not all Godot textures have a filter property. If you disable that along with mipmaps you are guaranteed to have no filters applied to the texture.

    Also when converting from texelFetch to texture, bare in mind that their coordinate systems are different. The first one has a range of (0, texture size), while the other has the range of (0, 1).

    Thank you! It worked but texture still has very low accuracy. texelFetch was able to extract values from sampler2D with 32 bit float accuracy

      3 years later