ILight

Functions

SET_CID

LIGHT_TYPE

GetType

float

GetSpotAngle

RED_RC

SetSpotAngle

float

GetSpotFalloff

RED_RC

SetSpotFalloff

Object *

GetSpotTexture

int

GetSpotTextureSize

float

GetEffectDistance

void

GetAreaSize

float

GetSphereRadius

const Color &

GetDiffuse

RED_RC

SetDiffuse

const Color &

GetPhysicalColor

void

SetPhysicalColor

float

GetLuminousFlux

RED_RC

SetLuminousFlux

LIGHT_BAKING

GetBaking

void

SetBaking

bool

IsSharedBaking

void

SetSharedBaking

bool

IsActive

RED_RC

SetActive

LIGHT_SHADOW

GetShadowType

void

SetShadowType

int

GetShadowMapSize

void

SetShadowMapSize

int

GetShadowMapBlur

void

SetShadowMapBlur

double

GetShadowBias

void

SetShadowBias

Object *

GetStaticShadowMap

RED_RC

GetStaticShadowMatrix

RED_RC

SetStaticShadowMap

bool

IsEmitterVisible

void

SetEmitterVisible

RED_RC

SetMatrix

RED_RC

GetMatrix

bool

HasIES

double

GetIESAngle

RED_RC

SetIESStretch

bool

GetIESStretch

int

GetInstancesCount

Detailed Description

class ILight : public RED::IREDObject

Light interface for light manipulation.

Public Functions

SET_CID(CID_class_ARTILight)
virtual ART::LIGHT_TYPE GetType() const = 0

Gets the type of the light.

Returns

the type of the light.

virtual float GetSpotAngle() const = 0

Gets the light spot angle.

Returns

the spot angle.

virtual RED_RC SetSpotAngle(float iAngle) = 0

Sets the light spot angle.

Parameters

iAngle – : the new spot angle.

Returns

RED_OK if the operation has succeeded,

Other RED_RCs from the REDsdk API.

virtual float GetSpotFalloff() const = 0

Gets the light spot falloff.

Returns

the spot falloff.

virtual RED_RC SetSpotFalloff(float iFalloff) = 0

Sets the light spot falloff.

Parameters

iFalloff – the new spot falloff.

Returns

RED_OK if the operation has succeeded,

Other RED_RCs from the REDsdk API.

virtual RED::Object *GetSpotTexture() const = 0

Gets the spot texture.

Returns

The spot texture as RED::IImage2D.

virtual int GetSpotTextureSize() const = 0

Returns the spot texture resolution.

Returns

The spot texture size.

virtual float GetEffectDistance() const = 0

Gets the light effect distance.

Returns

the effect distance.

virtual void GetAreaSize(float &oWidth, float &oHeight) const = 0

Gets the light size in the case of an area.

Parameters
  • oWidth – width of the area.

  • oHeight – height of the area.

virtual float GetSphereRadius() const = 0

Gets the light radius in case of a spherical.

Returns

the sphere emitter radius.

virtual const RED::Color &GetDiffuse() const = 0

Gets the light diffuse color.

Returns

the diffuse color.

virtual RED_RC SetDiffuse(const RED::Color &iDiffuse) = 0

Sets the light diffuse color.

If the light is a physical light, the methods ART::ILight::SetPhysicalColor and ART::ILight::SetLuminousFlux should be prefered instead of ART::ILight::SetDiffuse. It ensures the physical correctness of the light.

Parameters

iDiffuse – the light diffuse color.

virtual const RED::Color &GetPhysicalColor() const = 0

Gets the light physical color.

Returns

the physical color.

virtual void SetPhysicalColor(const RED::Color &iColor) = 0

Sets the light physical color.

If the light is a physical light, the methods ART::ILight::SetPhysicalColor and ART::ILight::SetLuminousFlux should be prefered instead of ART::ILight::SetDiffuse. It ensures the physical correctness of the light.

Parameters

iColor – the light physical color.

virtual float GetLuminousFlux() const = 0

Gets the light luminous flux.

Returns

the luminous flux in lumens.

virtual RED_RC SetLuminousFlux(float iLuminousFlux) = 0

Sets the light luminous flux in lumens.

If the light is a physical light, the methods ART::ILight::SetPhysicalColor and ART::ILight::SetLuminousFlux should be prefered instead of ART::ILight::SetDiffuse. It ensures the physical correctness of the light.

Parameters

iLuminousFlux – the light luminous flux.

Returns

RED_OK if the operation has succeeded,

Other RED_RCs from the REDsdk API.

virtual ART::LIGHT_BAKING GetBaking() const = 0

Gets the light baking mode.

Returns

the light baking mode.

virtual void SetBaking(ART::LIGHT_BAKING iBaking) = 0

Sets the light baking mode.

Parameters

iBaking – the light baking mode.

virtual bool IsSharedBaking() const = 0
Returns

true if the light uses a shared GI cache with all other similar lights for its GI.

virtual void SetSharedBaking(bool iShared) = 0

Sets whether the light will own a proprietary GI cache for its baking or not.

Parameters

iShared – true to share the GI cache, false to keep a proprietary cache.

virtual bool IsActive() const = 0

Tells if the light is active.

Returns

true if the light is active, false otherwise.

virtual RED_RC SetActive(bool iActive) = 0

Sets the light active.

Parameters

iActive – true to set the light active, false to inactivate it.

Returns

RED_OK if the operation has succeeded,

Other RED_RCs from the REDsdk API.

virtual ART::LIGHT_SHADOW GetShadowType() const = 0

Gets the shadow map type.

Returns

The shadow map type.

virtual void SetShadowType(ART::LIGHT_SHADOW iShadowType) = 0

Sets the shadow map type.

Parameters

iShadowType – type of the shadows.

virtual int GetShadowMapSize() const = 0

Returns the shadow map resolution.

Returns

The shadow map size.

virtual void SetShadowMapSize(int iShadowMapSize) = 0

Sets the shadow map size.

Parameters

iShadowMapSize – size of the shadow map in pixels.

virtual int GetShadowMapBlur() const = 0

Returns the shadow map blur kernel size in pixels.

Returns

The shadow map blur.

virtual void SetShadowMapBlur(int iShadowMapBlur) = 0

Sets the shadow map blur kernel size in pixels.

Parameters

iShadowMapBlur – size of the shadow map blur kernel in pixels between 1 and 20.

virtual double GetShadowBias() const = 0

Returns the shadow bias.

Returns

The shadow bias.

virtual void SetShadowBias(double iShadowBias) = 0

Sets the shadow bias.

Parameters

iShadowBias – shadow bias.

virtual RED::Object *GetStaticShadowMap(int iInstance = 0) const = 0

Gets the static shadow map of the given light instance.

Parameters

iInstance – optional light instance to query.

Returns

The static shadow map as RED::IImage2D or NULL.

virtual RED_RC GetStaticShadowMatrix(RED::Matrix &oMatrix, const RED::Matrix &iOrigin, int iInstance = 0, ART::SIDE iSide = ART::S_FRONT) const = 0

Computes the static shadow matrix of the given light instance.

Parameters
  • oMatrix – returned shadow matrix.

  • iOrigin – floating origin.

  • iInstance – optional light instance.

  • iSide – optional side for point light shadows.

Returns

the shadow map matrix.

virtual RED_RC SetStaticShadowMap(RED::Object *iShadowMap, int iInstance = 0) = 0

Sets the shadow map static.

Parameters
  • iShadowMap – static shadow map as RED::IImage2D.

  • iInstance – optional light instance to set.

Returns

RED_OK if the method has succeeded,

RED_BAD_PARAM if iShadowMap is not a valid

RED::IImage2D

or if iInstance does not exist,

RED_FAIL otherwise.

virtual bool IsEmitterVisible() const = 0

Tests if the light emitter is visible.

Returns

True if the emitter is visible.

virtual void SetEmitterVisible(bool iVisible) = 0

Sets the light emitter shape visible.

Parameters

iVisible – true to show the emitter, false to hide it.

virtual RED_RC SetMatrix(const RED::Matrix &iMatrix, int iInstance = -1) = 0

Sets the lights transform.

If the light has a parent body, its transform will be relative to it. Otherwise its transform will be relative to the world coordinates system.

If iInstance is -1 (default), the matrix is applied to the first instance and all the other instances are moved keeping their position relative to the first. Otherwise, only the instance number iInstance is moved.

Parameters
  • iMatrix – The transform matrix.

  • iInstance – optional light instance to set.

Returns

RED_OK if the method has succeeded,

RED_FAIL otherwise.

virtual RED_RC GetMatrix(RED::Matrix &oTransform, int iInstance = 0) const = 0

Gets the lights transform.

Parameters
  • oTransform – returned reference to the transform matrix.

  • iInstance – optional light instance to query.

Returns

RED_OK if the method has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_FAIL otherwise.

virtual bool HasIES() const = 0

Tests if the light has IES data.

Returns

true if the light has IES data, false otherwise.

virtual double GetIESAngle() const = 0

Gets the IES spot angle.

Returns

the IES spot angle.

virtual RED_RC SetIESStretch(bool iStretch) = 0

Sets the IES stretched or clamped at the spot angle.

Parameters

iStretch – true to stretch the IES, false to clamp it.

Returns

RED_OK if the method has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_FAIL otherwise.

virtual bool GetIESStretch() const = 0

Gets the IES stretch.

Returns

true if the IES is stretched, false if it is clamped.

virtual int GetInstancesCount() const = 0

Gets the number of light instances.

Returns

the number of light instances.