Cycles – Nested Refractive Volumes

Software:
Blender 2.79 | Cycles Renderer

When it comes to rendering nested refractive volumes, like a glass containing a beverage, the way to set it up in Cycles is common to many modern ray-tracers.
The touching bodies of refractive material like glass and liquid must overlap each other slightly so that rays being traced “meet” the right surface without having surfaces touching and causing “Z fighting” artifacts.

Transparencies_Air_Bubbles-01

When the render includes volumetric shading, like Volume Absorption (sometimes referred to as “fog”), the meshes must be set-up in a certain way for Cycles to interpret the volumes properly.

Intersecting volumes like a beverage glass and liquid must be separate objects to be rendered correctly. When joined into one mesh the renderer doesn’t treat the different volumes separately even though they have different shaders.
And the result is that the volume (depth) of the inner volume is calculated as just the depth on the intersection (the overlap) of the volumes.
In this example the wine can’t be rendered correctly when the glass and liquid meshes are joined.
The wine liquid doesn’t get it’s deep color because the renderer “thinks” it’s very thin.

Untitled-1.jpg

When the meshes are separated the renderer interprets the wines volume correctly and the Volume Absorption shader produces the right color:

Untitled-2

Setting up cavities within a volume like air bubbles, is similar to many other modern ray-tracers. You just have to create inner meshes that have flipped normals facing inwards, so air bubbles within the wine don’t need to have “air” material, they have the same wine shader, but have their faces flipped.

Note that in this case, it’s the other way around from the previous example.
If the bubble meshes are separate from the liquid mesh the renderer doesn’t interpret them as holes in the liquid volume, and produces an incorrect result:

Untitled-3

When the bubble meshes are joined to the liquid mesh, the volume is interpreted correctly:

Untitled-4.jpg

In short:
For these refractive volumetric effects to be rendered correctly in Cycles,
Surfaces of the same material volume must be joined to one mesh, and separated from meshes belonging to different material volumes.
* This may sound trivial, but it’s not. there are rendering systems in which only the surface shader determines volume interpretation and that has advantages like the convenience to aninate bubbles as separate objects from the liquid itself or the ability to join a glass bottle with the liquid into one mesh model.

Advertisements

Arnold for Maya refractive caustics

Software:
Maya 2018 | Arnold 5

An account of the drastic measures that need to be taken in order to ‘persuade’ Arnold for Maya to render refractive caustics.

  1. In the refractive object’s shape attributes,
    Under ‘Arnold’, ‘Opaque’ must remain checked.
    * This is unintuitive but when refractive caustics are calculated there is no need for transparent shadows. the caustics pattern is in fact the light refracting through the object.
  2. The refractive object’s aiStandardSurface shader must have it’s Transmission layer active.
    For a colored refractive object, Transmission Weight should be 1.0,
    A color should be selected, and the density of the color should be controlled with the Depth attribute (higher values make the color less dens).
    In the shader’s advance attributes, check ‘Caustics’.
    In the shader’s Specular layer, set the IOR to match your material.
    * The default of 1.52 is the IOR for glass, and water would be IOR 1.33 for example.
  3. For refractive caustics to be rendered, the light source must be an Arnold Mesh Light,
    And in its shape attributes, under Light Attributes ‘Light Visible’ must be checked.
  4. In many cases, in order for the caustics pattern’s intensity to be correct,
    The ‘Indirect Clamp Value’ must be raised in Render Settings > Arnold Renderer, under Clamping.
  5. In some cases the Transmission value under Ray Depth in Render Settings > Arnold Renderer must be increased for the caustics to render properly.
    * Light simulation must be able refract through all the relevant surfaces.
  6. To increase the caustics render quality, the number of Diffuse samples must be raised in Render Settings > Arnold Renderer.
    * This may be unintuitive, but the caustics pattern is actually part of the Diffuse rendering of the surface upon which the caustics are appearing.

That’s it!
Hope you find this useful 🙂

Arnold_Coustics_AArnold_Coustics_BArnold_Coustics_C