Krakatoa
RSS< Twitter< etc

Light Sources In Krakatoa For CINEMA 4D

Last edited on April 11, 2014

Introduction

The Krakatoa renderer supports several light sources including Point light, Spot light and Direct light. These light sources do not match perfectly all available CINEMA 4D lights, but a large number of properties have similar functionality and are mapped to produce similar or identical results as well as possible.

Krakatoa Lights

General Notes And Shadow Casting

Krakatoa light sources are vital to Krakatoa's Volumetric Rendering capabilities. The whole point of volumetric particle rendering is to calculate how each particle diffuses and attenuates the light that is passing through it. In other words, volumetric shadow casting is an integral part of the illumination calculations of Krakatoa and cannot be disabled! This means that even if a light is set to not cast shadows in CINEMA 4D, it will still cast shadows from particles onto other particles in Krakatoa!

The above does not apply to shadow casting from geometry objects onto particles though. Only Mesh objects explicitly tagged as visible to lights using a Krakatoa Mesh Tag will cast shadows, and only if the light is also set to cast shadows.

Particles will generally render as black unless illuminated by one or more light sources, unless a non-black Emission (a.k.a. Self-Illumination or Incandescence) channel is provided by the particle and Use Emission is enabled explicitly, or if Force Additive Mode is checked (which also produces Emission internally).

Default Lights are NOT supported by Krakatoa. To produce volumetric rendering, at least one valid explicit light source must be created before rendering.

Point Lights

The Krakatoa Point light illuminates in all directions and is laregly equivalent to the Point light in CINEMA 4D. It also casts shadows in all directions by calculating 6 Attenuation maps to produce a Cubic Attenuation Map. 

Point Lights are not recommended as general purpose light sources because they require more Attenuation Map calculations, can cause artefacts at the edges of the cubic Attenuation map, and are not supported at all in Voxel Rendering Mode.

They are recommended when attempting to illuminate surrounding particles on all sides in Particle Rendering Mode, for example a light source completely enclosed in a particle cloud.

Spot Lights

A Krakatoa Spot Light has a source point, a direction, and Outer and Inner Cones defined in degrees which get wider with distance. Illumination and attenuation are calculated only inside the Outer Cone, with a falloff between the two cones.

The Krakatoa Spot light is laregly equivalent to the Spot and Square Spot lights of CINEMA 4D.

Direct Lights

The Krakatoa Direct Light has a source point and a direction and casts parallel rays within a cylinder with inner and outer radii. No illumination and attenuation will be calculated outside the cylinder's Outside radius, as well as behind the light. 

There is no option to clamp the illumination along the cyllinder's length, it will be calculated at any distance in front of the light's plane within the Outer radius.

The Krakatoa Direct Light is largely equivalent to the Parallel Spot and Square Parallel Spot lights in CINEMA 4D. It is somewhat similar to the Infinite and Parallel lights.

CINEMA 4D Native Lights Support 

Let's look at the various CINEMA 4D Lights and see which of their properties are supported and what the similarities and differences are.

General Light Properties

The following parameters will be exported to Krakatoa for all CINEMA 4D Lights:

Color and Intensity - Krakatoa Light Flux

  • The light Flux will be calculated from the CINEMA 4D General > Color and General > Intensity values. 

Enable Shadow Casting From Meshes

  • The CINEMA 4D General > Shadow and Shadow > Shadow drop-down lists controls whether the Light will cast shadows from Matte geometry (holdouts) onto particles. 
  • When set to None, only shadows from particles onto particles will be calculated.
  • When set to any other mode (Shadow Maps (Soft), Raytraced (Hard), Area), shadows will be cast from particles onto particles and meshes onto particles, as long as the Mesh has a Krakatoa Mesh Tag with the Visible To Light option checked.

Enabling / Disabling Illumination 

  • When the General > No Illumination checkbox is unchecked, the light will be used to illuminate the scene particles at render time.
  • When the General > No Illumination checkbox is checked, the light will be ignored. 

Decay (Falloff)

  • In Krakatoa, the Falloff is exposed as an Exponent. 
  • Supported CINEMA 4D Falloff types and their corresponding Krakatoa counterparts are:
    • None - no falloff (Decay Exponent 0)
    • Linear - linear falloff (Decay Exponent 1)
    • Inverse Square - inverse square falloff (Decay Exponent 2)
    • Step - no falloff, same as None (Decay Exponent 0)
    • Inverse Square Clamped - inverse square falloff, unclamped  (Decay Exponent 2) 

Near and Far Attenuation

  • When the CINEMA 4D Details > Near Clip and/or Far Clip checkbox is checked, the respective From and To properties will be used as Near and/or Far Attenuation values by Krakatoa.

Shadow Density 

  • The Shadow > Density percentage value will be used as a multiplier for the Lighting Pass Density of the respective light source, thus allowing two lights in the same scene to illuminate the same particles using different density values. 

Attenuation Map Resolution  

  • All light sources in Krakatoa generate Attenuation maps using the Shadow Map size defined in the host application.
  • In the case of CINEMA 4D, the Shadow > Resolution X value (defaults to 250) will be used even if the Shadow type is NOT set to Shadow Maps (Soft)!
  • In all other Krakatoa implementation (3ds Max, Maya, Stand-Alone), the default Attenuation Map size is 512 unless specified otherwise. 
  • Thus, we recommend switching to Shadow Maps (Soft) and tweaking the default Resolution X value to produce finer shadow results.

Point Lights

The CINEMA 4D Point Light is exported as Krakatoa Point Light.

The following Point Light properties will be taken into account:

Light Position 

  • The Coord. > Position values define the location of the source of light in space. 
  • Light will be emitted in all directions from that point. 

Light Scale

  • Increasing the Coord. > Scale value reduces the illumination, and vice-versa. 
  • It is recommended to keep the light scale at 1,1,1 and adjust the Intensity instead.

Light Rotation 

  • The Coord. > Rotation affects the orientation of the Cubic Attenuation Map. 
  • In some cases, under very shallow angles and with relatively low resolution Attenuation Maps, some Moire patterns or edge artefacts might asppear if the Lighting Pass Density is high enough. 
  • Sometimes, rotating the Point light source can change or remove the problems.

Direct Lights

All CINEMA 4D Parallel Lights including Parallel, Parallel Spot, Square Parallel Spot and Infinite are exported as Krakatoa Direct Lights.

The Krakatoa Direct light has a Shape property which can be set to square or round. This property will be set automatically according to the type of the CINEMA 4D light - Square Paralle Spot exports as square, the rest as round.

The following properties will be taken into account:

Light Position 

  • The Coord. > Position defines the location of the source of light in space. 
  • Light will be emitted in all directions from that point. 

Light Rotation 

  • The Coord. > Rotation affects the direction of the light. 

Inner / Outer Radius

  • The Shadow > Parallel Width value will be used to control both the inner and outer radii of the Direct Light when using CINEMA 4D Parallel and Infinite lights.
  • The Details > Inner Radius and Details > Outer Radius values will be used to define the inner and outer radii of the Direct Light when using CINEMA 4D Parallel Spot and Square Parallel Spot.

Aspect 

  • The Details > Aspect Ratio value will be used, but it works slightly differently in Krakatoa than in CINEMA 4D. 

Spot Lights

All CINEMA 4D Spot Lights are exported as Krakatoa Spot Lights.

The Krakatoa Spot has a Shape property which can be set to square or round. This property will be set automatically according to the type of the CINEMA 4D light - Squre Spot exports as square type, Spot as round type.

Inner / Outer Radius 

  • The Details > Inner Angle and Details > Outer Angle values will be used to define the inner and outer angles of the Krakatoa Spot light. 

Aspect 

  • The Details > Aspect Ratio value will be used, but it works slightly differently in Krakatoa than in CINEMA 4D. The Krakatoa aspect retains the area of the light cone's cross section, so as the one dimension increases, the other decreases proportionally to produce the same area.