Sign in to follow this  

Point sprite size

This topic is 4660 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

Hi, I'm doing a particle system, and i would like to draw particles with point sprites instead of quads. But when i launch my program there's one really strange thing, when i'm far from the particles they are very very big, and when i approach the particles size is decreasing. And well this is not what I want :). This doesn't happen with quads so is there anyone here who can explain why this is happening, and how to get particles which keep the same size ?

Share this post


Link to post
Share on other sites
You have to set the attenuation.

glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB,quadratic)
glPointParameterfvARB(GL_POINT_THRESHOLD_SIZE_ARB, 60.0f)

set up max and min sizes too
set up tex env if you are using it

quadratic float[] = { 1.0f,0.0,0.01f}

you can change them but I really have not found much information on what those parameters exactly do and this works well in most cases.

There is a demo at code sampler you can download and look at. Only thing I do different is I use a VBO/array instead.

Share this post


Link to post
Share on other sites
Hi,

thanks for help, but i tried it and well, it doesn't do the same effect as quads. Wether you're near or far, with quads you keep the volume aspect of the particle system. But with point sprites, when you approach the particles you can see each particles and you loose the volume effect.
It's quite hard to explain and my english isn't that good :/
It seems like i'm going to keep quads for the particle system because i really don't see anything on the net that solve that problem

Share this post


Link to post
Share on other sites
You can always write a vertex program to adjust the size of each point. I tried the 1st reply's suggestion over the summer and found that the point sizes still didn't look right, because they don't completely mimic the gluPerspective camera model.

Share this post


Link to post
Share on other sites
Huh, I don't understand. I did this and my results are almost exactly the same as using quads. There are only a few effects that can't use point sprites effectively.

Other guy, could you by chance pose a code snippet on how you attenuated the point sizes in the vertex program? I have been stuck on how that is done.

Share this post


Link to post
Share on other sites

This topic is 4660 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this