Jump to content
• ### What is your GameDev Story?

• Advertisement

# Help with ARB point Sprites

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

##### 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

##### 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

##### 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

##### 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

##### Share on other sites
I would just use billboard quads.

#### Share this 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

##### Share on other sites

• Advertisement
• Advertisement
• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• ### Popular Now

• 19
• 15
• 10
• 9
• 11
• Advertisement
• ### Forum Statistics

• Total Topics
634097
• Total Posts
3015511
×

## Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!