Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How to optimize collisions?
#8
(16-10-2024, 11:06 AM)vrtraining Wrote: As soon as physics is invoked from Obi side the rendering is also spiked up.

Obi physics is invoked every frame. Collisions are just part of physics, and are also solved every frame (in case there's any).

(16-10-2024, 11:06 AM)vrtraining Wrote: Its due to overdraw from particles but there are very few particles

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.

(16-10-2024, 11:06 AM)vrtraining Wrote: and overdraw works fine if collision is not invoked.

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.
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