Neos-Metaverse / NeosPublic

A public issue/wiki only repository for the NeosVR project
193 stars 9 forks source link

particle collisions have greater impact than before bepu2 #2889

Open asakleiman opened 3 years ago

asakleiman commented 3 years ago

Describe the bug?

Particle collisions with mesh have a more than expected impact. My Neos username: @kleinlowe, helped by@basmentnerd @mysticproro

First noticed with Gearbell's bug spray in a minecraft world.

Set up world to test: http://cloudx.azurewebsites.net/open/world/U-kleinlowe/R-11a58018-d5dc-447a-8a4a-4b8a38706dd6

Complex mesh collider and box collider, both have a very heavy impact when interacting with particles, causing ~30% frame rate drop.

Relevant issues

Particles set to bounce are more impactful on performance than before the physics upgrade, sometimes severely so.

To Reproduce

Set up world to test: http://cloudx.azurewebsites.net/open/world/U-kleinlowe/R-11a58018-d5dc-447a-8a4a-4b8a38706dd6

Complex mesh collider and box collider, both have a very heavy impact when interacting with particles.

Expected behavior

Expected ice cream and ponies. Or similar or improved performance compared to bepu1. (edit: I am aware that particle physics are separate from bepu, still, one can hope. )

Log Files

No response

Screenshots

No response

How often does it happen?

Always

Does the bug persist after restarting Neos?

Yes

Neos Version Number

8.27.914

What Platforms does this occur on?

Windows

Link to Reproduction Item/World

http://cloudx.azurewebsites.net/open/world/U-kleinlowe/R-11a58018-d5dc-447a-8a4a-4b8a38706dd6

Did this work before?

Yes

If it worked before, on which build?

No response

Additional context

No response

Reporters

@kleinlowe @mysticporo @basementnerd

shadowpanther commented 3 years ago

It's weird, but I didn't notice any framerate drops when I joined your testing

SnooperXP commented 3 years ago

How complex is the mesh you’re colliding with? Also how dense is it? The more dense and. The more dense and complex a mesh collider, the more triangles it has to calculate for the collision.

I noticed this in resting and Froox did do some optimisation, but I’m unsure of there’s anything more that can be done aside from tuning the mesh you’re using for collision?

Frooxius commented 3 years ago

How exactly are you comparing this? Is it in the exact same setting? Performance can vary very wildly depending on the colliders present in the world and their complexity.

During our testing we tested some really heavy particle collisions in a the same world and it ran noticeably smoother on the BEPUv2 build than BEPUv1, so it might be possible you're only noticing this because you're testing in a world that's much heavier.

We'd need more data on this - complexity of the colliders involved, amount of particles, some rough performance metrics between the two versions.

asakleiman commented 3 years ago

I'm afraid I don't have a copy of pre-update Neos to compare it with, so all I have is the 'seat of the pants' measurement. After posting this I mentioned it to Epsillion and managed to crash everyone in his session with two particle systems; one at 1500 particles and one at 100,000 (if I recall correctly)- and those were just against simple box colliders.

asakleiman commented 3 years ago

Further experimentation by @firr has discovered that the performance hit comes from 3d particles on mesh colliders, even simple ones (in this case box particles against an extremely simple mesh collider). The world linked has been updated with the latest methodology. Flat particles did not seem to produce any frame rate decrease, nor did 3d particles without collision enabled, nor did 3d particles colliding with a box mesh. View of mesh collider used in experiment included. image

Frooxius commented 3 years ago

That's still quite bizarre. Mesh particles use the same collision system as plain billboard ones do - the collisions are actually handled with just raycasts. There are no different codepaths or anything that would make a difference.

Are you sure that it's just not the combination of heavy mesh particles that's being influence here? It sounds like there might be something unaccounted skewing the test results, we might need a cleaner way to reproduce this.