Refractive Caustics using an Emissive Shader

 

With the correct setup, caustic effects are possible using MtoA. This short tutorial goes through how to setup a scene that contains a 'liquid' mesh with Refractive Caustics enabled in the Ai Standard shader assigned to it. The scene uses a plane that has a high Emissive Scale value which produces the 'Refractive Caustic' effect. Note that 'hard' caustics from small but bright light sources (e.g., a spot light through a cognac glass) are not currently possible. 

Arnold uses simple, uni-directional path tracing. Rays start at the camera, not at the lights. Arnold does not use bi-directional path tracing (nor any other bi-directional technique, such as photon mapping, which fires rays from the lights). When using standard lights, like point lights and spot lights, which are idealized lights with zero area, i.e. point lights, it is simply impossible for Arnold's GI/reflection/refraction rays to hit the lights. Therefore, there are no caustics. However, it is possible to turn point lights and spot lights into finite-size lights by increasing their 'radius' parameter, which makes them spherical lights, which give beautiful soft shadows and soft highlights. It should then be possible for GI/reflection/refraction rays to 'see' those lights, right? Well, no. In Arnold, lights do not have a corresponding geometric object that's stored in the geometry database that rays traverse during ray-scene intersection. So, area lights are still invisible to GI/reflection/refraction rays. 

 

Instead of using Arnold's standard lights, you can create a polygon mesh, give it a flat emissive shader, and let the GI engine 'find' that light. You will then get caustics. However, this is very inefficient, because small emissive objects are hard to hit. You would need many rays, or a very large emissive object, for this noise to be acceptable. That is why the user guide states that we can do 'soft' caustics, as coming from big emissive objects.

 

  • Start off by opening the Maya scene file Refractive-Caustics_Start.ma. The scene contains a basic object to start off with. Create a polygon floor plane and position it underneath the mesh.

 

Emissive Plane

  • Create another plane and position it above the mesh as indicated below.

 

  • Assign an Ai Standard shader to the polygon plane above the polyon mesh. This will represent our light source. Decrease the Diffuse value of the Ai Standard shader and increase the Emission to around 10.

 

Mesh Shading

  • Assign an Ai Standard shader to the polygon mesh that we want to generate the Refractive Caustics. We are going to make this a glass shader. Before we do that, we must first ensure that the Opaque flag is disabled. Select the polygon mesh and in the Attribute Editor, disable Opaque in the Arnold attributes.

Disable Opaque in the Arnold attributes for the glass polygon mesh

 

  • Lower the Diffuse value to 0. Increase the Specular Weight to 1 and lower the Specular Roughness to 0. Increase the Refraction Weight to 1 and change the IOR to that of glass (1.5)

 

  • Next we will add a colored tint to the shader. Create a 2d ramp and add some interesting colors to it as in the screengrab below:

 

  • Connect the ramp to the Transmittance attribute of the Ai Standard shader.

 

Refractive Caustics

In order to see Refractive Caustics through our glass, we must enable them in the Ai Standard shader that is assigned to our glass mesh. Caustics can be found under Emission in the Ai Standard attribute editor. Click on Enable Refractive Caustics.

 

In the images below you can see the difference when enabling Refractive Caustics.

 

Noise

To reduce noise in the Refractive Caustics, you must increase the number of GI Diffuse Samples

 

The animations below show the difference between rendering Refractive Caustics with three and six GI Diffuse Samples. Be careful when using this attribute as the render times will increase dramatically when you increase this value. 

Diffuse Samples 3 (3 mins 15 secs)
Diffuse Samples 6 (16 mins 55)

 

That's it. You are ready to render. Have a go at rendering some other objects. Things to consider when using this method are:

  1. Fine tuning the right amount of Emission for the geometry that has the Emissive shader assigned to it, otherwise you may encounter a lot of white noise.
  2. Increase the GI Diffuse Samples to reduce the noise further.

 

 

 

 

Many thanks to Peter Shipkov at SOuP Development for providing the Maya scene used in this tutorial.

  • No labels