On desktop OpenGL, points will sometimes be rendered as circles (if you have set gl_PointSize
in the vertex shader). I am tinkering with WebGL and it seems to consistently render points as squares (when gl_PointSize
is set). Is there a way to get them to render as circles?
Asked
Active
Viewed 2,104 times
3

Stephen
- 2,613
- 1
- 24
- 42
1 Answers
3
Yes, there is a solution. You can do that using point sprites. Just send texture to shader and using alpha blending cut of unnecessary part of sprite.
Normally (in desktop OpenGL) you may see points rendered as circles when you have got MSAA and POINT_SMOOTH feature enabled.
Below you have links where you can get all informations you need :)
OpenGL ES 2.0 Equivalent for ES 1.0 Circles Using GL_POINT_SMOOTH?
http://klazuka.tumblr.com/post/249698151/point-sprites-and-opengl-es-2-0
-
4I'd personally advice against using POINTS. Why? Because the maximum size you can draw a POINT is GPU specific where some GPUs only allow points of size 1. [See this answer for an alternative to POINTS](http://stackoverflow.com/questions/23048899/particle-system-using-webgl/23056518#23056518) – gman Apr 19 '14 at 02:23