Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

cody

point sprites?

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

is there anything like direct3d point sprites in opengl which is equally fast? im asking because the performance of my particles sucks... cody

Share this post


Link to post
Share on other sites
Advertisement
why does performance suck?
find the cause + then look for a solution.
ie benchmark seperatly the calculations, the rendering etc + find the bottleneck

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
>is there anything like direct3d point sprites in opengl which is equally fast?

From the Direct3D-documentation:

"Point sprites are not supported in the fixed-function geometry pipeline. To use point sprites, programmable vertex processing must be used."


After reading that i got the impression that fast point-sprites are supported via vertex-shaders.

Anyhow, to speed up your particle system you should try and render your particle-polygons in bigger batches. Don''t use matrix operations on a per-particle basis, since it will be extremely slow (though loadidentity() translatef() can be quite fast on a T&L card). Instead you can calculate the particle facing, stretching, and what ever you need for each particle and then add the 2 (or 1 if you''re really optimizing) polygon(s) that represent the particle to a list of polygons and render all of them in a single call using glDrawElements(). The optimum size of the list is something you''ll have to find out for yourself.

But anyway, i''m just a stupid foreigner and i might be wrong.


--BerLan

Share this post


Link to post
Share on other sites
render all of them in a single call using glDrawElements()
glDrawArrays() will be quicker (no vertex reuse)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
i just wrote the particle system very quick so i just use my normal 3d-objects and every frame i calculate a matrix for each particle to face the camera. i thought i would replace this with point sprites anyway.

i think i should render the particles in 2d-mode to avoid the expensive matrix calculations. but how do i calculate the size of the particles on the screen? from distance and camera fov?

Share this post


Link to post
Share on other sites
>>i just wrote the particle system very quick so i just use my normal 3d-objects and every frame i calculate a matrix for each particle to face the camera<<

no wonder fps sucks, only do this once each frame ala
http://nate.scuzzy.net/gltut/
(its not a true billboard but it looks good enuf + its what all games do)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites

  • 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!