Hi, it seems there’s no support for UIElements using runtime UI & panel renderer to be layer masked because they aren’t in camera / world space but overlayed on the camera.
I have a setup right now where I have UI elements on Display 1 and game elements on Display 2. PanelRenderer overlays the UI on both displays. Is there any way for me to make it so it does not show on Display 2?
Thanks!
I also wouldn’t mind rendering to a RenderTexture but I can’t get that to work either …
A PanelRenderer in overlay mode isn’t associated with any camera, it will be rendered after every camera is done rendering.
Assigning a RenderTexture to the “Target Texture” of the PanelRenderer should work though. Can you share which version of Unity and the package you are using?
Hey, I’m using
Unity 2019.3.2f1
“com.unity.ui.runtime” : “0.0.4-preview”,
“com.unity.ui.builder”: “0.11.1-preview”,
“com.unity.modules.uielements”: “1.0.0”,
When I add the RenderTexture to the PanelRenderer.TargetTexture, it doesn’t write.
I also receive this warning:
PanelRenderer needs an IWorldTransform implementation for world-space rendering
But that appears unrelated?
This is odd, it seems that the PanelRenderer is configured in “world space” mode, which isn’t an exposed feature as far as I can tell.
Can you try to recreate the PanelRenderer component from scratch? It should be in overlay mode by default.
I only receive the world space error when I put the render texture on.
Not sure what you mean by create from scratch. I’ve tried deleting and readding the component to my GameObject and still get the error.
I also tried using the PanelRenderer from the demo git repo (GitHub - Unity-Technologies/UIElementsUniteCPH2019RuntimeDemo: This is the project used in the Unite Copenhagen 2019 presentation: Building UI for games with the new UI Builder) and from the upm runtime preview repo. Both give the same error.
I cannot reproduce here. I’m attaching a simple project to this post. This is a simple PanelRenderer with a UXML file (authored with the UI Builder) and a RenderTexture as a render target. If you can:
- Validate that it works on your side and
- Compare with what you have to see if there’s any difference
That could help us figure out what is going on. Thanks!
5861365–623155–PanelRenderer2Texture.zip (28.2 KB)