21-09-2017, 11:26 AM
(This post was last modified: 21-09-2017, 12:09 PM by sunyifeng83.)
(21-09-2017, 11:02 AM)josemendez Wrote: Hi!
The settings seem ok, the problem is definitely collision detection. How complex are your colliders, and how big are their bounding boxes?
MeshColliders are extremely costly to collide against (since each triangle in them costs roughly the same as a primitive collider) and are better avoided unless it's not possible. Now, if the bounding box of your colliders is big enough to enclose the entire room, it means each particle in the fluid is being tested for collisions against every triangle in all walls every frame. This would explain your low performance. Say your walls have 1000 triangles each, and you have 4 of them. If their bounding boxes enclose the emitter, then you're performing 1000x4000 = 4 million sphere/triangle intersection tests every frame.
A solution would be to switch to primitive colliders (which are much cheaper), or if the problem is the bounding boxes, try to split your meshes so that the bounding box is tighter and the fluid only checks for collision against a wall when very close to it.
A screenie of your whole scene, with the colliders selected would allow me to give more info.
Hi jose,
I attached the colliders setting image here. The 4 walls using meshcolliders. others use primitive colliders. I'll try remove the meshcolliders.
Hi jose,
I found I have many small mesh colliders in the classroom also. Maybe they will cause the problem. I will remove them and testing again.
Hi jose,
I have removed the redundent mesh colliders for small objects. The wall's colliders also removed. But the collision processing still have a big impact on the performance. Now the WaitForAllTasks spent 30ms. It's still not normal.