exact coordinates of gl_PointCoord?
Clash Royale CLAN TAG #URR8PPP exact coordinates of gl_PointCoord? In a vertex i give pointSize a value bigger than 1. Say 15. In the fragment i would like choose a point inside that 15x15 square : vec2 sprite = gl_PointCoord; if (sprite.s == (9. )/15.0 ) discard ; gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); But that does not work when Size is not a power of 2. (if size is 16, so (sprite.s == a/16.) where a is in 1..16 : Perfect !) is a way to achieve my purpose where size is not of power of 2 ? edit : i know the solution with a texture of size : PointSize * PointSize gl_FragColor = texture2D(tex, gl_PointCoord); but that not fit for dynamic change edit 26 july : first I do not understand why it is easier to read in a float texture using webgl2 rather than webgl. For my part I make an ext = gl.getExtension ("OES_texture_float"); and the gl.readpixel uses the same syntax. Then, it is certain that I did not understand everything but I tried the solution s = 0.25 and s = 0.75 ...