So they all had different kind of issues, basically they work well in isolation but donât exactly work well with other objects in the scene. That is why I am wondering if there is a go-to solution.
I was thinking around the lines of rending objects to a viewport and doing the outline in 2D, too. Especially, since I already have a nice 2D outline shader from our previous game.
I checked it a bit, trying to understand.
What Iâm trying to do is highlighting only âselected objectsâ not all objects in the scene. So, I thought playing with VisualInstance layers and camera culling mask layers to match these only for the âselected objectsâ would make it work. But I couldnât figure it out.
Do you have a way of doing this?
In my example scene highlighted objects are those with the VisualInstance3D Layer 11. You can change this as you wish by changing the CullMask Layer in the âHighlightCamera3Dâ node and the VisualInstance3D Layer in the âHighlightEffectDepthâ node.
Does this help? If not you have to be more specific what exactly works and what not.
In my scene, I see that all of the boxes are highlighted, regardless of their layers.
I guess your reply also answers my âwould be next questionâ: Why is there a Box and Box2 and BoxHighlighted nodes in different layers and everything is still highlighted?
So the question now is why my scene highlights all of the boxes and does not take into account the VisualInstance3D layer of the objects
Extra Note: When I add your scene to my game project that I have been working on, I see everything is highlighted. But when I add your scene to a completely new/blank project, I donât see any highlight at all, only the white shapes. So it may be related to project settings somehow.
It doesnât work properly in Mobile rendering, causing weird issues depending on the settings like anti-aliasing . But it works as expected in Forward+ rendering.