Try using texelFetch() with integer coordinates instead of texture2D() using texture coordinates. texelFetch doesn’t interpolate the texture data.
https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/texelFetch.xhtml
Try using texelFetch() with integer coordinates instead of texture2D() using texture coordinates. texelFetch doesn’t interpolate the texture data.
https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/texelFetch.xhtml