class RED::VolumetricEffectBoxVolume

This class defines box volume volumetric effects in a scene. More...

#include <REDVolumetricEffectBoxVolume.h>

Inherits: VolumetricEffect.

Public functions:

VolumetricEffectBoxVolume ( )
virtual ~VolumetricEffectBoxVolume ( )
virtual void *As ( const RED::CID & iCID )
virtual const void *As ( const RED::CID & iCID ) const
template< class T_As > const T_As *As ( ) const
template< class T_As > T_As *As ( )
voidGetBox ( double oMin[3], double oMax[3] ) const
virtual doubleGetDensity ( const double iPosition[3] ) const
virtual voidGetEmission ( double oEmission[3], const double iPosition[3] ) const
virtual voidGetPhase ( double oPhase[3], const double iPosition[3], const double iDirection1[3], const double iDirection2[3] ) const
virtual voidGetSigmaA ( double oSigmaA[3], const double iPosition[3] ) const
virtual voidGetSigmaSIn ( double oSigmaS[3], const double iPosition[3] ) const
virtual voidGetSigmaSOut ( double oSigmaS[3], const double iPosition[3] ) const
virtual RED_RCGetVolumeIntervals ( RED::Vector< double > & oIntervals, const double iE[3], const double iP[3], const RED::ISoftRenderingContext & iRenderCtx ) const
IMPLEMENT_CHUNKINTERPRETER ( )
virtual boolIsHomogeneous ( ) const
virtual RED_RCSave ( RED::IStream * iStream, RED::StreamingPolicy & iPolicy, int iState = -1 ) const
voidSetBox ( const RED::Vector3 & iMin, const RED::Vector3 & iMax )
voidSetBox ( const double iMin[3], const double iMax[3] )
voidSetEmission ( const RED::Vector3 & iEmission )
voidSetEmission ( const double iEmission[3] )
voidSetSigmaA ( const RED::Vector3 & iSigmaA )
voidSetSigmaA ( const double iSigmaA[3] )
voidSetSigmaS ( const RED::Vector3 & iSigmaS )
voidSetSigmaS ( const double iSigmaS[3] )
voidSetSigmaSIn ( const RED::Vector3 & iSigmaS )
voidSetSigmaSIn ( const double iSigmaS[3] )
voidSetSigmaSOut ( const RED::Vector3 & iSigmaS )
voidSetSigmaSOut ( const double iSigmaS[3] )

Public static functions:

static RED::CIDGetClassID ( )

Protected variables:

double_box_max [3]
double_box_min [3]
double_emission [3]
double_sigma_a [3]
double_sigma_s_in [3]
double_sigma_s_out [3]

Detailed description:

This class defines box volume volumetric effects in a scene.

Stores all the parameters defining a box volumetric effect. See RED::VolumetricEffect for all the parameters details.

Using this volumetric effect creates an homogeneous medium contained inside an axis aligned box in the scene.

By default, this class defines the following medium properties:

By default, the box is of size 1 and is centered on the scene origin.

In order to see the volumetric effect inside the scene, make sure the correct sigma coefficients are set with RED::VolumetricEffectBoxVolume::SetSigmaA, RED::VolumetricEffectBoxVolume::SetSigmaSIn and RED::VolumetricEffectBoxVolume::SetSigmaSOut.

To activate the rendering of volumetric effects in a scene, the RED::OPTIONS_RAY_VOLUME option must be set to 1 at least.

Functions documentation

Construction method.

This volumetric effect implements the box volume.

Destruction method.

public virtual void * RED::VolumetricEffectBoxVolume::As(const RED::CID &iCID)

Converts the object to an instance of the given type.

Parameters:

iCID:Requested class.

Returns:

An object pointer of the given class on success, NULL otherwise.

Reimplements: RED::VolumetricEffect::As.

public virtual const void * RED::VolumetricEffectBoxVolume::As(const RED::CID &iCID) const

Converts the object to an instance of the given type.

Parameters:

iCID:Requested class.

Returns:

An object pointer of the given class on success, NULL otherwise.

Reimplements: RED::VolumetricEffect::As.

template< class T_As > public const T_As * RED::VolumetricEffectBoxVolume::As() const

Template version of the as const method.

Simply set T to be the class you want to retrieve an interface to.

Returns:

A pointer to a const instance of class T on success, NULL otherwise.

Reimplements: RED::VolumetricEffect::As.

template< class T_As > public T_As * RED::VolumetricEffectBoxVolume::As()

Template version of the as method.

Simply set T to be the class you want to retrieve an interface to.

Returns:

A pointer to an instance of class T on success, NULL otherwise.

Reimplements: RED::VolumetricEffect::As.

public void RED::VolumetricEffectBoxVolume::GetBox(doubleoMin[3],
doubleoMax[3]
)const

Gets the box defining the volume.

Parameters:

oMin:minimum box point.
oMax:maximum box point.
public virtual double RED::VolumetricEffectBoxVolume::GetDensity(const doubleiPosition[3]) const

Returns the volume density at a given position.

See RED::VolumetricEffect::GetDensity to have details about the density.

Parameters:

iPosition:position in the volume.

Returns:

the volume density at a given position in the volume.

Implements: RED::VolumetricEffect::GetDensity.

public virtual void RED::VolumetricEffectBoxVolume::GetEmission(doubleoEmission[3],
const doubleiPosition[3]
)const

Returns the emission coefficient at a given position.

Emission is the property of the medium to emit light.

This coefficient can take any value greater than 0 and don't have an upper limit. It can be different for each color channel.

Parameters:

oEmission:returned emission coefficient at the volume position.
iPosition:position in the volume.

Implements: RED::VolumetricEffect::GetEmission.

public virtual void RED::VolumetricEffectBoxVolume::GetPhase(doubleoPhase[3],
const doubleiPosition[3],
const doubleiDirection1[3],
const doubleiDirection2[3]
)const

Returns the phase at a given position.

See RED::VolumetricEffect::GetPhase to have details about the phase.

Parameters:

oPhase:returned phase value at the given position.
iPosition:position in the volume.
iDirection1:first direction.
iDirection2:second direction.

Implements: RED::VolumetricEffect::GetPhase.

public virtual void RED::VolumetricEffectBoxVolume::GetSigmaA(doubleoSigmaA[3],
const doubleiPosition[3]
)const

Returns the absorption coefficient at a given position.

See RED::VolumetricEffect::GetSigmaA to have details about this coefficient.

Parameters:

oSigmaA:returned absorption coefficient at the volume position.
iPosition:position in the volume.

Implements: RED::VolumetricEffect::GetSigmaA.

public virtual void RED::VolumetricEffectBoxVolume::GetSigmaSIn(doubleoSigmaS[3],
const doubleiPosition[3]
)const

Returns the scattering coefficient at a given position.

See RED::VolumetricEffect::GetSigmaSIn to have details about this coefficient.

Parameters:

oSigmaS:returned scattering coefficient at the volume position.
iPosition:position in the volume.

Implements: RED::VolumetricEffect::GetSigmaSIn.

public virtual void RED::VolumetricEffectBoxVolume::GetSigmaSOut(doubleoSigmaS[3],
const doubleiPosition[3]
)const

Returns the scattering coefficient at a given position.

See RED::VolumetricEffect::GetSigmaSOut to have details about this coefficient.

Parameters:

oSigmaS:returned scattering coefficient at the volume position.
iPosition:position in the volume.

Implements: RED::VolumetricEffect::GetSigmaSOut.

public virtual RED_RC RED::VolumetricEffectBoxVolume::GetVolumeIntervals(RED::Vector< double > &oIntervals,
const doubleiE[3],
const doubleiP[3],
const RED::ISoftRenderingContext &iRenderCtx
)const

Returns the intervals of a ray intersecting the volume.

Given a ray, this method returns the parametric intervals along this ray where it intersects the volume.

The returned intervals are contained in a RED::Vector as a series of in and out parametric distances from the ray starting point: [in_1, out_1, in_2, out_2, ..., in_n, out_n]. Therefore, the returned array is always of size 2n.

The returned intervals do not intersect each other and are not sorted in any way.

The method clears the intervals RED:Vector before filling it.

Parameters:

oIntervals:returned intervals.
iE:ray starting point.
iP:ray end point.
iRenderCtx:Rendering context.

Returns:

RED_OK if the operation has succeded.
RED_FAIL otherwise.

Implements: RED::VolumetricEffect::GetVolumeIntervals.

Indicates if the medium is homogeneous.

This method returns true is the medium has the same properties (sigma, density and phase function) for all positions inside its volume.

Returns:

True if the medium is homogeneous.

Implements: RED::VolumetricEffect::IsHomogeneous.

public virtual RED_RC RED::VolumetricEffectBoxVolume::Save(RED::IStream *iStream,
RED::StreamingPolicy &iPolicy,
intiState = -1
)const

Saves the object content as one or more chunks in the given stream.

Parameters:

iStream:Pointer to the stream where the data must be saved.
iPolicy:Reference to the streaming policy to be used.
iState:Optional state number parameter at which the data to be saved must be retrieved. Default is set to 0 (for current state).

Returns:

RED_OK on success,
RED_FILE_WRITE_ERROR on a file write error (if iStream is a file stream),
RED_ALLOC_FAILURE on a memory allocation error,
RED_FAIL otherwise.

Implements: RED::IChunkSaver::Save.

Sets the box defining the volume.

Parameters:

iMin:minimum box point.
iMax:maximum box point.
public void RED::VolumetricEffectBoxVolume::SetBox(const doubleiMin[3],
const doubleiMax[3]
)

Sets the box defining the volume.

Parameters:

iMin:minimum box point.
iMax:maximum box point.

Sets the emission coefficient.

This function set the emission coefficient. See RED::VolumetricEffect::GetEmission to have details about this coefficient.

Parameters:

iEmission:emission coefficient.
public void RED::VolumetricEffectBoxVolume::SetEmission(const doubleiEmission[3])

Sets the emission coefficient.

This function set the emission coefficient. See RED::VolumetricEffect::GetEmission to have details about this coefficient.

Parameters:

iEmission:emission coefficient.

Sets the absorption coefficient.

See RED::VolumetricEffect::GetSigmaA to have details about this coefficient.

Parameters:

iSigmaA:absorption coefficient.
public void RED::VolumetricEffectBoxVolume::SetSigmaA(const doubleiSigmaA[3])

Sets the absorption coefficient.

See RED::VolumetricEffect::GetSigmaA to have details about this coefficient.

Parameters:

iSigmaA:absorption coefficient.

Sets the scattering coefficients.

This function set the in-scattering and out-scattering coefficients. Both coefficients are set to iSigmaS. See RED::VolumetricEffect::GetSigmaSIn and RED::VolumetricEffect::GetSigmaSOut to have details about these coefficients.

Parameters:

iSigmaS:scattering coefficient.
public void RED::VolumetricEffectBoxVolume::SetSigmaS(const doubleiSigmaS[3])

Sets the scattering coefficients.

This function set the in-scattering and out-scattering coefficients. Both coefficients are set to iSigmaS. See RED::VolumetricEffect::GetSigmaSIn and RED::VolumetricEffect::GetSigmaSOut to have details about these coefficients.

Parameters:

iSigmaS:scattering coefficient.

Sets the scattering coefficient.

See RED::VolumetricEffect::GetSigmaSIn to have details about this coefficient.

Parameters:

iSigmaS:scattering coefficient.
public void RED::VolumetricEffectBoxVolume::SetSigmaSIn(const doubleiSigmaS[3])

Sets the scattering coefficient.

See RED::VolumetricEffect::GetSigmaSIn to have details about this coefficient.

Parameters:

iSigmaS:scattering coefficient.

Sets the scattering coefficient.

See RED::VolumetricEffect::GetSigmaSOut to have details about this coefficient.

Parameters:

iSigmaS:scattering coefficient.
public void RED::VolumetricEffectBoxVolume::SetSigmaSOut(const doubleiSigmaS[3])

Sets the scattering coefficient.

See RED::VolumetricEffect::GetSigmaSOut to have details about this coefficient.

Parameters:

iSigmaS:scattering coefficient.

Variables documentation

Box maximum point.

Box minimum point.

Emission coefficient.

Absorption coefficient.

In-scattering coefficient.

Out-scattering coefficient.