Cinema 4D Visualize, Broadcast, Studio Thinking Particles Nodes TP Condition Group PLight
Function available in CINEMA 4D Studio
PLight

Basic Parameter

Parameter

Light

To choose which light the node will test, Drag & drop the light’s name into this box.

Threshold [-∞..+∞]

With the help of this value, you can use the PLight node to control actions based on the brightness of a light source at a particular position in 3D space (defined by the Position values).

The node outputs a Boole value of either True or False depending on whether the light’s intensity exceeds the Threshold value at this position in 3D space. The node’s On port outputs the value False if the light’s brightness is less than or the same as the Threshold, or True if it exceeds the Threshold. A Threshold of 1 equals a light intensity of 100%.

For example, suppose you want a PStorm node to emit particles only when a light’s intensity exceeds 50% at the world coordinates 200,10,-50. In this case, you would create a PLight node, Drag & drop the name of the light into the Light box, set the Position values to 200,10,-50 and the Threshold value to 0.5 (0.5 x 100 = 50%). You would then connect the PLight node to the PStorm node via their On ports.

Color On

If you want to control actions based on the color of a light source at a particular position in 3D space (defined by the Position values), enable Color and set Threshold to 0 (if you don’t set the Threshold to 0, the light’s brightness will be evaluated also).

The node will output a Boole value of True or False depending on whether the light’s color is the same as (or similar to, depending on the Color Variation setting) the color defined by the Color setting at this position in 3D space. The node’s On port outputs True if the two colors are the same/similar, otherwise it gives the value False.

Color

If you want to control actions based on a light’s color and brightness, in addition set the Threshold value to the desired brightness. See Threshold, above. The node’s On port will then only output the value True if the light’s brightness exceeds the Threshold value and the light’s color is the same/similar color as the Color setting.

Color Variation [0..100%]

The Color Variation setting defines how similar — defined as a percentage — the light’s color and the Color setting must be in order to produce a True value. For example, with a value of 0%, the colors must match exactly in order to produce an output of True, while a value of 100% means the colors will match regardless.

Here we use a PLight node in such a way that when the color of its associated light object reaches more than 90% red the Cube is made visible in the viewport. There are many other, rather more useful, ways of using PLight.

Position [XYZ ]

This value defines position at which the light’s value(s) should be checked.

Normal

A normal is a directional vector with a length of 1, which is often used to help calculate the shading of a polygon surface. A normal can be passed to this port in order to influence the light intensity at a given position.

If no vector is present, a normal that points towards the light source will be generated automatically. The light will thus fall orthogonally (at right-angles) onto the virtual surface and will therefore be at its maximum brightness.

Keep in mind that a normal pointing towards the light rays themselves, rather than at the light object, will cause the light to shine onto the backface of a surface. Thus an intensity of 0 may result, even if the light illuminates the exact given position.

Additional input ports:

Animation Time

Since the node’s parameters can be keyframe animated, by default the Cinema 4D time is used internally to ensure that the values are interpolated correctly. However, you can pass your own time value to this port. This should be of the data type Time, which is a Real number in the simplest case. If no value is passed, Cinema 4D’s time is used.

On

Outputs a Boole value of either True or False depending on the light’s brightness and/or color at a particular position in 3D space (defined by the Position values). See Threshold and Color On, Color, Color Variation above.

Intensity [-∞..+∞]

Outputs the brightness of the light as a Float value at the position defined by the Position values. An Intensity value of 0 represents 0% brightness, a value of 1 represents 100% brightness.

Color

Outputs the RGB color of the light at the position defined by the Position values.

Direction

Outputs the directional vector between the light’s position and the position defined by the Position values. This vector can also be calculated manually by subtracting the light’s position from the Position values.