post-kerbin-mining-corporation / Waterfall

Mesh-driven engine effect framework for Kerbal Space Program
57 stars 19 forks source link

SetupRenderersForCamera can be slow #144

Open JonnyOThan opened 2 days ago

JonnyOThan commented 2 days ago

It looks like this is doing some kind of custom renderqueue sorting. With the other optimizations going on, this is now taking 10-12% of the LateUpdate time.

I haven't dug in yet so I don't have any great ideas about what to do, but maybe:

JonnyOThan commented 2 days ago

Some stats: Using SWE, a single poodle has 57 renderers.

When it's not active, 3 go through the distort path and 21 through the bounds path - so only 24 of the renderers are active.

When it's active, there are still 3 in distort and 36 in bounds. Only 39 renderers are active??

Here's one of the disabled renderers - is this for a different variant maybe?

liquidEngine2-2.v2/model/StockWaterfallEffects/Engine Configurations/poodle_plumes(Clone)/DoubleBell/Gimbal/doublePlume/Waterfall_FX_exitTracesLong_1/Waterfall/FX/fx-cylinder(Clone)/Cylinder

I think not - I was using the double plume variant, but not quite sure what's going on here.