Krakatoa
RSS< Twitter< etc

First Steps In Krakatoa For CINEMA 4D

Last edited on April 15, 2014

Level: Basic

Overview

The following introductory tutorial will guide you through your very fist steps in Krakatoa for CINEMA 4D.

At this point, we assume that you have successfully installed and licensed the plugin.

Accessing Krakatoa In CINEMA 4D

Krakatoa C4D can be found in several major areas of the CINEMA 4D User Interface:

Render Settings dialog

The Krakatoa renderer will appear as another render engine in the CINEMA 4D Render Settings dialog. Several tabs related to output, rendering, shading, logging, licensing and post-processing particle files can be found in this dialog. You can learn more about each of them in the Krakatoa User Reference.

Main Menu Bar > Plugins > Krakatoa 

The menu contains the creation tools for all Krakatoa-related scene objects. These include Krakatoa PRT Loader, PRT Fractal, PRT Volume, PRT Surface, as well as the source objects for native and 3rd party systems - Krakatoa TP Source, Krakatoa Emitter Source, Krakatoa XP Source (for X-Particles), and Krakatoa TFD Source (for Turbulence FD).

 

Object > Right-Click Menu > Krakatoa Tags

This menu contains all Krakatoa-related tags for modifying Krakatoa and CINEMA 4D scene objects to participate in Krakatoa particle rendering. These include several channel-related tags, the Krakatoa Mesh and Krakatoa Camera tags, and the Repopulate tag used to multiply existing particles at render time.

Rendering A Simple Spherical Point Cloud

In our very first test with Krakatoa, we will use the Krakatoa PRT Volume object to convert a mesh object (a Sphere primitive) to a point cloud. Then we will set up a light source, assign the Krakatoa renderer and produce a volumetric rendering with half a million points.

Creating The Sphere And PRT Volume 

  • Click on the blue cube icon and hold down the left mouse button to expand the flyout. 
  • Select the Sphere primitive and release the mouse button to create a default Sphere with radius 100 cm at the world origin.
  • While the Sphere is still selected, navigate to the Plugins menu, select the Krakatoa sub-menu and pick the Krakatoa PRT Volume. 

RESULT: A second object will be created in the scene, and the Sphere will be automatically added to its Object input.

As a rule of thumb, when creating Krakatoa objects from the menu, if a single valid source object is selected, it will be connected to the newly created Krakatoa object automatically. If multiple objects are selected, only the last one will be added. If the selection is not vaid (e.g. a light is selected instead of a geometry object), it will be ignored. 

You can always drag a valid object into the Object input manually according to the usual CINEMA 4D workflows, but using the existing selection can save you some clicks!

Creating A Spot Light 

  • Click the light icon and hold the left mouse button pressed to expand the flyout.
  • Select the TargetLight icon to create a new Target Light illuminating the world origin. 

Assigning The Krakatoa Renderer 

  • Click the Edit Render Settings icon in the Main Menu bar to open the Render Settings window.
  • Select Krakatoa from the list of installed Renderers.
  • From the Main Menu bar, select Script > Console... to open the console window where Krakatoa logs information about the rendering.
  • Render the view.

RESULT: The result will look too dark and murky. This is because the density of the 509,634 particles created is too high and the particles absorb the light passing through them too quickly.

Adjusting The Final Pass Density 

  • Switch the Render Settings dialog to the Options tab.
  • Under the Lighting And Drawing Pass panel, locate the FInal Pass Density and Exponent values - they default to 5 and -1 respectively. These values are combined internally into one value using scientific notation. 5*10^-1 means 5*0.1=0.5.
  • Change the Exponent to -2. This will reduce the density of all scene particles 10 times to 0.05. In general, changing the Exponent down moves the decimal point to the left, increasing the Exponent moves the decimal point to the right. This way, extremely small and extremely large values can be represented without hitting the limitations of CINEMA 4D value input fields.
  • Render again. 

RESULT: The particle sphere will appear somewhat brighter, but the obvious grid pattern will cause some moire effects.

Jittering The PRT Volume 

  • Click twice on the viewport visibility switch of the Sphere to hide the Sphere in the viewport - you will be able to see the viewport representation of the PRT Volume's point cloud. Note that the viewport uses larger spacing (4cm), producing less particles than at render time (2cm spacing).
  • Select the Krakatoa PRT Volume object.
  • In the Mesh tab, check the Enable Jittering checkbox.
  • Re-render the image. 

RESULT: The viewport should now show the particles as randomly distributed, and the renderer will also produce a more diffuse-looking, sponge-like result.

Decoupling The Lighting Pass From The Final Pass Density

Currently, both the scene lights and the camera see the particles the same way - when we reduced the Final Pass Density Exponent by one order of magnitude, we made the particles appear 10 times less dense to both the light and the camera. 

In some cases, it can be useful to pretend that the particles are less dense to the light or the camera. For example, reducing the Final Pass Density Exponent to -3 would let more light penetrate the cloud, but it will also make the result more transparent to the eye, making it appear ghost-like. 

  • In the Lighting And Drawing Pass panel, check the option Use Lighting Pass Density.
  • Set the Lighting Pass Density values to 5 (default) and -3 (change from default -1)
  • Re-render. 

RESULT: The sphere retains its camera density (and resulting image Alpha channel), but lets 10 times more light through the cloud.

 

Replacing The Sphere Mesh With A Figure

We can reuse this setup to produce a more interesting shape by replacing the Mesh source of the PRT Volume with a Figure primitive. 

  • Click the blue cube icon and hold the left mouse button to expand the menu.
  • Select the Figure icon and release the mouse button to create the Figure object.
  • Select the Krakatoa PRT Volume object.
  • Drag the Figure object into the Object field of the PRT Volume.
  • Re-render. 

RESULT: The PRT Volume will now generate a figure-shaped cloud, but it will be partially dark because the Spot light cone is too small. Also, the volume of the Figure is a lot smaller than the Sphere, so only 189K particles will be generated.

Increasing The Particle Count And Adjusting The Light Cone

There are several ways to adjust the particle count of a PRT Volume object - adjusting the Voxel Spacing in Renderer value will sample the mesh more often, resulting in much more precise voxel grid conversion at cost of performance; adjusting the Voxel Subdivisions will split each voxel into sub-voxels and fill each of them with one or more particles; increasing the Jittered Particles Per Voxel value will add more particles in each voxel or sub-voxel.

It is recommended to use the Subdivision option first when large changes to the particle count are required and the precision of the grid is already good enough.  

  • Slide the Voxel Subdivisions slider from 0 to 1 - this will sub-divide each voxel once along each axis, producing 2x2x2 = 8 new sub-voxels, each with one particle at a random position in it.
  • Select the Light, click on the Details tab and change the Outer Angle to 45 degrees, and the Inner Angle to 30 degrees.
  • Re-render. 

RESULT: Now the whole Figure is illuminated, and produces around 1.5 million points (8 times more than in the previous render)

Using The PRT Volume Shell Option 

The PRT Volume provides an option to seed particles only within a limited band of particles relative to the surface of the mesh. 

  • Select the PRT Volume and check the Enable Shell checkbox.
  • Keep the Shell Start at 0 cm and change the Shell Thickness to 2 cm.
  • In the Render Settings dialog, uncheck the Use Lighting Pass Density checkbox.
  • Re-render. 

RESULT: Only particles within 2 cm from the surface of the mesh will be generated, leaving the rest of the volume empty. Light will only be attenuated around the surface and will illuminate the backside of the point cloud even though the density is 10 times higher than it was in the previous test.

Further Increasing The Lighting And Final Pass Density

Going a step further and increasing the Final Pass Density to 5 with Exponent -1 will make the particles so dense that the PRT Volume will shade as solid despite the fact it is hollow and not a solid volume. 

  • In the Render Settings dialog, change the Final Pass Density Exponent to -1.
  • Re-render 

RESULT: The density is now so high that the object appears nearly solid, but there is still some light leaking throigh and hitting the back side of the volume.

  • Change the PRT Volume Shell Thickness to 5 cm 
  • Re-render. 

RESULT: This produces about 665K particles and eliminates the light from the back side of the cloud. This is exactly equivalent to rendering 1.5 million particles with Enable Shell unchecked, but it is faster and uses less memory.

In general, you can use the Shell to reduce the amount of particles to be rendered when the density per particle is so high that the light does not penetrate the whole volume...