![]() This might be further optimized by dropping the square root (used in the length function) and comparing against the squared radius: vec2 pt = gl_PointCoord - vec2(0.5) īut maybe the builtin length function is even faster than this, being optimized for length computation and maybe implemented directly in hardware. ![]() ![]() You can just use these to read a texture that contains a circle (pixels not in circle have color of 0) and then discard every fragment, whose texture value is 0: if(texture2d(circle, gl_PointCoord).r 0.5) glPointSize specifies the rasterized diameter of points. ![]() This gives you the coordinates of the fragment in the square of the current point. This means code I was using to draw circles no longer works: glEnable (GLPOINTSMOOTH) glPointSize (radius2) glDrawArrays (GLPOINTS,0,nPoints) Is there an equivalent in ES 2. Just enable point sprites and you get a special variable gl_PointCoord that you can read in the fragment shader. OpenGL ES 2.0 doesn't have the GLPOINTSMOOTH definition which ES 1.0 does. You can use point sprites to emulate this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |