Use a fume prt as a matte object?

Hi there, I’ve got a current job where I’ve been asked to add some krakatoa particles to some fume sims I’ve already completed and rendered. So the plan is to birth the particles and follow the fume sim, but I’d like the krakatoa particles look like they’re integrating into the fume renders. So it would be great to render the particles using the existing fume caches to obscure any particles that would be inside the fume clouds - is it possible to use the fume caches as matte objects?

If you can render a Z-depth pass of the FumeFX sim using another renderer (Scanline, VRay etc.), you could load the resulting depth map sequences as “Initial Depth Maps” using Krakatoa 2.1.5. In previous 2.x builds, the Initial Depth Maps feature was broken and we just fixed it this week. Not sure if this would be enough, you might have to perform more complex compositing tricks to get the desired results…

ok sounds like a plan, thanks Bobo. I’ll look into that, didn’t know that could be done. I’ll also check which version I’m running to make sure that’s going to work.

Some more info on this:
In the early days of Krakatoa, we were rendering a sequence for “Journey 3D” where particles had to be composited with a fluid simulation. At that point we were using Gelato as our renderer, and like all Renderman-inspired renderers, it was very good at rendertime displacement. So the only way to occlude particles by the water surface was to render a Z-depth of the rendertime-displaced geometry and use that data to tell whether a particle is in front or behind the geometry. Note that these “Initial Depth Maps” are simply pre-loaded into the Z-depth buffer used by regular Matte Objects in Krakatoa. So the buffer is initialized with the values from the file, then the matte objects are rendered into it and this gives you a combined depth map that contains both the file depths and the results of our own depth map rasterizer.
In previous versions of Krakatoa, the depth map resolution had to match exactly the size of the internal Krakatoa depth map. This size is also dependent on the Subsampling value. For example, if the render resolution was 800x600 and Subsampling was 2, the actual depth map would be set to 1600x1200, and your saved depth maps to be used as Initial Depth Map had to be of that size, or a multiple of it. In build v2.1.5, we have removed this limitiation and you should be able to use an initial depth map of any size to initialize the buffer, which means you should be able to change the Subsampling after you have rendered your z-depth files.
As already mentioned, the Initial Depth Maps feature was broken in Krakatoa 2.0 and was fixed last week. So any version between 1.6.2 and 2.1.5 will NOT work correctly (there was a collision with the light sources’ depth maps and some other bugs).

Once you have the z-depth maps rendered and loaded in Krakatoa, be sure to enable the option to >Save Multiple Layers. This will add a Render Element which will save the particles found to be behind the z-depth value to a separate file, while the beauty output of 3ds Max will contain the un-occluded particles. This will give you two images you can “sandwich” your FumeFX rendering into. If the alpha at the edge of the FumeFX rendering is < 1.0, it will reveal some of the background layer with occluded particles and thus produce correct anti-aliasing. Plus you can tweak the opacity of your FumeFX to reveal more or less of the occluded particles…

Note that the “Load Initial Depth Map File Sequence” options of Krakatoa let you select between 3 types of z-depth maps - Camera Space Z-Depth expects the actual distance in world units to be in the pixel (this is how Gelato and Renderman work); Normalized Z Depth is a grayscale map where black shows the closest values and white the farthest, normalizing them between a Z Near and Z Far distance which should match the original rendering’s settings; Inverted Normalized Z Depth is what Max produces by default, grayscale with white being closest and black being farthest. Make sure you write down the Z Near and Z Far values when rendering your depth maps to be able to enter them in Krakatoa if you are using the latter two, for example from VRay or Scanline renderer… The sequence itself is picked like everywhere else in Krakatoa - select any frame-numbered file from the sequence and the whole sequence will be loaded according to the current time, replacing the frame number automatically.

Please let me know if anything is unclear.