for people looking for the depth in the render layer node in newer versions of blender (4.0.2 currently), you need to enable it in the "view Layer" tab on the right side of the interface, it should be under Passes > data > Z make sure "Z" is checked to see Depth in the render layers node.
Pretty neat :D I've just used the vector math - normalize node which will map the z values to 0-1 range (works wonders :D) but having proper control for the min and max values is probably pretty essential in most cases. By the way, why was the world much grayer than the end of those road planes? The ends of the roads were pure white. Isn't the world much further away?
I appreciate the video. My criticism is purely for Blender devs. Exporting a depth pass is a fairly common situation. This feels very janky. I wish they would make the process more streamlined.
If you include volume scatter it will register that along with the depth so, mist may not be best when you have that and want to do depth of field in composite.
Nice, i got the script working now. everything is now setup in a split second. Now i need to think about where to add it and what to do with multi-camera setup. I noticed its again a hustle to change those empties in the map range. There is only 1 composite output right? We can make a composite setup per camera, im quite new to blender compositor, ive always used external render engine for blender
Okay made a little panel so i can now also update the drivers more easily. Currently you need to select two other empties when you have multiple cameras. I thing ill make this automated so when you select a camera you only need to press refresh and it selects the correct empties automatically.
@@MaxPuliero PS i got everything working, also added a mist option since that gives a much smoother antialiased pass. Im using the same empties and driver setup. Everything works and also updates. Now i need to make it an addon but that just a couple more lines of code
Hallo Max, thank you so much for this tutorial. I have a scene with some smoke in the foreground, and I would like to render the Z-Pass to add DOF in after effects to my animation in post processing. I usually simply use the mist pass for this purpose, but I realised that it renders the smoke with bright values, no matter how far it is from the camera. I hoped that this method calculated the distance of the smoke properly but it has the same issue of the mist pass. Do you have an idea of how this could be fixed? Have you found yourself having to deal with this problem? Grazie mille.
@@andreaavellino7462 you could probably render the mist pass with the fog completely disabled from the scene (so the smoke is a completely seperate layer and pass and is just composited back in in AE). but really depends on how your scene works and all that... also you probably already thought about that. good luck anyway :D
Hello, please tell me why I see a black screen instead of a white one when I take the antenna out of depth. Because of this, normalize does not help and nothing changes.
Ive been doing blender for over 2 years now, ive went from a newbie to someone who does this full time now and to this day i still have to comeback to this video every 2 weeks because i always forget how to do it. Bless you and this video🫡
IM used to a render engine which had this option min and max by default. No need to fiddle around and do lots of side work. Really baffled how this is so tedious in blender
@@MaxPuliero I have a Volume domain in my scene for a cloud that doesn't seem to pick up the correct depth in the depth map. It's coloured as though it's behind a mountain object, when it's actually closer to the camera than the mountain. Maybe this method doesn't work with volumes?
Brilliant, I used to program so this sort of thing is so simple to do yet so few packages have this functionality, ultra useful, thanks. Love your accent - Go watch Davie504 and redo all you tutorials in that style, with a hint of Godfather!
@@MaxPuliero after typing i dont thing so. Iits calculated per object, only its better implemented. Its kinda funny how often i see this question about this white channel. Really hope i can nail this addon idea i got. I was thinking of making it work so you can setup any camera with a one click solution.
@@MaxPuliero bella. lo ho capito dall'accento e dal cognome. bei modelli comunque. bellissimo soprattutto quel video del 2012 dove facevi una sorta di astronave, che per quanto low poly era davvero carina con tutte le texture
No the range will change dynamically during the animation based on the distance between the nearest and farther objects. So, for example, if the farther object briefly disappears behind a closer object, during that frame range the Zpass will be normalized in a different way, making it unpredictable and useless.
@@MaxPuliero Interesting point. I just did some testing and couldn't recreate your statement. I placed a bunch of cubes in space on the first frame, then moved the closest and furthest to different locations on the second frame. I even placed the furthest cube behind one of the others, as you said. This didn't affect the Z values of the rest of the items placed in the scene at all. I wanna make sure the information I spread is correct. Did I overlook something?