Hi All, I am trying to render a series of mesh cubes with all of their materials (base color, metallic, roughness, specular) in front of a solid plane. The cubes exist behind the plane in 3d space but I want the cubes to always render on top of the plane. The plane will also have a base color texture, metallic, specular, etc. I am pretty new to creating these types of shaders so any examples or help would be greatly appreciated. I’ve attached my sample file. Please feel free to use it as an example. Thank You!
Scroll down until you find the topic CustomDepth Stencil to learn how you can do this. You can alternatively look at my Highlight Shader available on my website: Elias Wick | Highlight
Thank you for the information, and great shader! I’ve seen a bunch of shaders using the post process and stencils. However, all of the examples that I’ve seen function as a “highlighting” element with a solid color (similar to your shader). Instead of a solid color, I’m looking to display the original material that is applied to the mesh. Do you believe that this is possible to do?
Yes absolutely! You can simply create a mask that does that for you. Simply subtract the depth of the stencil with the depth pass and it should show the texture / original mesh in front of everything.
Hi, you explain exactly what i want to do but i dont understand the required step of the “solution”, did you achieve it and would be able to explain me what nodes in the material i have to make ?
This is simply not true. With Custom Depth on, the only thing that gets rendered to a separate buffer is the depth and/or stencil ID, but the scene color buffer will still contain the pixels from whatever object is occluding the mesh.