GPU Instancing breaking

Avatar
  • updated
  • Fixed

GPU instancing breaks because lightprobes, reflection probes, and cast shadows are enabled on the hidden mesh renderers. 


Unity is finicky about what is considered instanced and if the mesh render component has those options enable it will consider them. Even though there aren't any lit shaders in this version, Unity is still considering them as if they were lit and breaking things to compensate. For instance, if you have a bunch of shapes between different reflection probes, it will break it up rendering between the different probes which could slow things down quite a bit depending on the use case. You can see how things are affected through the frame debugger. Good job on setting things up through the material property block btw.

Unfortunately having different contributing lights will also break instancing.  There's no option per component, but you get around the issue by setting the layer to something like UI and then turning off the UI layer in the culling mask on all the lights. It's super messy, but it works. Because this will more require the user to set up, maybe explain this in the Performance section of the documentation.


I recommend disabling the unused options when creating the hidden mesh renderer. 

Reporting a bug? please specify Unity version:
All
Reporting a bug? please specify Shapes version:
2.3.0
Reporting a bug? please specify Render Pipeline:
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Fixed

this has now been fixed for the update after 2.3.0 - when you create a shape it will now automatically disable probes and shadows for its renderer

Avatar
Freya Holmér creator
  • Planned

good catch! will look at this for the next update

Avatar
Freya Holmér creator
  • Answer
  • Fixed

this has now been fixed for the update after 2.3.0 - when you create a shape it will now automatically disable probes and shadows for its renderer