Issue with World Space UI and Render Sorting

Hi All!

I’m working on the UI for my Argon Assault project and am running into some trouble with render sorting. I’ve done a bit of research to find out how to best render my World Space UI, but have a couple of challenges that I’m hoping you can help with!!
Current code in Github:

  1. I have a couple of Particle Effects (not part of the canvas, just child objects to my UI content) that Play when the UI is updated. These particle systems are fully visible when the player is far enough away from objects, but become obstructed when they intersect with other game objects. I know this is a normal part of 3D object intersection. What I want to do is make my Particle Systems render over everything. Have any tips?? (Example images below)

  2. I have created three world space UI canvases for my VR UI display. The Center canvas includes two Text Mesh Pro text objects and one standard UI Slider. I have set the canvas Sorting Layer to “Front” (I created which has hire render priority than “default”). The Text Mesh Pro text renders over everything as expected, but the slider still is rendered with the reset of the game objects in the scene, allowing it to go behind the water layer (example image below).

Any help is greatly appreciated!!

(Example: No overlap)

(Example: Overlap)

(Unity Canvas Settings)

Hi Matt,

You could try to increase the “Order In Layer” value in the Renderer module of your Particle System.

Are the UI elements part of your scene? I mean, do they have to appear in front of certain game objects? If not, you could move the canvas to a new scene with a new camera and load the scene with LoadSceneMode.Additive. This is a suggestion, something you need to test. I don’t know if this will solve your issue.

Also work with Layers, and don’t forget to add assign an event camera to the Canvas.

Good luck. :slight_smile:

1 Like

You ever get this sorted out? I’m having a similar problem, just curious to see if you solved it.


Thank you for the recommendations Nina. I checked my particle system Renderer module and have already tried creating a new sorting layer with later rendering and increase the values, but the water still renders over my particle systems.

I also checked to make sure the event camera was set on my Canvas.

I’m wondering if this is:
a) an issue with the way the generic water shader is configured (which I can’t change sorting layer settings on the current shader)
b) Something to do with the fact that my camera is part of the Oculus Integration OVRCameraRig. I don’t know if that causes rendering order issues (because of the separate cameras for each eye.)

I will keep this in the back of my mind as I continue with other projects. Strange thing is that the TMP text renders over the water, even though it also cases a reflection on the water surface, but the Slider game object that is on the same Canvas dips down below the water as do the particle systems. I don’t think I’ll be able to fix these things in this project, but have learned a lot by troubleshooting. :slight_smile: Thanks for your suggestions!

Hi @CustomZ02, I tried what Nina suggested, but didn’t find a fix. (See my reply to Nina for details). I’m not sure if this is due to me using the Oculus Integration for the camera…

What exactly is your goal? To not have the UI elements cropped? If so, that could become complicated with the “World Space” mode because the UI meshes act like normal game objects. If they intersect the mesh of the water, a part gets cropped because that’s how the shaders are supposed to work.

Maybe it helps to set the Layer of the UI-elements to UI and to assign a camera to the Event Camera field. If it does not, you could create a new material, assign it to your elements and test another premade shader from the drop down menu. And if you cannot find any, you will probably have to learn HLSL/Cg to write your own shader. Alternatively, you will use a different Render Mode in the Camera component.

This topic was automatically closed after 14 days. New replies are no longer allowed.

Privacy & Terms