Creating a depth pass for a smoke simulation should be a simple task you might think. In most cases with professional softwares it can be, but not all softwares support this feature. In this particular case it is the Fire and Smoke simulation plugin TurbulenceFD(TFD). I am a huge fan of this plugin and have been able to get some really great results from it. You can see some of those experiments over on my Vimeo channel. Recently I was creating some stock footage of smoke plumes for in-house use and had the need for a depth pass as well. Remembering back to a two year old post on the Jawset forums asking about TFD depth passes and being told it wasn’t available, I set out to find a work around. The science behind why a native depth pass cannot be created makes sense to me, but it would be nice to as least get something for the base fluid object as if it was a solid form. Essentially the limitation is on C4D’s end I believe (no facts to back that up), because it cannot export Deep Pass files. There is a nice visual explanation of Deep Opacity maps here. So I needed to find another way to cheat it. I started messing around with placing my smoke in fog volumes, messed with custom proximity shaders, and then one day simply tried an area light. I know, it sounds so obvious now in hindsight. This is what happens when you work on multiple things simultaneously for long periods of time, your mind goes down rabbit holes and gets stuck on a path sometimes. So after fiddling about with the area light, I was starting to get some results. Shortly there after I was starting on a Python script to help make it a one click application.
This video shows how it works and some of the quirks with it. The script is also open, so you can not only view, but also modify as well. Included is also a icon file, for those who like to dock the script in your UI.
Download the ZIP file here:
I noticed while using this script in R16 that it refused to work, but after altering an if statement’s formatting it seemed to work again. Not sure the reason or cause of that issue, but if you have trouble running the v2 script, then try the v3. I named them as R14 and R16 only because I have tested them in those versions, but they might work in newer or older versions of Cinema 4D possibly.