How to write ShaderMaterial to DepthRenderer

Hello everyone!

I am struggling to make postprocessing work with shader materials that displace vertices like in here:

The vertices are displaced but the depth renderer does not see it unfortunately. Is there a way to override the material used to render to the depth map?

cc @Evgeni_Popov

1 Like

Yes, you can use a specific material to render a mesh with the depth renderer:

2 Likes

Thank you that’s what I was looking for :ok_hand: