MESH LOD - Please add a shadows-only level for great performance gains

Hello,
A classic LOD structure might look like this:

50000 LOD0
10000 LOD1
3000 LOD2

as example.
However, if LOD0 with 50000 is being rendered, you can still have a massive performance increase by using a copy of the last/some LOD to render the shadows. This is easy to setup and a very low hanging fruit.

So a much better structure is

50000 LOD0 - Shadows Off
10000 LOD1 - Shadows Off
3000 LOD2 - Shadows Off
3000 LOD2 Copy - Shadows Only

If you could enable a setting to create this, it could potentially greatly increase performance for many users for extremely low dev effort, as you almost halve the rendering cost of your given LOD0 mesh.

Example: 25000 vertex shadows vs 1500 vertex shadows


Benefits
Shadow rendering consistently sits at the top of the Profiler in terms of GPU performance required.
This could heavily lessen the load on the shadow pass, at the cost of one additional transform.
Many meshes could see their shadow casting vertex count reduced by 50-90% in majority of cases.

Considerations:
Self shadowing can be affected if there is a too large LOD discrepancy on certain models, as example on convex holes getting filled.

Solution:

  1. The user can select a higher LOD for shadows
  2. The user can slightly scale the shadow LOD smaller (0.95x) so the intersection becomes invisible
  3. The user can opt-out of the feature on edge-case models and still have “default” performance
    Conclusion: This is not a issue that warrants avoiding the feature

Please consider this low hanging fruit, this simple optimization might have more positive impact on an optimized project than a high ticket feature like GPU resident drawer or something like that.
This is a tried and tested optimization which has been done for many years in many games. The Unity team also has already vetted this by adding a “shadows only” mode to models for exactly this reason.


(On another note, it would be nice if you could optionally sort of “link materials” as people constantly by mistake change a material on one LOD and then forget about the others. This can also happen on transforms quite frequently, at least from my experience.)

9 Likes

I think this is a good idea but wouldn’t self-shadowing get messed up if the mesh casting it is a different LOD from what is displayed?

1 Like

Hey, no, unless you have a large descrepancy. (as example a convex hole getting filled in somehow)
I would suggest being able to select a LOD level to use for the shadow LOD, default the last one.

You can get surprisingly far with shadow LODs without any errors, it is very forgiving as you just have to get a sort of rough outline right. In most cases where you do have a minor self shadowing issue you can also just scale the shadow object a little bit smaller to fix it.

In edge cases you could also just avoid the feature of course.
This is definitely very worth it as the shadows sit generally at the very top of the profiler.

Wanted to show a video but the new forum dosnt support MP4 anymore, that is not optimal

1 Like

Right and while they are fixing LOD’s maybe fix the interface for it aswel

It’s worth noting MeshLOD is apparently an entirely different system that’s used when an asset is imported.

The old method will still exist tho.

It would be nice if MeshLod had the option to have a separate shadow caster mesh tho.

I strongly assume mesh lod will just create the LODs and then use the old component to toggle them.

Hope not, really, because assigning materials by drag & drop is a nightmare with old way via LOD Group component :frowning: - material assignment is not propagating on all LODs, only on one currently used. I’ve run into this issue with my Uniblocks - hundreds of mesh pieces with LODs and adding/changing materials on them is pain for hours, drag&drop in viewport simply unusable with old LOD Group component…