Render occluded actor in Custom Depth

I need to render my character into custom depth regardless of occlusion culling. Right now the character disappears a few seconds after it moves behind a wall.

I have found no way of doing this in the editor or properties.

This should work and I think I’ve seen code for the static mesh:

            if(ViewRelevance.bDrawRelevance && !StaticMesh.bShadowOnly && (ViewRelevance.bRenderInMainPass || ViewRelevance.bRenderCustomDepth))

it might be missing for non static meshes. Please try with a static mesh - if that works for you we know more and can fix the right thing.

			{

This does not work for Static Mesh either. They dissapear quickly after moving the camera behind another mesh.

I created TTP 338104 to investigate this. It should work or there is another flag to enable this behavior.

This is occurring for me as well. I’ve been unable to find a good fix or workaround for it.

Has this been investigated? I’m also trying to render objects in custom depth even if they are occluded.

This will be fixed in 4.8. Simply add this to CanBeOccluded. Same needs to be done for other mesh types, for instance skeletal meshes.

bool FStaticMeshSceneProxy::CanBeOccluded() const
{
	return !MaterialRelevance.bDisableDepthTest && !ShouldRenderCustomDepth();
}