| On this page |
Light instancing is a convenient way to illuminate a scene with huge amounts of individual lights. Points will determine where the lights appear. This method is interesting for streets, buildings, amusement parks, airports, and any other scenarios that require a large number of lights. It’s also possible to control or randomize properties like intensity or color.
Basic considerations ¶
As always in Houdini, there are several ways to achieve a goal and light instancing is no exception. A typical workflow uses the Copy to Points LOP with at least one prototype light source, for example a point light, an area light, or a geometry light.
You also need a source that creates scatter points. The scatter points determine, where the lights appear in 3D space. Optionally, you can define how they're oriented and scaled. The points also carry attributes for adjusting and randomizing light features like intensities, colors, or parameters that are specific to area lights.
You typically create the scatter points inside a SOP context like the SOP Create LOP. This node will import the points directly to the Solaris stage. Once you have the points you can start to configure the light instances.
Primvars ¶
In Solaris/USD, you have access to several light-specific primvars. You can use attributes on the scatter points to drive these primvars. Here’s a list of the available primvars:
-
intensity (
intensity) -
exposure (
exposure) -
width (
width) -
height (
height) -
color (
color) -
radius (
radius) -
color temperature (
colorTemperature) -
diffuse multiplier (
diffuse) -
specular multiplier (
specular)
Note that width, height and radius are only available with area lights, while the remaining primvars are available for any kind of light source.
Primvar overrides ¶
A convenient way to create overrides that will be picked up by the light instances uses a light: prefix followed by the appropriate primvar, for example light:intensity. You can author primvar overrides directly on the instance points. Let’s say you want to randomize the intensity of an instanced Point Light LOP.
Inside the Copy to Points LOP, add an Attribute Adjust Float SOP. Connect its input with the output of the node with the scatter points.
-
For Attribute Name, enter
encode("light:intensity"). Please don’t forget to enclose the expression inside backticks () to make it work. (The backticks can’t be displayed here for technical reasons.)The
encode()function will create the attribute as written inside the brackets. Without encoding, you'd end up withlight_intensity. The colon-separated notation is important because thelightprefix will be recognized by Solaris and drive the point light’s Intensity parameter. -
From the attribute node’s Pattern Type, choose Random.
-
Now, add arbitrary values to Min Value and Max Value, for example
0and1.
Here’s an image from the stage with point lights with different intensities.
Color override ¶
If you want to override the Color parameter, you can add an Attribute Adjust Color SOP and connect its input with the point source.
-
For Attribute Name, enter
encode(light:color). Again, mind the enclosing backticks! -
From the Pattern Type dropdown, choose Random. You now have access to a Color Ramp.
-
Adjust the ramp to your liking and use the Seed value to change the color distribution of the lights.
Back on the stage you should see the colored lights. Of course, you don’t have to randomize the values and you can stay with the adjust node’s Constant mode or try one of the other Pattern Type options.
Geometry lights ¶
The override method also works with geometry lights, but here you need a Geometry Light LOP.The following example shows a setup without an emissive material: the lights' intensity comes from the Geometry Light LOP. As before, the node’s Color parameter is an overridden by an Attribute Adjust Color SOP inside the Copy to Points LOP.
-
The light geometry can, for example, be a
Cube LOP. Connect it to the Copy to Points SOP’s second input.
-
Lay down a Geometry Light LOP and connect its output with the input of the copy node.
-
From the Scene Graph Tree, drag the light geometry that’s grouped under the
prototypesbranch to the Geometry Light LOP’s Primitive parameter. A typical example with default settings is/copytopoints1/Prototypes/cube1. -
On the Standard tab, make sure that the Material Sync Mode is set to No Material Response. This mode works without an emissive shader on the prototype.
Of course, you can combine color, intensity, and any other available parameter to get a fully randomized array of lights. On the stage, your result could look similar to this image: