ICloudsVolumeShape

Functions

CID

GetClassID

RED_RC

SetMultipleScatteringFactor

RED_RC

GetMultipleScatteringFactor

RED_RC

SetAlbedo

RED_RC

GetAlbedo

RED_RC

SetAmbientLighting

RED_RC

GetAmbientLighting

Detailed Description

class ICloudsVolumeShape : public RED::IREDObject

Main interface of the clouds volume shape, that display clouds volumetric shapes in a scene.

@related Rendering Volumetric Clouds, class RED::IVolumeShape, class RED::VolumetricEffectClouds

The CID_REDCloudsVolumeShape is the object to create to instantiate all clouds volumetric effects in a scene. One volume shape instance is needed for an entire scene graph. The volume shape instance internally setups its own material. Therefore, the material of a volume shape should not be overriden.

The material of the shape will evaluate all the volumetric effects declared through this interface to compute the resulting color influence of all volumetric effects declared in the class.

In software rendering, the volume shape has no effective presence in a scene in the sense that no geometry is being associated to it. However, it gets shaded thanks to the shape material. For every ray propagated in the scene, the volume shape is evaluated and its influence over the lighting and shadowing is taken into consideration.

In hardware rendering, volume shapes are ignored for now.

The volume shape has no bounding sphere. If a bounding sphere is set on a volume shape, it’s ignored.

The volume shape is a state sensitive object.

If more than one volume shape is found in a scene graph, the last shape found during the scene graph parsing will be considered and other shapes will be ignored.

Public Functions

virtual RED_RC SetMultipleScatteringFactor(double iFactor, const RED::State &iState) = 0

Sets the multiple scattering factor.

The multiple scattering factor allows to simulate multiple light scattering events in the clouds volume shape. A factor of 1 is equivalent to single scattering: only the direct lighting is used. Increasing this factor increases the lighting due to multiple scattering events.

Parameters
  • iFactor – Multiple scattering factor.

  • iState – Current transaction parameter.

Returns

RED_OK if the method has succeeded,

RED_FAIL otherwise.

virtual RED_RC GetMultipleScatteringFactor(double &oFactor, int iStateNumber = -1) const = 0

Gets the multiple scattering factor.

See RED::ICloudsVolumeShape::SetMultipleScatteringFactor for details.

Parameters
  • oFactor – Returned multiple scattering factor.

  • iStateNumber – Queried state number.

Returns

RED_OK if the method has succeeded,

RED_FAIL otherwise.

virtual RED_RC SetAlbedo(const RED::Color &iAlbedo, const RED::State &iState) = 0

Sets the albedo.

The albedo is the amount of sun light reaching the ground which is reflected back to the clouds per RGB color component (in [0, 1]^3). A default value of 0.3 per component is good.

An albedo value of 1 means the sun light reaching the ground is completely reflected to the bottom of the clouds.

Parameters
  • iAlbedo – Albedo value.

  • iState – Current transaction parameter.

Returns

RED_OK if the method has succeeded,

RED_FAIL otherwise.

virtual RED_RC GetAlbedo(RED::Color &oAlbedo, int iStateNumber = -1) const = 0

Gets the albedo value.

See RED::ICloudsVolumeShape::SetAlbedo for details.

Parameters
  • oAlbedo – Returned albedo.

  • iStateNumber – Queried state number.

Returns

RED_OK if the method has succeeded,

RED_FAIL otherwise.

virtual RED_RC SetAmbientLighting(const RED::Color &iAmbientTop, const RED::Color &iAmbientBottom, const RED::State &iState) = 0

Sets the ambient lighting reaching the top and bottom of the clouds.

Ambient lighting values bring lighting to top and bottom of the clouds layer.

There are several reasons to add ambient lighting in the clouds. Sometimes, we don’t want to set a sky light to enhance the rendering time. This parameter will simulate the sky light. Sometimes, we just want to add some light to the clouds for artistic reasons.

Parameters
  • iAmbientTop – Ambient lighting coming from top of the clouds.

  • iAmbientBottom – Ambient lighting coming from bottom of the clouds.

  • iState – Current transaction parameter.

Returns

RED_OK if the method has succeeded,

RED_FAIL otherwise.

virtual RED_RC GetAmbientLighting(RED::Color &oAmbientTop, RED::Color &oAmbientBottom, int iStateNumber = -1) const = 0

Gets the ambient lighting values.

See RED::ICloudsVolumeShape::SetAmbientLighting for details.

Parameters
  • oAmbientTop – Returned ambient lighting coming from top of the clouds.

  • oAmbientBottom – Returned ambient lighting coming from bottom of the clouds.

  • iStateNumber – Queried state number.

Returns

RED_OK if the method has succeeded,

RED_FAIL otherwise.

Public Static Functions

static inline RED::CID GetClassID()