Saturday, November 21, 2009

"Grainy, like a Krakatoa render..."

As you could imagine, I spend a little time googling "krakatoa particles" and "krakatoa render" about once a week to find out what people are doing with it and what they are talking about on various forums.
A couple of weeks ago I discovered the following (rather old) thread on the SideEffects forums related to a Houdini rendering which was described, as the title of this blog says, as "pretty grainy, like a Krakatoa render".
I guess this is a good cause for a new blog.

I must say the actual animation shown in the thread wasn't that grainy, but I am more concerned about the public image of Krakatoa. I suspect the assumption that Krakatoa has a particular look is caused by the huge amount of animations on YouTube that simply have the wrong settings.

Of course, in some cases Krakatoa is being used to produce sand or pieces of solid objects flying around. In such cases making each particle distinguishable as a dot can be desirable. In fact, the Nanomites in G.I.Joe were also rather grainy, but it was the look that was requested.

When using Krakatoa to create effects like Ink in Water or Wispy Smoke though, the rule of thumb is - if you can see a particle as a particle, your Density is too high! The main idea behind Krakatoa (even before it was called Krakatoa) was to take several hundred million particles and draw them together into the image buffer with very low density per particle to accumulate a SMOOTH final result - in the movie "Stay" where our particle rendering was first used (inspired by Doc. Baily's Spore rendering), the effect looked like glowing plasma. In the movie Cursed, we actually used FLOOD to drive millions of particles through a simulation and rendered them in the same renderer to get the Wispy Smoke seen in this PDF.

The recent "Ink" animation created by weareflink for the CCTV shows a pretty good use of Krakatoa simulating ink in water without being able to distinguish single particles. Also, the Vilnius SPA animation by DekoLT is a great example of high density but enough particles to create solid-looking clouds.

Another factor that can cause a lot of grain in the rendering esp. of solid-looking clouds is the Light Pass Density. As you probably know, Krakatoa lets you decouple the density of particles as seen by the lights from the density used by the camera to draw the particles. High density in the Lighting Pass with very high particle counts can produce self-shadowing of particles at the very surface of the cloud because the outer-most layer of particles would "eat up" all the light and the very next particle layer below them would appear very dark as opposed to the very bright lit ones. This can produce not only grain but even very undesired moire effects.

Reducing the Light Density a bit and letting more light penetrate the volume (also resulting in a sweet sub-surface scattering effect) usually solves this problem.

So please, if you are rendering in Krakatoa, make sure you crank up the particle count AND lower the Density until you get a smooth result, then play with the balance of the Lighting Pass vs. Final Pass Density to get the correct amount of light penetration and pixel coverage...

EDIT: You can find some illustrations on this new documentation page.

Have a smooth rendering! ;)