How would you apply the behind factor property to the Outline in the Selection effect. #48
Answered
by
alelievr
PhillipGenant
asked this question in
Q&A
-
I've been trying to figure out how to apply the behind factor properties effect to the Outline as well as the inner color and I wanted to see if anyone had any insight on how to do that. |
Beta Was this translation helpful? Give feedback.
Answered by
alelievr
Sep 7, 2024
Replies: 1 comment 3 replies
-
I think you can just multiply the behind factor by the outline value before outputting it to the color buffer: https://github.com/alelievr/HDRP-Custom-Passes/blob/master/Assets/CustomPasses/Selection/Shaders/02_Selection_Fullscreen.shader#LL121 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Indeed it's not enough to add that because the alpha factor is 0 when the pixel is not directly above the outlined objects, so to fix that you need to do the same as for the outline color: sample the depth buffer multiple times to find the max depth of the custom object and use that to check if the outline is behind something. I've modified the original selection fullscreen shader to achieve something similar: