“Unreal 4 introduced a new depth buffer along with their PBR rendering system. It’s called “Custom Depth” and can be used for effects like the selection outline that is built-in the Editor, rendering of occluded meshes or custom culling of transparency. I will discuss some of the basics of using this buffer in the material editor and explain some of the features I used it for in the past.”
Thanks Tom for tutorial. Infos about custom depth are really helpfull. I wonder how the “not good” effect showing another character can be usefull (like showing other characters when first is hidden to show all characters… or when in game you can see a character even when there is a wall )
I’ve tried to replicate the example where you cull the inner triangles with custom depth, but I’m not getting the depth in translucent objects.
I’ve read that you are rendering the mesh twice. What is the process to do this? I think I’ve missed something.
I use Blueprint to do this with two SkeletalMeshComponents (In the construct script I assign the model from the primary mesh to the 2nd component, and overwrite the material with a simple opaque material (otherwise it will not draw into custom depth, I hope this behavior changes in the future!) This really isn’t clean and I hope Epic will fix the custom depth drawing in a couple of areas (I have several others mentioned at the bottom of the post)
Great, thank you for those fantastic resources.
I managed to make it work following your sample.
I’ve encountered another problem.
I had outlined objects through blendables in the post process and I also wanted flat transparent objects like in you example, but now since they both use custom depth the transparent objects get an outline as well.
Is there a way of having some objects with only outline and some objects only flat transparent?