Hi guys!!
I want to show a text in 3D space always on top. I tried the method for this sample World space UI rendering on top | Learn PlayCanvas but seems that only works for image elements but not with text elements.
The solution in World to UI Screen space | Learn PlayCanvas isn’t valid for me because I need this in XR… and 2D Screen elements not renders in XR enviroment.
Some easy solution? Thanks!!!
Hi @chewuaka ! Please check out the topic below. You will also find another example project there.
Hi,
As the topic suggests, I wanted to render an image element infront of a 3D mesh object all the time. I came across various posts, but nothing seem to be exactly what I wanted. Here is the link to the sample project.
https://playcanvas.com/editor/scene/984703
The sample image and text element has a look at script attached. When we rotate the mesh object, the image and text element should remain at the front and visible all the time to the user.
Any help would be appreciated.
1 Like
Works perfect!!! Thanks!!!
1 Like
An alternative method to this is to use render layers and ‘camera stacking’ where one camera renders the world and another camera renders the UI on top: https://playcanvas.com/project/940278/overview/ui-rendering-on-top-with-layers
This has the drawbacks of needing to keep two cameras in ‘sync’ with properties but the advantage is that you don’t have to mess around with materials.
See also: [SOLVED] Render Object Over Another Objects - #4 by yaustar
And [SOLVED] Layers and affect of the 'Order' - #7 by yaustar
1 Like