Jump to content
  • Advertisement
Sign in to follow this  
Tjaalie

OpenGL GL_POINTS size????

This topic is 4864 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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,

Share this post


Link to post
Share on other sites
Advertisement
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.)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Quote:
Original post by MENTAL
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.
You wouldn't need to use billboards, you could just use glPointParameter to set up attenuation.

Share this post


Link to post
Share on other sites
God damnit I wish I paid more attention to the GL specs.

/me goes off to rewrite his particle renderer.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!