There could be a solution somewhere but I’m too unfamiliar with shader stuffs, so I think it I’d rather post a new thread to ask.
I want that when an object is selected, there’s an outline around it. I found a pretty good example here: GitHub - alelievr/HDRP-Custom-Passes: A bunch of custom passes made for HDRP
The only problem is, since we use physics and layer to determine which objects could be selected already, I can’t rely on layer to determin which object to show outline.
I tried to play with the rendering layer mask of the mesh renderer but I couldn’t make it.
What I tried is to modifiy 02_Selection_Objects.shader:
- Add “_renderingLayer(“RenderingLayer”, int) = 0” in Properties
- Add “uint _renderingLayer;” in SubSahder Pass
- In void GetSurfaceAndBuiltinData add:
if (builtinData.renderingLayers != _renderingLayer){
builtinData.opacity = 0;
}
But it’s not working as I expected, no matter what the rendering layer mask of the mesh renderer is, I’ll have to set _renderingLayer to 0 to make it have an outline.
I do have a work around, though, that is to stick with the original way the custom pass is, and whenever I need the object to have outline,I copy it, gives it an alpha clipping material, and set it to the custom pass targeted filter. But I think it’s a rather important feature so I’ll be glad to know the proper way to handle this situation.