Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How to optimize collisions?
#9
(16-10-2024, 11:51 AM)josemendez Wrote: Obi physics is invoked every frame. Collisions are just part of physics, and are also solved every frame (in case there's any).


Overdraw happens when particles overlap each other in screen space. The amount of particles is largely irrelevant: very few, large articles could cause a huge amount of overdraw, or lots of particles cause no overdraw at all.

A typical problematic case is alpha-blended fog particles where there's few large particles that almost completely overlap each other, to achieve a layered/volumetric fog effect. This requires drawing the same area of the screen over and over - which is what overdraw is. Fire can also be a problem if you rely on large-ish particles that cover the same area of the screen. On the other hand, even if you had thousands of particles you'd have no overdraw issues as long as they don't overlap each other. So a rule of thumb for particle system optimization is to use many small particles that don't overlap instead a few large ones that do, as that will kill performance due to overdraw. This is specially the case when using alpha or additive blending instead of alpha testing.

Of course, camera point of view also plays a role here. If you look at a particle system from afar, you'll get little overdraw since particles cover a very small portion of the screen. If you get up close to the same particles so that they take up most of the screen, you'll get lots of overdraw.


This doesn't make any sense, as I mentioned: overdraw and physics are not related in any way, shape or form. It's impossible for particle drawing to affect cloth collisions or vice-versa.

Your profiler data confirms this: during framerate drops, the only increment in processing time happens in the rendering department. Physics (Obi in particular) always takes roughly the same amount of time. This is apparent if you take a look at Rendering (green) vs Scripts (blue) categories in the profiling graph: Scripts always take roughly the same amount of time, while Rendering considerably increases during framerate drops and causes fps to dip around 40-45 fps.
Taking samples of 2 specific frames to compare timings:

No framerate drop:
[Image: J7X0cbK.png]
Obi: 2.23 ms
Rendering: 3.29 ms

During framerate drop:
[Image: Er5PZoM.png]
Obi: 2.13 ms
Rendering: 18.07 ms(!)

As you can see Obi takes exactly the same amount of time in both samples, around 2ms. The only difference is that rendering is x6 costlier during framerate drops. 

So the problem is clearly not Obi, but something that happens during rendering.

Thanks for taking the time to analyze my profile data. In profile it seems that rendering is taking extra time but thats what confusing for me why a physics action is triggering extra rendering? I'm attaching a gameplay video here.

https://drive.google.com/file/d/1GHb1tZT...sp=sharing

You can see fire particles infront of you as soon i move the obi cloth blanket forward and it touches the fryer (not fire particles collision, but the box collider with obi collider that is covering the fryer which is emitting fire) the framerate drops.

Fire seems to be working fine, you can see Frame rate locked at 71-72 when I hold Obi Cloth and view the same fire, but as i move the Obi cloth forward and it collides with Box collider the frame rate drops. Its only happening on collision. When I pull back the Obi cloth from collider the framerate is restored.

I debugged and enabled disabled everything since last 2 days in project, it only happens when Obi cloth makes a collision contact. Is it possible that Obi collision is causing cloth rendering to increase? that could be a reason for extended rendering? Did you checked the physics part of the profiler? The framerate drop and physics curves are proportional

[Image: Screenshot-2024-10-16-at-5-17-25-PM.png]

High res image at https://yourimageshare.com/ib/OJVYkkwGtO
Reply


Messages In This Thread
How to optimize collisions? - by vrtraining - 15-10-2024, 06:05 PM
RE: How to optimize collisions? - by josemendez - 16-10-2024, 08:11 AM
RE: How to optimize collisions? - by vrtraining - 16-10-2024, 08:38 AM
RE: How to optimize collisions? - by josemendez - 16-10-2024, 08:49 AM
RE: How to optimize collisions? - by vrtraining - 16-10-2024, 11:06 AM
RE: How to optimize collisions? - by josemendez - 16-10-2024, 11:51 AM
RE: How to optimize collisions? - by vrtraining - 16-10-2024, 01:26 PM
RE: How to optimize collisions? - by josemendez - 16-10-2024, 02:00 PM
RE: How to optimize collisions? - by vrtraining - 16-10-2024, 02:13 PM
RE: How to optimize collisions? - by josemendez - 16-10-2024, 02:43 PM
RE: How to optimize collisions? - by vrtraining - 16-10-2024, 04:09 PM
RE: How to optimize collisions? - by vrtraining - 16-10-2024, 08:51 AM
RE: How to optimize collisions? - by josemendez - 16-10-2024, 08:54 AM