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! ;)

6 comments:

  1. I hope this advice, and the advice from the last post makes it into the official docs. I've gotten several phone calls about this from different parts of the world.

    ReplyDelete
  2. Density (and light density) aren't the cause, just the symptom. The only reason you might have too high opacity density is if you have too low spatial density, and even then, you might have a distribution (sampling) problem. The "opacity" density and "spatial" density combine to create the final density look, and that final density might be required for the object.

    The only options you have at that point are to either increase the spatial density, or to optimize the sampling (which is hard).

    There are other options, too, like post-process noise reduction, or just posting them on YouTube (the compression removes a lot of the Nerf look).

    The easiest thing, though, is just to increase the spatial density as high as possible. The trick is getting users to learn that "as high as possible" may be higher than they were expecting.

    ReplyDelete
  3. Ben, at your request I created two new pages in the docs:

    http://software.primefocusworld.com/software/support/krakatoa/important_workflow_changes_in_krakatoa_v1.5.0.php

    and

    http://software.primefocusworld.com/software/support/krakatoa/fighting_the_grainy_look.php

    ReplyDelete
  4. Great info as always! I know I am guilty of to high density usage, great example page, it really helps to clarify the "issue"

    ReplyDelete
  5. ha ha that's so fun to see add for Vilnius spa *(i live in Vilnius) through your blog. haven't seen it on tv. should read your blog more often :) thanks.

    ReplyDelete