Shadows?

Hello,
I have a question about getting shadows from Krakatoa. I don’t know how to get anything but particles to render. I’ve made a pretty nice particle setup, and would love to be able to get a shadow pass for it.
This thing has 3 X-particle systems. Each with their own PRT Loader with 3 partitions each for a total of 54,000,000 particles at its peak. 45 second render times with no DOF or Motion Blur. AMAZING! I had no problem with multiple PRT Loaders. I did have to cache one system, because it was spawned from another. To be able to save out the PRT files for that spawned system ONLY I had to cache the spawned system so I could then turn of the first system and still have particles when saving out PRTs. I didn’t have to cache the other two systems to get PRT files. Everything worked out wonderfully.
Any advice on how I can get shadows would be greatly appreciated.

Thanks for this amazing plugin.
Shawn
Smoke_Trail.mp4 (2.34 MB)

HI!

There are three cases of shadow casting in Krakatoa:
*Particles-To-Particles
*Geometry-To-Particles
*Particles-To-Geometry

The first one is part of the volumetric shading nature of Krakatoa and cannot be turned off when rendering volumetrically (e.g. not in additive rendering mode).
The second one is supported via Matte objects. The light must have a shadow setting different than None, and the object must have a Krakatoa Mesh tag with Visible To Light checked to cast shadow onto particles.
The third one is currently unsupported in CINEMA 4D due to SDK limitations. The only version of Krakatoa that supports this is Krakatoa MX in 3ds Max where shadow generators are implemented as a plugin class. The Krakatoa Shadow Generator would write Deep Opacity Maps to OpenEXR format containing a Z-Depth layer and multiple density layers at various distances along the light path when rendering in Krakatoa. When rendering in another renderer (like V-Ray or the default renderer of 3ds Max), the Krakatoa Shadow Generator would load and interpolate the saved data and combine the shadows of the particles with another shadow generator responsible for geometry-to-geometry shadow casting to produce the final result.
Here is the documentation of the KMX Shadow Generator: thinkboxsoftware.com/krak-shadows-generator/
And here is an example of rendering shadows: thinkboxsoftware.com/krak-sh … -geometry/

We are trying to communicate this problem to the MAXON development team in hopes that they could provide either a workaround, or hooks in the SDK to allows us to do what we need to produce shadows from Krakatoa particles on geometry in the future.

A possible workaround would be to create PRT Surface objects from geometry that is supposed to receive shadows, and use the particles-to-particles shadow casting to catch shadows on the PRT Surface object. But separating the shadow-casting from the shadow-receiving particles would be tricky, and it would require many millions of PRT Surface particles to get good results, and PRT Surface particles tend to produce noisy results due to self-shadowing.

Another possible workaround would be to render black particles against white background from the point of view of the light source and use camera mapping to project the result onto the geometry to produce a shadow pass. I have not tried this in CINEMA 4D, but it might work…

Thanks for all the info,
Since I wanted to create some shadows on the ground that came from the particles I used your last suggestion.
I created a camera (Shadow Camera) and put it into the same position with the same angle as the light that I wanted creating my shadows. I did what you said next. I rendered out black particles onto a white background through the Shadow Camera with the Krakatoa Renderer. I took that sequence and put it into a texture and camera mapped it onto my floor plane. I then rendered out a shadow pass from my original camera and used that as a multiply layer underneath my color layer to make a pretty good shadow.
This was pretty easy to set up and fairly quick to output with PTR loaders, but could become difficult in a full on production setting with those extra steps that are needed. Either way your idea does work in Cinema 4D, and here’s proof.
Thanks again,
Shawn
Smoke_Trail_wShadows.mp4 (2.36 MB)

nice and solid workaround I must say :slight_smile:

Great!

In short, we should look into automating this shadow generation process in the future. :slight_smile:
Just so you know, Krakatoa 1.0 in 3ds Max used exactly this approach, so it has been tested in the past. The main issue was where we had to render shadow casting from particles AND meshes onto meshes. If a mesh was between the light and the particles, casting shadows on the ground, the particle rendering had to leave a hole (as matte) where that mesh was, and hope that the shadow generated by the mesh onto the ground and the projection from the light would merge nicely and without a gap on the ground, while leaving the shadow casting object unshadowed (because it is IN FRONT of the particles, not behind them).

That’s why we added Deep Opacity Maps and a Shadow Generator plugin in KMX v1.6 a few years later, but have not found a good way to integrate that in CINEMA 4D and Maya (yet).