I know the ‘main pass’ in UE4 contains z prepass, base pass, and transparency. What does the z prepass do?
I want to render several meshes in z prepass but not in base pass, i.e. they are in depth buffer for occlusion but not drawed in fact. Other meshes in base pass will access the same depth buffer. Is it possible?
(I’ve tried Custom Depth but it is accessable only for translucent material, which may be not what I need.)
Z pre-pass quickly and cheaply renders depth of this scene. This information is used during base pass to decide which fragments are actually visible, and skip calculation of hidden ones.
You can’t render it per-object. You have presets to choose from in project’s rendering settings. Commonly, you want to set it to masked objects only.