Jump to content
  • Advertisement
Sign in to follow this  
Deathscythe

Help with ARB point Sprites

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

My point sprits don't seem to be scaling down as thier distance from the camera increases. I think these two lines determine how it's supposed to be scaled: // This is how will our point sprite's size will be modified by // distance from the viewer float quadratic[] = { 1.0f, 0.0f, 0.01f }; glPointParameterfvARB( GL_POINT_DISTANCE_ATTENUATION_ARB, quadratic ); However, I can't find any documentation on what the coefficients should be and how they relates to scaling. Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
This is explained in the GL specs, the final size of a point is:

clamp( size * sqrt(1/(a+b*d+c*d^2)) )

With size being the size specified for the point and d the distance from the eye. The clamp function clamps the size to whatever hardware limit there is. Finally, a, b and c are those three values you specify with glPointParameter.

Share this post


Link to post
Share on other sites
try something like (off the top of my head) to see it most apparent
float quadratic[] = { 0.0f, 0.1f, 0.0f };

Share this post


Link to post
Share on other sites
Is there any what to find out what that d value is at any given time? My particle's size doesn't seem to be decreasing as a function of distance.

Share this post


Link to post
Share on other sites
I had a similar problem when I started using point sprites, but my problem was that I couldn't get the point to be large enough when I was close. The largest point it would draw was somewhere around 57 pixels. I ended up doing the pixel size calculation inside a vertex shader. The problem with this is that there is no way to get correct perspective distortion, since you can only control the size at the center of the point sprite. The result is that the points appear to grow when they reach the edge of the screen!!

If anyone has an elloquent sollution to this, please post!

[Edited by - renderer on June 8, 2005 5:56:00 PM]

Share this post


Link to post
Share on other sites
Is this project by any chance for the games class (ICS 187)?

[Edited by - renderer on June 8, 2005 5:09:41 PM]

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!