IMoonLightShape

Functions

CID

GetClassID

RED_RC

GetMoon

RED_RC

SetSamplesCount

RED_RC

GetSamplesCount

Detailed Description

class IMoonLightShape : public RED::IREDObject

This interface gives access to the moon light settings.

@related Light Shapes, Outdoor Lighting, class RED::IShape

The RED::IMoonLightShape interface is exposed by the CID_REDLightShape instances.

This light simulates a moon based on a sky model definition. It’s set-up through the RED::ISkyLightShape interface by calling RED::ISkyLightShape::SetMoonLight. You can get the correct moon’s position as seen from earth according to time, date and location by using the RED::ISkyLightShape::ComputeMoonDirection method.

To get a full sky simulation (i.e including light scattered by the atmosphere), don’t forget to add a RED::ISkyLightShape instance to your scene.

The sun light is handled separately using the RED::ISunLightShape and RED::ISkyLightShape interfaces.

\task tk_setup_a_physical_moon_light

Public Functions

virtual RED_RC GetMoon(RED::Vector3 &oMoonDir, double &oMoonScale, double &oMoonMult, int iStateNumber = -1) const = 0

Gets parameters of a physical moon.

See RED::ISkyLightShape::SetMoonLight for all the details about the parameters returned by this method.

Parameters
  • oMoonDir – unit direction from the ground to the moon.

  • oMoonScale – Moon size scaling factor.

  • oMoonMult – Moon intensity multiplier.

  • iStateNumber – Queried state number.

Returns

RED_OK if the operation has succeeded,

RED_BAD_PARAM if the method has received invalid parameters,

RED_ALLOC_FAILURE if an internal allocation has failed,

RED_WORKFLOW_ERROR if a transaction error has occurred,

RED_FAIL otherwise.

virtual RED_RC SetSamplesCount(unsigned int iSamplesCount, const RED::State &iState) = 0

Sets the number of samples to be taken during moon evaluation.

Lights are sampled during the rendering phase in each shaded point to estimate their contribution to the scene. The more the samples, the better the result and the longer the rendering times.

Lights can’t have less than 1 sample. If 0 is supplied, 1 will be used instead.

A moon light is a very small source as seen from the ground and few samples are needed for a good result.

Parameters
  • iSamplesCount – maximum number of samples to be taken while evaluating the moon light contribution.

  • iState – current transaction.

Returns

RED_OK if the operation has succeeded,

RED_BAD_PARAM if the method has received invalid parameters,

RED_ALLOC_FAILURE if an internal allocation has failed,

RED_WORKFLOW_ERROR if a transaction error has occurred,

RED_FAIL otherwise.

virtual RED_RC GetSamplesCount(unsigned int &oSamplesCount, int iStateNumber = -1) const = 0

Gets the number of moon samples.

See RED::IMoonLightShape::SetSamplesCount for details.

Parameters
  • oSamplesCount – the maximum number of moon light samples.

  • iStateNumber – queried state number.

Returns

RED_OK if the operation has succeeded,

RED_BAD_PARAM if the method has received invalid parameters,

RED_ALLOC_FAILURE if an internal allocation has failed,

RED_WORKFLOW_ERROR if a transaction error has occurred,

RED_FAIL otherwise.

Public Static Functions

static inline RED::CID GetClassID()