It seems that the rendering order of my application is not as expected

Here is an example. I want the text to be rendered on the background, but the text is blocked by the background. But the text is indeed in front of the background. I don’t know how to fix it. who can help me.

https://playcanvas.com/editor/scene/1283366

What’s the name/path of the entity with the text? That background entity are you referring to? Are the entities on the correct render layers?

If you are expecting to position the element in world space, then they all need to be on the World Layer, not the UI layer

its work ,tks!

https://playcanvas.com/editor/scene/1283366

I added a lot of dogs to the 3d scene, each with a different position, but the order seems chaotic. Turn the camera and you will find that the dog at the back will be rendered to the front, as if randomly rendered on a plane superior. Can you tell me what caused this. How to solve it, thank you in advance,

Spine runtime by default renders on the UI layer.

You will need to change the layer to one that it renders above the world and uses manual sorting of meshes.

To change the layer on the Spine object, you can use this property: https://playcanvas.com/editor/code/856398?tabs=62103607&line=8791

Example: https://playcanvas.com/editor/scene/1288302

1 Like

https://playcanvas.com/editor/scene/1285959

Thank you for your answers and help.

This is a demo I modified. When there are a lot of spine, the rendering level still looks messy. If you shake the camera up and down, you will find that the dog behind is rendered to the front. In fact, they are on the same level.

I just want them to have a real sense of space. The front will block the back.

Is there any other way?

You need to change the layer properties from this:
image

To

Hmm Just forked to try it and that didn’t work :thinking:

Will need another look

I’ve changed the spine runtime library so that the material will write to the depth buffer and now have the layer render back to front

https://playcanvas.com/editor/scene/1289071

Line changed:

1 Like

https://playcanvas.com/editor/scene/1285959

Great, thank you!

Thank you for your patience, but I have a new problem. I want to add a label on the spine to show his name. Now it seems that something is wrong. The labels seem to be unable to be fixed on the top, or will be blocked, how to keep them on a flat surface and look like a whole.

Again, the label needs to be on one of the World layers, not the UI. You may need to overwrite the material on the UI to write to the depth buffer too

I tried and it didn’t work

Not 100% sure what the issue is but it does look like you will need to use a custom material for this.

Getting some issues around the sorting of meshes with the UI element:

Not sure if bug or something else

Progress so far if you want to take it further: https://playcanvas.com/editor/scene/1289152

it seems like the bubble needs alpha testing enabled if possible, to not render anything to depth buffer on the outside.

Thanks Martin! Easy fix:

1 Like

Improved it more by using alpha test on the spine material too: