GL_POINTS size????
Hello Thread reader,
I programm for a while but i just started with OpenGL,
and im making some kind of level editor using the GL_POINTS type.
So my question is there a way i can change the size of a point drawn with
the GL_POINTS type. I know there is some kind of extencion or
something but i don't know where i can get some info about
it. All you help is apricated.
Tjaalie,
glPointSize(2.0);
The points will be square, unless you turn on glEnable(GL_POINT_SMOOTH), then they will be round and smooth and pretty.
Edit: Oh yeah, and turn on blending for the round dots, as Fruny notes. Something like this should do that:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
(Not sure if setting the blendfunc is even necessary.)
The points will be square, unless you turn on glEnable(GL_POINT_SMOOTH), then they will be round and smooth and pretty.
Edit: Oh yeah, and turn on blending for the round dots, as Fruny notes. Something like this should do that:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
(Not sure if setting the blendfunc is even necessary.)
Quote:The points will be square, unless you turn on glEnable(GL_POINT_SMOOTH), then they will be round and smooth and pretty.
IIRC, you also need to enable alpha blending.
I should also point out that this size is fixed, regardless of how far away the point is (so a point at 10km is the same size as one at 1m). If you want your points to get bigger and smaller like other objects then you will need to look at billboards instead.
Quote:Original post by MENTALYou wouldn't need to use billboards, you could just use glPointParameter to set up attenuation.
I should also point out that this size is fixed, regardless of how far away the point is (so a point at 10km is the same size as one at 1m). If you want your points to get bigger and smaller like other objects then you will need to look at billboards instead.
God damnit I wish I paid more attention to the GL specs.
/me goes off to rewrite his particle renderer.
/me goes off to rewrite his particle renderer.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement