On this page |
Previous Geometry
Overview ¶
Lighting in Karma heavily relies on USD’s built-in features related to lights. This chapter describes the basics of USD lighting, and Karma-specific properties.
USD lights ¶
USD supports the following standard light types. Karma may not support all of the following lights, but should provide an alternate approach to mimic their effect.
|
Cylindrical shaped light source. |
|
|
Circle shaped light source. |
|
|
Infinitely distant light source. |
|
|
Omni-directional, environment light source. |
|
|
Meshes or other geometry providing illumination. |
|
|
An infinitely small light source. |
|
|
Geometry provides a portal for dome lights. |
|
|
Rectangular shaped light source |
|
|
Spherical light source. |
Common properties ¶
Lights have various properties to mimic real-world lighting and provide artistic control. Directional lights are aligned to emit light along their local -Z axis by default. All lights can be moved, rotated, and scaled.
Base ¶
Radius
When Type is Cylinder, Disk, or Sphere, the radius of the light.
Length
When Type is Cylinder, the length of the light from end to end.
Geometry
When Type is Geometry, the path to a geometry prim to use as the light shape.
Width
When Type is Rectangle, the width of the light area.
Height
When Type is Rectangle, the height of the light area.
Angle
When Type is Distant, the angular size of the light in degrees.
As an example, the Sun is approximately 0.53 degrees as seen from Earth. Higher values broaden the light and therefore soften shadow edges.
Clipping Range
Don’t show geometry closer than the near distance or farther away than the far distance (in world units).
Exposure
Scales the power output exponentially as a power of 2, similar to an F-stop control. 0
does not scale intensity, negative numbers scale intensity down by the square, positive numbers scale intensity up. Often you will set the Intensity to what looks like the right amount of light, and then use this parameter to “tweak” it.
Intensity
A linear scale on the power output of the light.
Color
The color of the light, in energy-linear terms.
Texture
Maps a texture to the area geometry of lights. This is currently only supported with rectangular lights.
Enable color temperature
Use Color temperature to control the light color. The color calculated by Color temperature is multiplied by the RGB color in Color, so if you want the “pure” temperature color, you should set Color to 1.0, 1.0, 1.0
.
Color temperature
When Enable color temperature is on, the temperature (in degrees Kelvin) to simulate. The valid range is from 1000
to 10000
. Lower values are warmer and higher values are cooler. The default is a common white point, D65.
If necessary, you can compute the same color value using the UsdLuxBlackbodyTemperatureAsRgb()
function from the USD library.
Normalize power
Divides the set power output (intensity scaled by exposure) by the surface area or angular size of the light. This makes it easier to adjust and compare energy output without it being affected by the size of the light.
Diffuse multiplier
Scales the effect this light has on the diffuse response of shaders. This is a non-physical “tweak”.
Specular multiplier
Scales the effect this light has on the specular response of shaders. This is a non-physical “tweak”.
Scale Guide Geometry
Applies a uniform scaling factor the the guide geometry drawn for the light in the viewport. The default value is an expression that inverts the “meters per unit” value of the USD stage to produce a consistent real-world size for the guide geometry.
Shaping ¶
Spotlight
Add the necessary API to the light to turn it into a spotlight.
Angle
The spread angle of the spotlight beam, in degrees.
Softness
Blurs the edges of the spotlight beam, simulating light leakage and bounce.
Left barndoor
Slides in a light blocker from the left, covering part of the spotlight cone. 1.0
reaches all the way across the cone, blocking all light.
Left barndoor edge
Extends the solid light blocker above by an additional soft edge. 1.0
creates a gradient as wide as the spotlight cone.
Right barndoor
Slides in a light blocker from the right, covering part of the spotlight cone. 1.0
reaches all the way across the cone, blocking all light.
Right barndoor edge
Extends the solid light blocker above by an additional soft edge. 1.0
creates a gradient as wide as the spotlight cone.
Top barndoor
Slides in a light blocker from the top, covering part of the spotlight cone. 1.0
reaches all the way across the cone, blocking all light.
Top barndoor edge
Extends the solid light blocker above by an additional soft edge. 1.0
creates a gradient as wide as the spotlight cone.
Bottom barndoor
Slides in a light blocker from the bottom, covering part of the spotlight cone. 1.0
reaches all the way across the cone, blocking all light.
Bottom barndoor edge
Extends the solid light blocker above by an additional soft edge. 1.0
creates a gradient as wide as the spotlight cone.
Focus (checkbox)
Add the necessary API to the light to be able to focus the beam.
Focus
A control to shape the spread of light. Higher focus values pull light towards the center and narrow the spread. (This is implemented as an off-axis cosine power exponent.)
Focus tint
Off-axis color tint, tints the light in the falloff region. The default is black.
IES
Add the necessary API to the light to use an IES file describing angular distribution of light.
File
An IES (Illumination Engineering Society) format file to use to control angular distribution of light.
Angle scale
A global scale on angles found in the IES file.
Shadow ¶
Enable
When this is on, objects hit by this light will cast shadows (subject to shadow masks).
Color
Tints the color of shadows cast by this light. Changing this from black (0, 0, 0
) is a non-physical “tweak”.
Falloff
The near distance at which shadow falloff begins.
The default value (-1) indicates no falloff.
Falloff Gamma
A gamma (i.e., exponential) control over shadow strength with linear distance within the falloff zone (between Falloff and Distance.
Distance
The maximum distance to check for objects shadowing this light. The default is -1
, meaning no limit. Setting this may speed up rendering if you know all objects you want shadowed are within a certain distance.
In addition to these common attributes
Cylinder light ¶
Height |
|
Radius |
|
Transform |
|
DiskLight ¶
Radius |
|
Transform |
|
DistantLight ¶
Angle |
|
Transform |
|
DomeLight ¶
Transform |
|
GeometryLight ¶
Transform |
|
Other |
|
Point Light ¶
Transform |
|
Portals ¶
Transform |
|
Other |
|
RectLight ¶
Width |
|
Height |
|
Transform |
|
SphereLight ¶
Radius |
|
Transform |
|
KarmaSkyDomeLight ¶
Solar Altitude |
|
Solar Azimuth |
|
Turbidity |
|
Transform |
|
Karma Physical Sky ¶
Combination of a KarmaSkyDome and Distant lights and special properties.
See the node helpcard for more details.
Light Tree ¶
Karma automatically builds a light tree to make rendering scenes with many lights more efficient. This helps Karma efficiently decide which lights should be sampled the most, and are most likely to resolve faster. Setting this to Uniform on a light will force it to always be sampled.
Some types of lights, or lights with certain configurations, are never added to the light tree. Dome lights, and lights with IES profiles and light filters are excluded from the light tree.
See Sampling > Light Tree for more details.
Light Properties
Instances ¶
Beginning with Houdini 20.5, the USD library passes instanceable lights through Hydra to Karma. This allows lights to be instanced alongside geometry, and works both with instanceable references and point instancers. Currently Karma allows controlling lights via primvars or light filters setup to read primvars.
By default Karma will match primvars in the light
namespace to corresponding inputs on the instanced lights:
Primvar |
Light Input |
Type |
---|---|---|
|
|
float |
|
|
color3f |
Light filters can also be setup to read primvars, if you wish to use differently named primvars to drive your lights.
LPE tags ¶
Light filters ¶
Light filters can be added to lights to provide artistic modifications to lighting elements. These are created with a Light Filter Library. Karma supports using MaterialX shaders in light filters. The Karma Light Project is essential for these workflows.
|
Controls how the light intensity/color changes over distance. |
|
|
Adds barndoors to a cone light. |
|
|
Adjusts the color, intensity, or diffuse/specular of a light source. |
|
|
Projects the light source through a texture. |
|
|
Provide the depth and UV coordinates of the “current ray” in the light’s projection space |
Warning
-
Lights with light filters applied are not automatically added to the light tree.
-
It is not advised to use light filters on dozens or hundreds of lights in the same scene.
Viewport lighting ¶
By default the viewport reflects the lights found in the scene. If no lights are found, Hydra produces a head light. The head light type can be a distant light along the camera view or dome light. Along the right side of the viewport are buttons to override the scene lights.
-
Available lighting modes change based on the chosen render delegate.
-
Disable Lighting disables all scene lights, in order to visualize emissive shaders. With the Houdini Viewport, it produces an unlit appearance.
-
The automatic dome light is a uniform white color. A map can be applied using the
HOUDINI_DEFAULT_DOMELIGHT_TEXTURE
environment variable.
Karma light properties ¶
Global properties can often be control on a per-light basis. These controls live in the inputs:karma:light:
namespace, and are usually multipliers on their global counterpart. If a property does not specify that it multiplies or scales, then it acts as an override.
Spread ¶
For rectangle lights only, Karma has a special spread
parameter. This can focus an area light projection, to get a sort of “blend” between distant lights and simple area lights.
Next Cameras