you need to check if the scene depth is closer (aka smaller) than the custom depth, minus some threshold to avoid self hitting the chair that has it.
you can just use an IF node. scene color + scalar (for bias)goes into A and custom depth goes into B. Then for the >= I think you return 1 and for the < you return 0. And of course don’t forget to play with the bias. try adding like 0.1 or so at first.
hmm did you try outputting just the result of that IF mask? That looks about right but there are some different versions of SceneDepth that are unclear. What if you try to use the one that is simply “Scene Depth” withhout the “SceneTextue:” prefix.
Did you try playing with the addition threshold like I suggested? Even if you hooked it up backwards it should still work (just inverted white/black) if you indeed tried making it go negative. did you make it a scalar and try various values like I mentioned?
edit actually I just set up my example exactly like you had it set up and its working fine here.
try it in a new material. make sure its a post process type and applied as a blendable if not. Also probably a silly suggestion since you already had the lines working but also make sure custom depth rendering is enabled in project settings.
Ah, my bad. You’re right. I was looking at your setup backwards. Now that I check again I was putting the 0 and 1 in the wrong spots and it came out solid black like numsi said. From his screenshot, looks like that’s what he did too.
Great thread, helped me a lot with my outlines. Now, what if both chairs had their CustomDepth enabled? With the solution above, the outlines of the chairs are merged together. Is it possible to ‘close’ the outlines on the front chair like in the picture below?