Shapes rendering for each camera regardless of camera position

Avatar
  • updated

I use the Shapes library for building my UI components. I noticed that in the frame debugger, both of my cameras were showing duplicates of the same components being rendered. These components are located far away from where the cameras are positioned so they should not be rendered. If I disable the components in the editor, I see they are removed from the frame debugger window. I also noticed that the frame rate went up as well. So it seems like they are being rendered all the time regardless of whether they are visible to the camera or not. Can you confirm if this is how Shapes is supposed to work or whether I may have something configured incorrectly?


I tested using a Sprite Renderer and it does not exhibit the issue. Also, I was able to reproduce this behavior in an empty test project.

Image 845

Thanks,

Steve

Reporting a bug? please specify Unity version:
Unity 2022.3.30f1
Reporting a bug? please specify Shapes version:
Shapes 4.3.1
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
steve debusschere
Quote from Freya Holmér

this is by design yeah, due to an unfortunate limitation of unity at the time I wrote those systems

I've planned to fix this with the next update, specifically, Shapes have a hidden MeshRenderer, but if you access it through code you can set their local bounds (which is a relatively new unity feature) https://docs.unity3d.com/ScriptReference/Renderer-localBounds.html, which lets you set the bounding box used for culling

Okay, thanks. I look forward to the update.

Avatar
Freya Holmér creator

this is by design yeah, due to an unfortunate limitation of unity at the time I wrote those systems

I've planned to fix this with the next update, specifically, Shapes have a hidden MeshRenderer, but if you access it through code you can set their local bounds (which is a relatively new unity feature) https://docs.unity3d.com/ScriptReference/Renderer-localBounds.html, which lets you set the bounding box used for culling