LightSource

A light source is a specific Object data type that allows you to control the settings of various, most commonly used real-time lights. Out of the box, a light source object can handle the following type of lights: Ambient, Sun (directional), Lamp (point light) and Spots (directional cone or square light).

Once you have placed them into your scene it is up to you to send which information to your Shader to compute lighting. A common technique to avoid extra lighting computations is to use a Sensor that returns the nearest light sources relative to your main Camera object. Using the Volume information of the Sensor you can quickly determine which light(s) data needs to be send over to your lighting Shader.

See Also

Static Variables


Name Description
object Parent Object where the LightSource data information is stored.
position The position of the LightSource in eye space.
direction The direction vector of the LightSource in eye space.

Variables


Name Description
distance The maximum distance the light rays can reach.
intensity Controls the intensity of the LightSource.
falloff_angle Angle in degree describing the field of view of the spot light.
falloff_exponent Blending factor to apply on the spot which basically control the softness of the light emitted by the spot.
falloff_clamp Determine whether or not the attenuation should be clamped based on the distance parameter of the active light source.
constant_attenuation Constant attenuation factor.
linear_attenuation Linear attenuation factor.
quadratic_attenuation Quadratic attenuation factor.
light_type Active LightType used by the LightSource.
falloff The current FalloffType the current LightSource is using.
color The color of the LightSource which can be either set in LDR or HDR.
square Controls wether a not a spot light should be round or square.
square_size The size of the square spot light on the X and Y axis.

Functions


Name Description
SetSphericalHarmonics Create and append a new RenderLayer to the active Scene.
GetSphericalHarmonics Retrieve a single vector assigned to a specific component index.

LightType


Commonly used light type for real-time.

  • kWorld: Ambient light.
  • kSun: Uni-directional light source.
  • kLamp: Omnidirectional light source.
  • kSpot: Cone of light pointing at a specific direction.

FalloffType


Most common falloff attenuation models used to control how the light intensity decay with distance.

  • kNoAttenuation: Does not attenuate with distance.
  • kInverseLinear: Attenuates the intensity linearly, scaled by the distance value.
  • kInverseSquare: Attenuates the intensity according to inverse square law, scaled by the distance value.
  • kLinearQuadratic: Linear quadratic light source attenuation equation.
  • kQuadratic: Quadratic light source attenuation.




NRG - API 2022.3.383570 - Thu Jul 28 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA