About Store Forum Documentation Contact



Post Reply 
Particles, frustum and framerate
Author Message
3DRaddict Offline
Member

Post: #1
Particles, frustum and framerate
I'm currently experiencing a problem relating to framerate whilst displaying particle emitters. The engineer in me finds it easier to explain by means of diagrams, so just follow the sequence below and my problem will reveal itself:

[Image: particleproblem1.jpg]

[Image: particleproblem2.jpg]

[Image: particleproblem3.jpg]

[Image: particleproblem4.jpg]

[Image: particleproblem5.jpg]

[Image: particleproblem6.jpg]

One can see that as the camera approaches the long line of particle emitters, the framerate is fine until a certain distance from the emitters is reached, whereupon there is a sudden drop. As soon as the camera has passed through the line of emitters,it jumps rapidly to the standard 60fps.
Each emitter is delivering 80 particles and the are 256 emitters.
To me, it appears that the more emitters inside the frustum then the better the framerate, and vice versa.
Are the emitters outside the frustum getting culled automatically, or not?

Also, changing the direction of view when close to (and fairly far from) the line of particle emitters leads to drastic decreases in framerate (from 60fps, jumping directly to the range 10fps to 30fps.

[Image: particleproblem7.jpg]

[Image: particleproblem8.jpg]
(This post was last modified: 03-11-2015 09:23 AM by 3DRaddict.)
03-11-2015 09:15 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #2
RE: Particles, frustum and framerate
I'm not sure what the issue could be, but maybe:

1. Since you are so close to the particles, they nearly fill your entire screen. This means that there will be alpha-overlays drawn to your entire screen. I don't know how much of a performance difference this can make. I always heard opacity is an FPS killer.

2. Maybe the particles get more detailed the closer you get?
03-11-2015 09:45 AM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #3
RE: Particles, frustum and framerate
Quote:1. Since you are so close to the particles, they nearly fill your entire screen. This means that there will be alpha-overlays drawn to your entire screen. I don't know how much of a performance difference this can make. I always heard opacity is an FPS killer.

That is a reasonable possibilty, but it does not explain the drop in framerate that occurs when the camera is fairly far from the particles (and facing them directly) with a decent framerate of 60fps, then I just have to twist the camera slightly to the left/right and the frame rate drops to the 15 to 30 range

Quote:Maybe the particles get more detailed the closer you get?

Each particle is a simple image, not a mesh. There is no increase in number of particles/emitter as I get closer.

Something else to add to the melting pot:

In my attempts to get to the root of the problem, I actually placed to whole line of emitters out of sight below ground level, and as the camera passed over the spot where they were hiding, the framerate dropped rapidly again.
(This post was last modified: 03-11-2015 10:16 AM by 3DRaddict.)
03-11-2015 10:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
georgatos7 Offline
Member

Post: #4
Particles, frustum and framerate
Could it be that the opacity rendering/shader is a bit heavy? To me that's what it sounds like.

About the rotation thing it might be that due to the camera projection the actual particle size on the screen is higher when the are located towards the sides of the screen. I have seen this with my shaders also in a similar looking to the side view but the fps drop wasn't so dramatic.

[Image: harharhar.jpg]

What i have seen happening with shaders is that you can have a shader with "Sync off":
100 samples/pixel, 300 fps
400 samples/pixel, 270 fps
430 samples/pixel, 30 fps (possible gpu bottleneck point?)

So maybe by moving to the side you are reaching that bottleneck, maybe try reducing the number of particles and run with sync off and see if the fps drop is more reasonable (e.x. 120 to 100) while on the side or if it makes any sense in general, but in the end Esenthel will know better what's going on.
(This post was last modified: 03-11-2015 11:18 AM by georgatos7.)
03-11-2015 10:54 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #5
RE: Particles, frustum and framerate
Isn't this due to an insane amount of fillrate?

Found this good to read.
http://realtimecollisiondetection.net/blog/?p=91
03-11-2015 04:02 PM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #6
RE: Particles, frustum and framerate
Thanks, guys, for all your input into this.
The article from Zervox makes interesting reading, and seems to support the observations made by Tottel and Georgatos regarding opacity. Some of the solutions suggested in the article regarding frame buffers are a little lost on me, but I'll try playing around with the more simple solutions. I'm creating the particles in the EE Particle Editor, then using this code to place them in my project:
PHP Code:
for( int i=0i<255i++)
   {
      
Game.ObjParamsPtr p=UID(1823282653109790292823397927972347646999); 
      
Game.World.objCreate(*Matrix(p->scale3(), Vec(-1022-i, -6.0, -1500)));  
   }

   
   for( 
int i=0i<ObjParticles1.elms(); i++)
   {
       
ObjParticles1[i].pos(Vec(-1022-i, -6.0, -1500));
   } 

I've already tried reducing the number of particles from 80/emitter to 40/emitter, and is making an improvement.
(This post was last modified: 03-11-2015 04:37 PM by 3DRaddict.)
03-11-2015 04:34 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #7
RE: Particles, frustum and framerate
That's a really interesting article Zervox
03-11-2015 04:42 PM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #8
RE: Particles, frustum and framerate
I've mentioned in another post that I've made recently that I was interested in finding out about the use of 'RawParticles' (see Particle API). and was wondering if these would be of any use in this particular case?
03-11-2015 04:45 PM
Visit this user's website Find all posts by this user Quote this message in a reply
para Offline
Member

Post: #9
RE: Particles, frustum and framerate
I saw similar issues with transparent particles close to the camera also with some other games/engines. I also had this problem when I tried to create a sandstorm from big dust particles that were flying around the camera in the previous engine I used.

With Esenthel I've just done camp & torch fires, rain, chimney smoke, car exhaust smoke, and similar smaller sized effects, nothing that would show this problem very often. Just as a quick test I loaded one of my projects and placed the camera in the middle of a smoke emitter (200 car exhaust smoke particles)and the fps drops from 130 to 40 :(
(This post was last modified: 03-11-2015 06:19 PM by para.)
03-11-2015 06:18 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
RE: Particles, frustum and framerate
Hi,

This most certainly is due to fill-rate.
Try reducing the amount of particles.
Alternatively use a simpler pixel shader with particle softing disabled (D.particlesSoft(false) or something like that).
03-11-2015 11:05 PM
Find all posts by this user Quote this message in a reply
Post Reply