branchrust_reboot/main/hackweek_renderlod_collapsecancel
34 Commits over 0 Days - ∞cph!
Remove the Scene2Prefab components on the bbq, small refinery, furnace, large furnace and campfire prefabs in the LootPanels scene
Changes made to these prefabs outside of this scene would be lost if we do a global S2P, sometimes leading to build breaking bugs
Set local scale to 1,1,1 on various wooden_crate props - used in lots of places and both child renderers were set to 0.99999994 scale on one axis, preventing collapsing.
Will need a global S2P to take effect everywhere
Fixed missing launch site HLOD generation
Fix some missing deploy guides
Fixed train tunnels not rendering properly on the map
Industrial crafter now correctly gets collapsed
Collapse process will now update an EmissionToggle on the same object as the RendererLOD to reference the newly created renderer (fixes electric furnace)
Don't collapse a RendererLOD if any renderer has children
Fix some method names
Fix collapsed renderers briefly not having an assigned mesh immediately after PreProcess, fixes item skin previews not cropping properly
Fix coaling tower NRE (disable collapsing on light renderers for now)
Fixed skinned items missing materials when entering and exiting LOD range
Don't allow skinned mesh renderers to be collapsed
Fixed skinned beach chairs
Fixed reversed search light
Fixed powered water purifier
Added DontCollapseRenderer gameobejct tag for a quick way to opt out of the collapse process
Applied to industrial crafter
Fixed scale not being applied (this should also be fixed, disabling for now)
Don't apply collapsing to renderers with rotated LOD transforms (we couple probably support this but disabling it easier for now)
Fixed RendererLOD collapsing disabled components (these technically don't work for lods at all and will never change their visual based on distance, so we should fix them)
Enabled RendererLOD component on the vending machine
Cleanup
Added graphics.collapseRendererLOD to control new behaviour, defaults to true and game must be restarted after toggling for new setting to take effect
Support MaterialSetup component
Fixed collapse not working with skinned objects, not casting shadows
Various fixes, move to PrefabPreProcess so it gets run once per prefab
More memory optimisations - attempting to reduce the number of transforms/gameobjects/renderer components there are in the world by consolidating them into a single RendererLOD when possible
eg. a RendererLOD has three child LODs all at 0,0,0 - this process caches the mesh and materials used at each LOD level and creates a new renderer/filter on the RendererLOD root and switches the mesh and materials when adjusting LODs. This allows us to delete the child transforms entirely.
Process is entirely automatic and applied at runtime to all RendererLODs so no change to artist workflow.
Some initial results:
Launch site goes from 30,409 transforms to 21,131
Outpost goes from 11,850 -> 9,633
Harbor_1 goes from 17,233 -> 13,125
That's a total saving of over 15k transforms, renderers, filters just from three monuments!