Don't force Renderer Feature in URP

Avatar
  • updated
  • Planned

We updated Shapes recently and have been having performance issues on the Quest. Turns out that it's the new Shapes renderer feature. URP forces an extra blit whenever there's ANY renderer feature added even if it doesn't need it. This is bad for the Quest because the extra blit is super expensive and wont allow foveated rendering. It may also disable MSAA. Unity said they'll make it explicit later, but this is an issue for now.

Previous versions didn't use this and ran fine.

Reporting a bug? please specify Unity version:
2019.4.16
Reporting a bug? please specify Shapes version:
3.2.3
Reporting a bug? please specify Render Pipeline:
URP
Avatar
Freya Holmér
  • Planned

great! I love unity quirks~

so it sounds like I'll have to make it less automatic, or at least have a way to turn it off. might do something like this:

  • If Shapes detects URP, and is missing a render feature, a window will pop up asking you if you want to add it. You'll have two options: Auto (recommended), Manual (Advanced)
    • if auto, Shapes will auto-add it (current behavior)
    • if manual, Shapes will turn off auto-setup, and the window will not appear again and you'll have to manually set it up if you need immediate mode rendering

Avatar
kevin comerford
Quote from Freya Holmér

great! I love unity quirks~

so it sounds like I'll have to make it less automatic, or at least have a way to turn it off. might do something like this:

  • If Shapes detects URP, and is missing a render feature, a window will pop up asking you if you want to add it. You'll have two options: Auto (recommended), Manual (Advanced)
    • if auto, Shapes will auto-add it (current behavior)
    • if manual, Shapes will turn off auto-setup, and the window will not appear again and you'll have to manually set it up if you need immediate mode rendering

Sounds like a good compromise. I added a early out return to the EnsureShapesPassExistsInTheUrpRenderer function and removed the feature from the renderer list. Seems to work for now.

Thanks!

Avatar
Raincoat

Ah this may be what was causing my issue. https://shapes.userecho.com/en/communities/1/topics/229-xr-urp-msaa-not-working-when-shapes-is-in-project

I was just about to post an issue here where performance on Quest and URP is greatly decreased when shapes is imported. (And even without any shapes being drawn)

Currently switching the graphics API to Vulkan from GLES3 seems to be a workaround for the performance decrease. Since switching we've seen no slowdown. However MSAA and Foveated Rendering still doesn't work.

Avatar
bertos barticus

Hello, I have use case where we have a second camera with a different URP renderer. This camera has a specific setup and currently Shapes automatically adds the render feature to each ForwardRendererData it finds which is problematic.

Ideally there'd be some way to control this behaviour as you mentioned. One option you can use is this API

UnityEditor.AssetSettingsProvider

With this you end up with a settings asset that lives in ProjectSettings so you can avoid janky ways to store values. I'd like to think that would provide you with a mechanism to distinguish between Unity importing Shapes for the first time in a project, and perfom user dialogs then and save their choice.

For me I'd imagine a Manual mode which doesn't perform any asset modifications. You could also have an option for automatically adding to only the default renderer rather than all.


TextMeshPro also utilizes this project settings api so you can their code as a guide: