Go to: Related nodes. Attributes.
Light Info is a utility node that you can use to obtain
information about the position of a light relative to a texture. As
each point on the texture is being shaded, the attributes of the
Light Info node can tell you the precise distance from the light to
the point being shaded. It also returns other information that can
be useful when creating a shading network.
To make this work, you must connect the World Matrix attribute of
the light to the World Matrix attribute of the Light Info node.
Once that is done, the Light Info utility node is ready to use.
This node provides the following information:
- The position of the light in world space
- The direction the light is shining (if it is not a point
light)
- The distance from the light to the point being shaded.
You can use this information as the input to other shading nodes,
to produce interesting effects. For example, you could connect the
Sample Distance attribute to one of the color channels of a shader.
That way, the color of the shader will change depending on how far
it is from the light. Note: You can actually attach the World
Matrix of any object (not just a light) to this node, to get
information about the object's position relative to the point being
shaded. In the table below, important attributes have their names
listed in bold in the description column.
This node is MP safe
Node name |
Parents |
Classification |
MFn type |
Compatible function sets |
lightInfo |
node |
utility/general |
kLightInfo |
kBase
kNamedObject
kDependencyNode
kLightInfo |
Related nodes
blendColors, clamp, gammaCorrect, surfaceLuminance, contrast, luminance, rgbToHsv, hsvToRgb,
samplerInfo, setRange, resolution, renderQuality, renderGlobals, renderGlobalsList, baseShadingSwitch, singleShadingSwitch, doubleShadingSwitch, tripleShadingSwitch
Attributes (16)
lightDirection, lightDirectionOnly, lightDirectionX, lightDirectionY, lightDirectionZ, lightPosition, lightPositionX, lightPositionY, lightPositionZ, matrixEyeToWorld, pointCamera, pointCameraX, pointCameraY, pointCameraZ, sampleDistance, worldMatrix
Long name (short name) |
Type |
Default |
Flags |
|
matrixEyeToWorld
(e2w ) |
fltMatrix |
identity |
|
|
lightDirectionOnly
(ldo ) |
bool |
false |
|
|
worldMatrix
(wm ) |
fltMatrix |
identity |
|
|
pointCamera
(p ) |
float3 |
0.0, 0.0, 0.0 |
|
|
pointCameraX
(px ) |
float |
0.0 |
|
|
|
pointCameraY
(py ) |
float |
0.0 |
|
|
|
pointCameraZ
(pz ) |
float |
0.0 |
|
|
|
lightPosition
(lp ) |
float3 |
0.0, 0.0, 0.0 |
|
|
lightPositionX
(lpx ) |
float |
0.0 |
|
|
|
lightPositionY
(lpy ) |
float |
0.0 |
|
|
|
lightPositionZ
(lpz ) |
float |
0.0 |
|
|
|
lightDirection
(ld ) |
float3 |
0.0, 0.0, 1.0 |
|
|
lightDirectionX
(ldx ) |
float |
0.0 |
|
|
|
lightDirectionY
(ldy ) |
float |
0.0 |
|
|
|
lightDirectionZ
(ldz ) |
float |
0.0 |
|
|
|
sampleDistance
(sd ) |
float |
0.001 |
|