Page tree

Contents

Creating Mesh Lights

Mesh Lights in RenderMan are created with a PxrMeshLight.  Any piece of geometry can be used as a mesh light (also referred to as a "geometric area light"). The two main workflows for creating mesh lights in RfK are described below. 

Method 1: PxrMeshLight GafferThree Package

Creating mesh lights is simple with this method. First, select the geometry that you wish to turn into a mesh light in the Scenegraph. Then in GafferThree, add a PxrMeshLight.


The Mesh Light Geometry parameter can also reference a node with a Scene Graph location. Node Graph references will automatically update the parameter if the geometry's name or location changes.

 

Method 2: The geometry.areaLightGeometrySource Attribute

Mesh light geometry needs to be attached to the light using a specific attribute that RfK looks for when processing the lights. That attribute is named "geometry.areaLightGeometrySource". The attribute is a string attribute on the light and it's value should be the geometry location. For convenience, the PrmanMeshLightCreate macro, a part of the RfK distribution, demonstrates this set up.

Method 3: Assign a PxrMeshLight Material

You may assign a PxrMeshLight material to an object to create a mesh light. However, you will not be able to take advantage of light linking and light filter options.

Instancing Mesh Lights

If you have created your mesh light with Method 1 or 2 described above, the scene will have two locations associated with a single mesh light.  So which location do you instance?  It will always be the geometry location.

If you are using hierachical instancing or instance arrays, make sure that the mesh light is below the instance source location so that RfK will maintain the material properties and light filters associated with the light location.

Mesh lights can also be used in light arrays.  In this case, RfK uses the material from the light array location rather than the material on the geometry location.


Additional Notes

The geometry can be rendered with or without a Bxdf. RfK assigns PxrBlack to mesh lights if no other Bxdf is assigned (does not apply to Method 3). If a Bxdf is assigned to the geometry then the geometry will be rendered according to the characteristics of that shader.

It is recommended that you increase the micropolygonlength on the mesh light for improved performance. This attribute is available on the PxrMeshLight GafferThree package in the Object Tab.

If you want to use the Texture Color parameter of PxrMeshLight, you can create a shading network with PrmanShadingNodes and a NetworkMaterial node.  Then assign the NetworkMaterial to the light location with a MaterialAssign node, downstream of the GafferThree where the light was created.