Q100269: How to set up textured Arnold mesh lights in Katana

Follow

SUMMARY

This article explains how to apply a texture to an Arnold mesh light in Katana and includes an example scene illustrating the working setup for reference.

More information on mesh lights can be found in the Arnold for Katana User Guide on Mesh Lights. For a simple example of an Arnold mesh light in Katana, please see this article: Q100268: How to use an object as an Arnold mesh light in Katana.

 

MORE INFORMATION

The example scene provided in the above article is to illustrate the overall setup of using an Arnold mesh light in Katana. The following article expands on that scene set up by showing how a texture can be applied to a light to create textured Arnold mesh lights in Katana.

Please read on for a step by step explanation of how the provided example scene was set up:

window.png

 

The Arnold mesh_light shader that is used in the basic mesh light setup does not accept color maps and is therefore not suitable for creating textured mesh light. If you would like to achieve this, you will need to create a shading network, bake the material out into a Katana Look File, and read this back into GafferThree as the light material. You can do this as follows:

 

Bake a Light Material to a Look File

  1. Create a NetworkMaterialCreate node and enter it (Ctrl+MMB or Ctrl+Enter when it’s selected).

  2. Create an image node and set its filename parameter to the file path of your texture image.


    NOTE:
    It may be helpful to specify an image file with a constant color, for example a plain red image, as a texture at first to easily verify that it is being applied.

  3. Create a mesh_light node and connect the image node’s out port to the Common.color port of the mesh_light. Then connect the out port of the mesh_light node to arnoldLight under the OUTPUT of the NetworkMaterial:

    nmc.png

  4. Next, edit the mesh_light and click the wrench icon to the right of the Source.mesh parameter. Then click Add to Material Interface. This exposes the parameter to the Material Interface so we may edit them more easily later on. Other suggested parameters to promote are exposure and samples. The exposure may need to be increased to view the light.

    promote.png

  5. Leave the NetworkMaterialCreate node (Ctrl+Backspace or clicking the “Go To Root” button) and create and connect a LookFileMaterialsOut downstream of the NetworkMaterialCreate.

  6. Edit the LookFileMaterialsOut node and choose a directory in which to save your .klf, such as /tmp/MeshLight.klf, and click ‘Write Look File’ and accept.

 

Load the Light Material Look File in a GafferThree

  1. Use the Look File written above with the mesh light example scene created via article Q100268: How to use an object as an Arnold mesh light in Katana. Edit and view the GafferThree node of the above scene and delete the existing meshLight.

  2. Add a new Arnold Mesh Light and, with it selected, switch to the below Material tab and check useLookFileMaterial parameter.

  3. Set asset to the file path of your Look File that you saved earlier and select the NetworkMaterial’s location in the materialPath dropdown.

    Your exposed parameters will now appear under shaders.parameters, allowing you to specify which mesh you would like to use as a light source as well as modify any other parameters you previously exposed.

  4. Specify the scene graph path to the sphere as the source mesh for the mesh light. A Preview Render from the GafferThree node should now show the inside of the box illuminated per the chosen texture file.

    4.png

NOTE: Using an object as a mesh light doesn’t change the object’s surface shader. You will need to create a separate material that matches the light color and apply it to the surface of the object, as described in step 10 of article Q100268: How to use an object as an Arnold mesh light in Katana.

 

The example scene attached was created in Katana 5.0v4 with KtoA 4.1.3.3 by following the above steps, and can be used as a reference for working with mesh lights in Arnold and Katana. 

We're sorry to hear that

Please tell us why