Voxel Rendering

Available in Krakatoa v1.5.0 and higher

Introduction

Krakatoa is a volumetric particle renderer and its first commercial incarnation approached the rendering of particles as pixel-sized points due to the high detail and speed this method provided.

But even before the first version of Krakatoa was released, an alternative approach to particle rendering was used in the production of Superman Returns where particles had to be raytraced inside crystal volumes. Raytracing infinitely small points is an infinitely difficult task which called for an alternative representation of the particle cloud on a voxel grid.

Krakatoa 1.5.0 reintroduces this option to represent the particles in an alternative way which has its own pros and cons:

Pros

  • Rendering Voxels produces solid volumes one could fly through without getting any point artifacts typical to the point rendering approach.
  • Fewer particles are needed to produce dense clouds - as long as there is at least one particle in every voxel, there will be no gaps between the voxels.
  • The conversion of particle data into voxels is trivial and fast.
  • The level of detail/smoothness of the result can be controlled using the voxel size and the filter radius, allowing results comparable to point rendering when the voxel size is close to the pixel size, but also very fuzzy representations of the particle cloud when using large voxel sizes and filter radii.
  • The voxel rendering is more suitable for multi-threading than the Point Rendering, promising better utilization of multiple CPUs.
  • Shadow Casting calculations produce less visible moire pattern artifacts.

Cons

  • At least in its current version, voxel rendering is typically slower than particle rendering.
  • While the detail of the rendered image can come close to the quality of point rendering, it cannot provide the same detail where every particle is drawn on screen as a point. Thus, voxel rendering is better suited for clouds, smoke and other less detailed phenomena, while particle rendering is better for sand, dust and silt.

Exploring Voxel Rendering

Volumetric Particle Rendering

  • These images are from a simple Particle Flow system with 20K particles lit by two spot lights - a white one from the right up and a blue one from the bottom left.
    • The left image uses Density of 5.0/-1, the right one uses 5.0/0.
    • Rendering time for both (excluding the PFlow update time) was 0.2 seconds.
../../../_images/particle_volumetric_d5_-1_pe0_hg.png ../../../_images/particle_volumetric_d5_0_pe0_hg.png

Volumetric Voxel Rendering

Changing the Voxel Size

  • The following 3 images show Voxel Volumetric Rendering with Density 5.0/-1, Voxel Filter Radius 1 and Voxel Size of 0.5, 1.0 and 5.0.
    • The small voxel size of 0.5 on the left looks very similar to the particle rendering above because the voxels are nearly pixel-sided in this particular case. But the render time is orders of magnitude longer.
    • As the voxel size increases, the result becomes more smooth and cloudy and the render times become shorter.
    • Render times on a Dual-Quadcore Xeon 2.5GHz were:
      • BETA 1: 78.6 | 45.9 | 12.37 seconds.
      • BETA 2: 27.25 | 15.359 | 4.516 seconds. (Speedup vs B1: 2.8844x | 2.98848x | 2.73915x )
      • BETA 4: 6.641 | 4.953 | 2.843 seconds. (Speedup vs.B2: 4.1033x | 3.10095x | 1.58846x )
../../../_images/voxel_volumetric_d5_-1_size05_rad1_pe0_hg.png ../../../_images/voxel_volumetric_d5_-1_size1_rad1_pe0_hg.png ../../../_images/voxel_volumetric_d5_-1_size5_rad1_pe0_hg.png

Changing the Render Output Resolution

  • The performance of Voxel Rendering, other than Particle Rendering, is very dependent on the render output image size.
  • Here are the render times for the same sequence as above but rendered at different resolutions - Krakatoa scales in nearly linear fashion as the render area quadruples:
    • BETA 2 640x480 : 30.453 | 17.281 | 4.968 seconds.
    • BETA 2 1280x960 : 92.625 | 51.813 | 15.203 seconds.
    • BETA 2 2560x1920 : 355.5 | 198.672 | 58.75 seconds.

Changing the Voxel Filter Radius

  • The following 3 images show Voxel Volumetric Rendering with Density of 5.0/0, constant Size of 5 but Voxel Filter Radius of 1,2 and 5 respectively.
  • As the Voxel Filter increases, the voxels are smoothed against more and more neighbors, resulting in fuzzier look and longer render times.
  • Render times from left to right:
    • BETA 1: 12.5 | 13.98 | 20.9 seconds.
    • BETA 2: 4.531 | 5.212 | 8.813 seconds. (Speedup vs B1: 2.75877x | 2.67867x | 2.3715x )
    • BETA 4: 2.843 | 3.656 | 7.294 seconds. (Speedup vs B2: 1.59374x | 1.4256x | 1.20825x )
../../../_images/voxel_volumetric_d5_0_size5_rad1_pe0_hg.png ../../../_images/voxel_volumetric_d5_0_size5_rad2_pe0_hg.png ../../../_images/voxel_volumetric_d5_0_size5_rad5_pe0_hg.png

Changing the Henyey-Greenstein Phase Eccentricity

  • The following 4 images show the same rendering but with varying Phase Eccentricity value using the Henyey-Greenstein function.
    • The render times are identical.
    • The visual difference as the Phase Eccentricity changes to 0.1, 0.25, 0.5 and 0.75 shows that this Phase function favors the backlighting and suppresses front lighting as the value increases.
../../../_images/voxel_volumetric_d5_0_size2_rad5_pe01_hg.png ../../../_images/voxel_volumetric_d5_0_size2_rad5_pe025_hg.png ../../../_images/voxel_volumetric_d5_0_size2_rad5_pe05_hg.png ../../../_images/voxel_volumetric_d5_0_size2_rad5_pe075_hg.png

Changing the Schlick Phase Eccentricity

  • The following 4 images show the same rendering but with varying Phase Eccentricity value using the Schlick function.
    • The render times are identical.
    • The visual difference as the Phase Eccentricity changes to 0.1, 0.25, 0.5 and 0.75 shows that this Phase function favors the front lighting and suppresses backlighting as the value increases.
../../../_images/voxel_volumetric_d5_0_size2_rad5_pe01_sch.png ../../../_images/voxel_volumetric_d5_0_size2_rad5_pe025_sch.png ../../../_images/voxel_volumetric_d5_0_size2_rad5_pe05_sch.png ../../../_images/voxel_volumetric_d5_0_size2_rad5_pe075_sch.png

Volumetric Mapping Capabilities

  • Both the Particle and Voxel Volumetric Rendering modes in Krakatoa support procedural volumetric (3D) textures as controls of color and density.
    • The images below show Particle and Voxel rendering with
      • a Cellular map as Diffuse Map,
      • another Cellular map as Opacity Map,
      • and both.
    • The particle box contained initially 1 million particles.
      • To achieve a similar look, the Particle rendering mode would have needed several more partitions.
      • The fourth image of the Particle Rendering series shows 10 partitions of 1M particles each. It looks similar to the Voxel rendering, but is actually slower!

Particle Rendering

../../../_images/krakatoa_points_diffusemap.png ../../../_images/krakatoa_points_opacitymap.png ../../../_images/krakatoa_points_diffusemap_opacitymap.png ../../../_images/krakatoa_points_diffusemap_opacitymap_10x.png
  • The render times in Particle mode were: 2.687 | 2.703 | 2.797 | 26.421 seconds.

Voxel Rendering

../../../_images/krakatoa_voxel_diffusemap.png ../../../_images/krakatoa_voxel_opacitymap.png ../../../_images/krakatoa_voxel_diffusemap_opacitymap.png
  • The render times in Voxel mode were:
    • BETA 1: 23.922 | 23.828 | 23.781 seconds.
    • BETA 2: 11.281 | 11.204 | 11.375 seconds (Speedup vs B1: 2.12056x | 2.12674x | 2.09064x)
    • BETA 4: 8.829 | 8.782 | 8.86 seconds (Speedup vs B2: 1.27772x | 1.27579x | 1.28386x)

Opacity Mapped Matte Objects

  • Krakatoa 1.5 added support for opacity-mapped Matte Objects.
  • Although Krakatoa will supports semi-transparent objects as matte objects, compositing such renders with other render elements is not always possible (it would require multi-layer output).
  • The following examples show Particle and Voxel rendering with a plane without opacity mapping, and the same plane with an opacity mapped bitmap texture of a leaf.
../../../_images/krakatoa_points_diffusemap_matteopaque.png ../../../_images/krakatoa_points_diffusemap_matteopacitymap.png
  • Rendering times for the Particle mode were:
    • BETA 1: 18.359 | 25.984 seconds.
    • BETA 4: 3.625 | 3.734 seconds (Speedup 5.06455x | 6.95769x).
../../../_images/krakatoa_voxel_diffusemap_matteopaque.png ../../../_images/krakatoa_voxel_diffusemap_matteopacitymap.png
  • Rendering times for the Voxel mode were:
    • BETA 1: 21.468 | 22.672 seconds.
    • BETA 2: 11.141 | 11.032 seconds.
    • BETA 4: 7.875 | 8.469 seconds.