Jump to content

  • Log In with Google      Sign In   
  • Create Account


Performance Issue with Size


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 DJTN   Members   -  Reputation: 207

Like
0Likes
Like

Posted 19 July 2012 - 07:56 AM

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.

Sponsor:

#2 mhagain   Crossbones+   -  Reputation: 7431

Like
1Likes
Like

Posted 19 July 2012 - 10:12 AM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 DJTN   Members   -  Reputation: 207

Like
0Likes
Like

Posted 20 July 2012 - 11:58 AM

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?

#4 Madhed   Crossbones+   -  Reputation: 2492

Like
2Likes
Like

Posted 20 July 2012 - 12:22 PM

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.

#5 DJTN   Members   -  Reputation: 207

Like
0Likes
Like

Posted 21 July 2012 - 09:03 AM

Thanks Madhed!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS