Home > Mobile >  How to add post processing to UI (UI toolkit, NOT CANVAS) in Unity?
How to add post processing to UI (UI toolkit, NOT CANVAS) in Unity?

Time:01-31

I'm working on a Unity game and I want to add chromatic aberration to the interface but have no idea how to do it and can't find anything similar on the Unity docs site.

I don't use Canvas, I use UIDocument.

My project uses Universal RP but I will accept answer for any other render pipeline as long as it explains how to add post processing to the UI visual elements (uxml)

I have tried using several cameras. It's stupid, but it's the only thing I could try.

CodePudding user response:

UIToolkit uses a screen space overlay, ie. renders after the cameras, although they are considering adding world-space support.

It also doesn't support custom materials or ShaderGraph, although, again, they are considering adding support.

You can see the rendering feature support on this page.

This means your only option is to render the UIDocument to a texture, and use that texture on a UGUI object or a world space quad. Then you should be able to apply post-processing. You can specify a render texture in the PanelSettings object.

  • Related