Jump to content
  • Advertisement
Sign in to follow this  
DJTN

Performance Issue with Size

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

I have a repeater type particle engine that uses quads in a dynamic vertex buffer. Each frame the position in the buffer is updated, with the shader calculating the vertices position based off the view matrix to face the camera. Inside this vertex shader the scaling is performed per vertex (scaling each particle independently).

When increasing the scaling variable significantly, the frame rate starts to drop. This is especially noticeable the closer the camera gets to the particle. The larger the scale variable – the larger the frame rate drops.

At first I thought this might be a filtering issue so I set all the filters in the shader to NONE. This did not solve the issue so I thought it could be the auto generated mipmaps so I disabled those but this did not solve the issue either.

I’ve noticed there is some sort of threshold with the scaling variable. For example, I can have a texture that is 64 x 64 px for one particle and another with a texture that is 128 x 128. The 128 particle will accept a larger scale factor before dropping the frame rate.



I can put a ceiling on scaling and max size in the engine but I’d like to understand this behavior first.

Share this post


Link to post
Share on other sites
Advertisement
It's just simple overdraw. First of all you're drawing the entire scene, then you're drawing more geometry that covers most of the viewport, and most likely doing a blend too. Even with just one such particle you're touching every pixel in the viewport one extra time, so a perf drop is expected behaviour. The more particles you draw that are reasonably close to the viewpoint the more overdraw you get, the more you become fillrate-bound, and the lower your performance goes.

Share this post


Link to post
Share on other sites
Thanks for the reply mHagain. Any recomendation on how I can prevent overdraw and fillrate issues in regards to particles? Culling is not an option but I thought about rendering to an offscreen buffer that is smaller than the backbuffer -but I'm not sure if I can fit this into my timeline.

Anything I can do to get by until I can implement a solid soloution?

Share this post


Link to post
Share on other sites
some general techniques:

- Try to achieve the same effect with less particles
- Fade out/disable particles that are too close
- Limit particle (screen)size
- Render to smaller offscreen buffer (what you brought up)

IMHO the first ist the most important. If you are not experienced with particle systems you tend to throw more and more (graphically) light particles at the engine until it looks cool. However, often it's better to have a few "fat" particle textures with variations.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!