class RED::ISoftRenderingContext

Software rendering context interface. Contains global rendering parameters. More...

#include <REDISoftRenderingContext.h>

Inherits: IREDObject.

Public functions:

virtual voidGetAmbientLight ( double oAmbientLight[4] ) const = 0
virtual RED::Object *GetBackground2DImage ( ) const = 0
virtual const RED::Matrix &GetBackground2DImageMatrix ( ) const = 0
virtual RED::Object *GetBackgroundCubeImage ( ) const = 0
virtual const RED::Matrix &GetBackgroundCubeImageMatrix ( ) const = 0
virtual voidGetBackgroundDepth ( double & oBackgroundDepth ) const = 0
virtual boolGetBackgroundImagesDirectVisibility ( ) const = 0
virtual doubleGetBackgroundImagesIntensityScale2D ( ) const = 0
virtual doubleGetBackgroundImagesIntensityScaleCube ( ) const = 0
virtual voidGetCaustics ( bool & oEnabled, unsigned int & oPhotonsCount, double & oSearchRadius, unsigned int & oSearchPhotonsCount ) const = 0
virtual voidGetClearColor ( double oClearColor[4] ) const = 0
virtual voidGetClearDepth ( double & oClearDepth ) const = 0
virtual voidGetGISettings ( bool & oGIEnabled, double & oGIError, double & oGlossinessThreshold, bool & oLighting, int & oEstimatorSamplingRate, int & oEstimatorInterSamplesCount, int & oCachePassesCount, int & oCacheHemiSamplesCount, int & oCacheInterpSamplesCount, double & oCacheNormalTolerance, double & oCacheDistanceTolerance, bool & oCachePrecise ) const = 0
virtual const RED::Matrix &GetInvertViewingMatrix ( ) const = 0
virtual const RED::ISoftLight &GetLight ( unsigned int iLight ) const = 0
virtual unsigned intGetLightsCount ( ) const = 0
virtual doubleGetPhysicalLightCutoff ( ) const = 0
virtual const RED::Matrix &GetProjectionMatrix ( ) const = 0
virtual doubleGetRayAdaptiveSamplingAllowedTime ( ) const = 0
virtual doubleGetRayAdaptiveSamplingThreshold ( ) const = 0
virtual doubleGetRayCutoffThreshold ( ) const = 0
virtual doubleGetRayMaxSecondaryRayIntensity ( ) const = 0
virtual intGetRayReflectionDepth ( ) const = 0
virtual boolGetRayRefractionBack ( ) const = 0
virtual intGetRayRefractionDepth ( ) const = 0
virtual intGetRayShadowDepth ( ) const = 0
virtual intGetRayTransparencyDepth ( ) const = 0
virtual intGetRayVolumeDepth ( ) const = 0
virtual intGetRayWorldCacheSamplesCount ( ) const = 0
virtual intGetShadowMapDepth ( ) const = 0
virtual intGetStateNumber ( ) const = 0
virtual const RED::Matrix &GetViewingMatrix ( ) const = 0
virtual const RED::Matrix &GetViewportMatrix ( ) const = 0
virtual const RED::Matrix &GetViewProjectionMatrix ( ) const = 0
virtual const RED::Matrix &GetViewProjectionViewportMatrix ( ) const = 0
virtual RED::Object *GetVolumeShape ( ) const = 0
virtual RED::Object *GetVRL ( ) const = 0
virtual boolIsAreaSampling ( ) const = 0
virtual boolIsBackgroundImage ( ) const = 0
virtual boolIsEmissiveBackground ( ) const = 0
virtual boolIsGIEnabled ( ) const = 0
virtual boolIsGlossyEffects ( ) const = 0
virtual boolIsRayDisplacement ( ) const = 0
virtual boolIsRayForcedTransparency ( ) const = 0
virtual boolIsVolumetricEffects ( ) const = 0
virtual intShowGISamples ( ) const = 0

Public static functions:

static RED::CIDGetClassID ( )

Detailed description:

Software rendering context interface. Contains global rendering parameters.

Use this interface to retrieve the values of all the engine parameters at render time.

Functions documentation

public virtual void RED::ISoftRenderingContext::GetAmbientLight(doubleoAmbientLight[4]) const = 0

Gets the color of the ambient light.

Parameters:

oAmbientLight:The ambient light color.

Retrieves the background 2D image.

Returns:

The address of the current background 2D image.

Retrieves the background 2D image transform.

Returns:

The background 2D image matrix that transforms the fragment position prior to sampling the background image.

Retrieves the background cube image.

Returns:

The address of the current background cube image.

Retrieves the background cube image transform.

Returns:

The background cube image matrix that transforms the ray direction prior to sampling the background image.
public virtual void RED::ISoftRenderingContext::GetBackgroundDepth(double &oBackgroundDepth) const = 0

Retrieves the depth of the background images.

The rendering of the background writes a depth value in the rendering buffer. This value is set to a constant depth, slightly below 1.0, which is the default clear depth of a rendering buffer.

Parameters:

oBackgroundDepth:The background image rendering depth.

Retrieves background images direct visibility setting.

Returns:

'true': in this case, background images are seen for all direct rays that don't hit any scene geometry. 'false': the cube background image is seen in indirect rays that don't hit any scene geometry. The 2D background image is not visible.

Returns:

The intensity scaling factor applied to the background 2D image.

Returns:

The intensity scaling factor applied to the background cube image.
public virtual void RED::ISoftRenderingContext::GetCaustics(bool &oEnabled,
unsigned int &oPhotonsCount,
double &oSearchRadius,
unsigned int &oSearchPhotonsCount
)const = 0

Gets the current caustics settings.

Caustics are automatically disabled as soon as the photons count or the search radius is 0 (even if the caustics are enabled at the engine level). So, the 'oEnabled' value returned by the call may not reflect the true value of the corresponding engine option (RED::OPTIONS_RAY_ENABLE_CAUSTICS).

Parameters:

oEnabledtrue if caustics are enabled, false otherwise.
oPhotonsCounttotal number of requested caustics photons.
oSearchRadiuscaustics photons search radius in scene units.
oSearchPhotonsCountmaximum number of photons to be searched for.
public virtual void RED::ISoftRenderingContext::GetClearColor(doubleoClearColor[4]) const = 0

Gets the clear color.

This is the buffer clear color that was defined using RED::IViewpointRenderList::SetClearColor.

Parameters:

oClearColor:The image clear color.
public virtual void RED::ISoftRenderingContext::GetClearDepth(double &oClearDepth) const = 0

Gets the clear depth.

This is the buffer clear depth that was defined using RED::IViewpointRenderList::SetClearDepth.

Parameters:

oClearDepth:The image clear depth.
public virtual void RED::ISoftRenderingContext::GetGISettings(bool &oGIEnabled,
double &oGIError,
double &oGlossinessThreshold,
bool &oLighting,
int &oEstimatorSamplingRate,
int &oEstimatorInterSamplesCount,
int &oCachePassesCount,
int &oCacheHemiSamplesCount,
int &oCacheInterpSamplesCount,
double &oCacheNormalTolerance,
double &oCacheDistanceTolerance,
bool &oCachePrecise
)const = 0

Gets the current GI settings.

Note that GI is considered disabled, regardless of the option value being set, if we render an image using external, ready-to-use, GI caches.

Parameters:

oGIEnabled:true if GI is enabled, false otherwise.
oGIError:user-defined GI error.
oGlossinessThreshold:the user-defined threshold for glossiness approximation using the GI cache (see RED::OPTIONS_RAY_GI_FOR_GLOSSINESS).
oLighting:the value of the RED::OPTIONS_RAY_GI_FOR_LIGHTING option.
oEstimatorSamplingRate:the number of rays traced to compute the GI estimator.
oEstimatorInterSamplesCount:the number of samples used during GI estimator interpolation.
oCachePassesCount:the number of passes to compute the irradiance cache (can be negative in convergence mode).
oCacheHemiSamplesCount:the hemispherical sampling rays count.
oCacheInterpSamplesCount:the cache interpolation count.
oCacheNormalTolerance:the cache normal tolerance.
oCacheDistanceTolerance:the cache distance tolerance.
oCachePrecise:the precise cache flag value.

Gets the inverse of the viewing transform matrix.

Returns:

the inverse of the viewing transform matrix.
public virtual const RED::ISoftLight & RED::ISoftRenderingContext::GetLight(unsigned intiLight) const = 0

Returns the requested light.

Parameters:

iLight:index of the light to retrieve.

Returns:

The requested light.
public virtual unsigned int RED::ISoftRenderingContext::GetLightsCount() const = 0

Returns the number of lights.

Returns:

the number of lights.
public virtual double RED::ISoftRenderingContext::GetPhysicalLightCutoff() const = 0

Returns:

the physical light cutoff option value.

Gets the projection transform matrix.

The projection matrix is the camera perspective / orthographic or custom transform matrix. See RED::IViewpoint::GetProjectionMatrix for details.

Returns:

The projection transform matrix.

Returns:

The ray-tracer adaptive sampling allowed time.

Returns:

The ray-tracer adaptive sampling threshold.
public virtual double RED::ISoftRenderingContext::GetRayCutoffThreshold() const = 0

Returns:

The minimal needed intensity for a ray to be propagated.

Returns:

The ray-tracer maximal secondary ray intensity threshold.

Returns:

The maximal depth of ray-traced reflections.
public virtual bool RED::ISoftRenderingContext::GetRayRefractionBack() const = 0

Returns:

The ray refraction back option value.

Returns:

The maximal depth of ray-traced refractions.

Returns:

The maximal depth of ray-traced shadows.

Returns:

The maximal depth of ray-traced transparencies.

Returns:

The maximal depth of ray-traced volume.

Returns:

The number of samples to process for a world cache calculation.

Returns:

The maximal depth of shadow maps.

Returns:

The number of the transaction being rendered.

Gets the viewing transform matrix (sight, top, right, eye).

Returns:

the viewing transform matrix (sight, top, right, eye).

Gets the viewport transform matrix.

The viewport transform matrix for the rendered camera. See RED::IViewpointRenderList::GetViewportMatrix for details.

Returns:

The viewport transform matrix.

Gets the view matrix * projection matrix of the camera.

The view-projection matrix is the product of the camera projection matrix by the invert viewing matrix defined by the camera axis system. See RED::IViewpoint::GetViewProjectionMatrix for details.

Returns:

the view-projection transform matrix.

Gets the viewport * view-projection transform matrix.

This method returns the viewport matrix of the camera in it's VRL multiplied by the view-projection matrix of the camera. This is the complete transform applied to a (x,y,z,1) position in space to get to a screen (x,y,z,w) coordinate.

The method returns non normalized coordinates (e.g. full screen coordinates). The RED::ISoftRenderingContext::GetViewProjectionMatrix transforms a point into normalized coordinates before the application of the viewport transform.

For all details on the REDsdk transformation pipeline, please refer to Matrix transforms in a cluster.

Returns:

The model-view projection transform matrix.

Retrieves the volume shape of our scene if any.

Returns:

The volume shape.
public virtual RED::Object * RED::ISoftRenderingContext::GetVRL() const = 0

Gets the source VRL hosting our rendered camera.

Returns:

The address of the VRL we're rendered in.
public virtual bool RED::ISoftRenderingContext::IsAreaSampling() const = 0

Returns:

true if area sampling effects are enabled, false otherwise.
public virtual bool RED::ISoftRenderingContext::IsBackgroundImage() const = 0

Do we have a background image to handle?

Returns:

true if we have at least one background image being set.
public virtual bool RED::ISoftRenderingContext::IsEmissiveBackground() const = 0

Do we consider the background as emitting energy?

We have an emissive background if our scene contains an emissive skylight which is set to be emissive using RED::ISkyLightShape::SetEmissiveSky.

Returns:

true if the scene background is emissive for the GI, false otherwise.
public virtual bool RED::ISoftRenderingContext::IsGIEnabled() const = 0

Return true if GI is enabled.

Note that GI is considered disabled, regardless of the option value being set, if we render an image using external, ready-to-use, GI caches.

Returns:

true if GI is enabled, false otherwise.
public virtual bool RED::ISoftRenderingContext::IsGlossyEffects() const = 0

Returns:

true if glossy ray-traced effects are enabled, false otherwise.
public virtual bool RED::ISoftRenderingContext::IsRayDisplacement() const = 0

Returns:

True if displacement mapping is enabled, false otherwise.

Returns:

true if the software ray-tracer needs to go through all transparency layers, regardeless of the opacity of hit surfaces.
public virtual bool RED::ISoftRenderingContext::IsVolumetricEffects() const = 0

Do we have volumetric effects in the rendering of our scene?

Returns:

true if we have a volumetric shape that defines volumetric effects for our scene, false otherwise.

Do we want to show the GI samples?

The returned value is defined by the RED::OPTIONS_RAY_GI_SHOW_SAMPLES option.

Returns:

1, 2 or 3 if GI samples must be displayed, 0 otherwise.