Jump to content

Particle terrain collision performance


photo

Recommended Posts

The scene I am currently working in has a very large and expansive terrain in it, and a vehicle that emits a large amount of smoke that needs to collide with it.  The framerate will drop significantly (from 60 to <5) when particles are colliding with the terrain.  What would guys recommend to lessen this impact?  I considered modeling a low-poly representation of the terrain, but this could be a large amount of work and could be constantly changing in topology over time.

Link to comment

Hi there, Ken!

 

Another idea is to create one more terrain based on the same data with bigger step and less grid density that'll have invisible surfaces with "collision" & "intersection" flags enabled. That way you'll be able to uncheck "collision" & "intersection" flags on the first terrain.

 

Also, you can write a simple editor plugin which will create simplified collision mesh based on your terrain data so you won't have to model it by hands every time.

Link to comment

The scene I am currently working in has a very large and expansive terrain in it, and a vehicle that emits a large amount of smoke that needs to collide with it.  The framerate will drop significantly (from 60 to <5) when particles are colliding with the terrain.  What would guys recommend to lessen this impact?  I considered modeling a low-poly representation of the terrain, but this could be a large amount of work and could be constantly changing in topology over time.

 

I dont know your use case, so maybe it is wrong idea. But if I assume, that smoke is probably falling on the same place relatively to car position, I would create in that place(s) small flat rectangle collision surface, which will move with the car and will be always perpendicular on terrain normal in that point by some script. It is approximation, but it should be fastest thing possible.

Link to comment

I have been working in the same world as Ken, and the fps drop seams a little crazy to me. Just to test I had one of our devs drop 5000 physics spheres on the terrain and we still got over 10 fps when the smoke can easily drop the frame rate under 1 for us.  Why do particles colliding with the terrain cost so much more?  

 

Some of terrains we are working with are massive and i don't know how much a low poly mesh would actually help us.  We aren't simulating a car and the smoke can also fall pretty much anywhere with velocity in any direction not related to the terrain surface.  

 

I'm sure I'm missing something but it doesn't seam to me like it should as expensive of a check as it is.

Link to comment

Hi Dusty!

 

That's because physics is using broad-narrow phase algorithm to detect collisions between objects which is a good approach especially when objects are scattered across the world. ObjectParticles will do a raycast for each particle in order to determine intersection point and normal which will allow emitter to move the particle properly.

 

Imagine thousands of raycasts each frame, sounds slow to me. ;)

Link to comment
×
×
  • Create New...