class RED::RenderShaderParameter

Variable parameter of a RED::RenderShader. More...

#include <REDRenderShaderParameter.h>

Inherits: IChunkSaver and Object.

Public functions:

RenderShaderParameter ( const RED::String & iName, int iBindingPosition, RED::RenderShaderParameter::TARGET iTarget )
RenderShaderParameter ( const RED::RenderShaderParameter & iSource )
RenderShaderParameter ( )
virtual ~RenderShaderParameter ( )
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 ( )
intGetBinding ( ) const
intGetCameraParameterValue ( ) const
const RED::String &GetName ( ) const
RED::RenderShaderParameter::TARGETGetTarget ( ) const
RED::RenderShaderParameter::TYPEGetType ( ) const
const RED::Object *GetValue ( ) const
IMPLEMENT_CHUNKINTERPRETER ( )
RED_RCoperator= ( const RED::RenderShaderParameter & iSource )
virtual RED_RCSave ( RED::IStream * iStream, RED::StreamingPolicy & iPolicy, int iState = -1 ) const
voidSetCameraParameterValue ( int iIndex )
voidSetImage ( const RED::Object * iValue )
voidSetRayValue ( RED::RenderShaderParameter::TYPE iReference, const RED::Vector4 & iValue )
voidSetReference ( RED::RenderShaderParameter::TYPE iReference )
voidSetValue ( const RED::Vector4 & iValue )
voidSetValue ( double iValue )
voidSetValue ( const RED::Color & iValue )
voidSetValue ( const RED::Vector3 & iValue )
voidSetValue ( const RED::Matrix & iValue )
voidSetValue ( bool iValue )

Public static functions:

static RED::CIDGetClassID ( )

Public enumerations:

enumTARGET { VSH =  1, PSH =  2, GSH =  3 }
enumTYPE { FREE =  0, VECTOR =  1, VECTOR3 =  2, COLOR =  3, FLOAT =  4, BOOL =  5, TEXTURE =  6, MATRIX =  7, REF_EYE_POS_WCS =  8, REF_LIGHT_AMBIENT =  9, REF_LIGHT_POS_VCS =  10, REF_LIGHT_POS_WCS =  11, REF_LIGHT_DIFCOL =  12, REF_LIGHT_SPECOL =  13, REF_LIGHT_RANGE =  14, REF_LIGHT_SIGHT_VCS =  15, REF_LIGHT_SIGHT_WCS =  16, REF_LIGHT_TOP_VCS =  17, REF_LIGHT_TOP_WCS =  18, REF_LIGHT_RIGHT_VCS =  19, REF_LIGHT_RIGHT_WCS =  20, REF_POLYGON_FACING =  21, REF_LIGHT_SHADOW_IMAGE_TEX =  22, REF_LIGHT_SHADOW_ATT_TEX =  23, REF_LIGHT_SPOT_FALLOFF_TEX =  24, REF_LIGHT_BEAM_RADIAL_TEX =  25, REF_LIGHT_PROJECTOR_MATRIX =  26, REF_RAY_STARTING_POS_IMAGE =  27, REF_RAY_ENDING_POS_IMAGE =  28, REF_RAY_REFLECTED_ENDING_POS_IMAGE =  29, REF_RAY_REFRACTED_ENDING_POS_IMAGE =  30, REF_RAY_INCIDENT_DIR_IMAGE =  31, REF_RAY_REFLECTED_DIR_IMAGE =  32, REF_RAY_REFRACTED_DIR_IMAGE =  33, REF_RAY_TRIANGLE_IMAGE =  34, REF_RAY_REFLECTED_TRIANGLE_IMAGE =  35, REF_RAY_REFRACTED_TRIANGLE_IMAGE =  36, REF_RAY_REFLECTION_IMAGE =  37, REF_VRL_CLEAR_COLOR =  38, REF_VRL_CLEAR_DEPTH =  39, REF_VRL_BACKGROUND_CUBE_IMAGE =  40, REF_VRL_BACKGROUND_CUBE_IMAGE_MATRIX =  41, REF_BACK_COLOR_IMAGE =  42, REF_BACK_DEPTH_IMAGE =  43, REF_VRL_DIMENSIONS =  44, REF_VRL_ORIGIN =  45, REF_VRL_ENGINE_ANTI_ALIAS =  46, REF_RAY_FACE_CULL =  47, REF_CAMERA_SIGHT_WCS =  48, REF_CAMERA_TOP_WCS =  49, REF_CAMERA_RIGHT_WCS =  50, REF_SHADOW_MAP_TEX =  51, REF_SHADOW_MAP_FRUSTUM_MATX =  52, REF_INSTANCE_COUNTER_IMAGE =  53, REF_RAY_ENDING_NOR_IMAGE =  54, REF_RAY_WORLD_CACHE_SAMPLE_SPREAD =  55, REF_LIGHT_AREA_SAMPLE_POS =  56, REF_FONT_GLYPH_TEX =  57, REF_FONT_GLYPH_TEX_SIZE =  58, REF_CUTOFF_TEX =  59, RAY_GLOSSY_ANGLE =  60, RAY_GLOSSY_SAMPLES =  61, REF_GLOSSY_JITTER_TEX =  62, REF_GLOSSY_DEVIATION_TEX =  63, REF_GLOSSY_SAMPLE_NUMBER =  64, REF_AUTO_CUBE_MAP =  65, REF_AUTO_CUBE_MAP_CENTER =  66, RAY_GLOSSY_ANGLE_ANISO =  67, REF_EXPONENTIAL_TEX =  68, REF_INSTANCE_COUNTER =  69, REF_GI_CACHE_TEX =  70, REF_VIEWPORT_DIMENSIONS =  71, REF_VIEWPORT_ORIGIN =  72, REF_LIGHT_SKY_IMAGE =  73, REF_LIGHT_SKY_IMAGE_SMOOTH_CUBE =  74, REF_VRL_BACKGROUND_2D_IMAGE =  75, REF_VRL_BACKGROUND_2D_IMAGE_MATRIX =  76, REF_CAMERA_PARAMETER =  77, REF_VRL_VIEW_PROJECTION_VIEWPORT_MATRIX =  78, REF_VRL_MODEL_MATRIX =  79, REF_VRL_MODELVIEW_MATRIX =  80, REF_VRL_MODELVIEW_PROJECTION_MATRIX =  81, REF_VRL_VIEW_MATRIX =  82, REF_VRL_VIEW_PROJECTION_MATRIX =  83, REF_VRL_VIEWPORT_MATRIX =  84, REF_VRL_VIEW_PROJECTION_VIEWPORT_MATRIX_INVERT =  85, REF_VRL_MODEL_MATRIX_INVERT =  86, REF_VRL_MODELVIEW_MATRIX_INVERT =  87, REF_VRL_MODELVIEW_PROJECTION_MATRIX_INVERT =  88, REF_VRL_VIEW_MATRIX_INVERT =  89, REF_VRL_VIEW_PROJECTION_MATRIX_INVERT =  90, REF_VRL_VIEWPORT_MATRIX_INVERT =  91, REF_VRL_PROJECTION_MATRIX =  92, REF_VRL_PROJECTION_MATRIX_INVERT =  93 }

Protected variables:

int_bind
RED::Color_color
const RED::Object *_image
RED::Matrix_matrix
RED::String_name
RED::RenderShaderParameter::TARGET_target
RED::RenderShaderParameter::TYPE_type
RED::Vector4_vector

Detailed description:

Variable parameter of a RED::RenderShader.

The RED::RenderShader class uses RED::RenderShaderParameter objects to define its contents and the way the elements are to be rendered. A render shader parameter may be of several types:

A shader parameter is identified through its name string uniquely in the RED::RenderShader it belongs to. It targets one of the three stages of the shader based rendering pipeline:

indicating that way the shader on which it must be bound.

A shader parameter is sent to the corresponding shader stage by its binding position, specified during the construction of the parameter. The binding position is a "program.local" constant number for vectors, colors, matrices and a texture channel number for an image, if we refer to the ARB shader specification.

Shader parameters values are copied from the provided inputs, except for images that are pointed to by their object addresses.

References are scene related parameters: main references are lighting and ray-tracing parameters. One can put references on parameters coming out from a light: its position, color, orientation and whatever else. A reference's value is calculated purposedly, depending on the rendering configuration found. For example, a mesh that is lit by two different lights will be rendered twice with the light diffuse color, if a reference on a light's diffuse color is used.

Matrices are bound row by row (with the line major convention for ARB programs and row major convention for GLSL programs) as shader parameter. 4 consecutive constants are used for the parameter binding in ARB.

Ray tracer values are special parameters: they are declared with a specific type (RED::RenderShaderParameter::TYPE::RAY_*) and are used during ray-tracer rendering passes.

Functions documentation

RenderShaderParameter construction method.

Builds the shader parameter whose name is iName, and that targets either the vertex shader, geometry shader or pixel shader stage of the hardware rendering pipeline, according to iTarget.

Parameters:

iName:Name uniquely identifying the shader parameter in the RED::RenderShader it'll be added to.
iBindingPosition:Binding register or channel for the parameter.
iTarget:VSH (vertex) or PSH (pixel), according to the need.

RenderShaderParameter copy construction method.

Parameters:

iSource:Source of our contents.

RenderShaderParameter default construction method.

Builds a default render shader parameter with no data (RED::RenderShaderParameter::FREE) and an empty string name.

RenderShaderParameter destruction method.

public virtual void * RED::RenderShaderParameter::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::Object::As.

public virtual const void * RED::RenderShaderParameter::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::Object::As.

template< class T_As > public const T_As * RED::RenderShaderParameter::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::Object::As.

template< class T_As > public T_As * RED::RenderShaderParameter::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::Object::As.

Gets the binding position of the shader parameter.

Returns:

The (int) register position / channel where to bind the parameter.

Gets the index of a parameter set as a RED::RenderShaderParameter::REF_CAMERA_PARAMETER.

Returns:

The index value stored in the parameter. -1 is returned if the parameter is not a RED::RenderShaderParameter::REF_CAMERA_PARAMETER reference. A camera parameter value is set using RED::IViewpoint::AddRenderShaderParameter.

Gets the name of a shader parameter.

Returns:

The shader parameter name.

Gets the current target of the shader parameter.

Returns:

The shader stage targeted by the shader parameter.

Gets the type of a shader parameter.

Returns:

The shader parameter type.

Gets the value of the shader parameter.

The returned parameter should not be modified.

Returns:

The value of the shader. The method may return NULL if the shader parameter has no value.

Assignment operator.

Parameters:

iSource:Source of our contents.

Returns:

RED_OK if the operation has succeeded,
RED_ALLOC_FAILURE if a memory allocation has failed.
public virtual RED_RC RED::RenderShaderParameter::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 contents of the shader parameter to a camera parameter index value.

Parameters:

iIndex:The index entry that will be used to lookup the real parameter value in the camera list. A camera parameter value is set using RED::IViewpoint::AddRenderShaderParameter.

Sets the parameter value to an image.

Images are not duplicated by the call.

Parameters:

iValue:Image address. The provided pointer may be NULL. In this case the texture will be ignored by the rendering.

Sets the contents of the shader parameter to a ray tracer value.

Parameters:

iReference:The parameter type identifier.
iValue:The associated parameter value.

Sets the contents of the shader parameter to a reference.

Parameters:

iReference:The parameter reference identifier.

Sets the parameter value to a vector.

Parameters:

iValue:Vector value for the parameter.
public void RED::RenderShaderParameter::SetValue(doubleiValue)

Sets the parameter value to a double precision floating point value.

Parameters:

iValue:Double precision floating point value for the parameter.

Sets the parameter value to a color.

Parameters:

iValue:Color value for the parameter.

Sets the parameter value to a vector3.

Parameters:

iValue:Vector3 value for the parameter.

Sets the parameter value to a matrix.

Parameters:

iValue:Matrix value for the parameter.
public void RED::RenderShaderParameter::SetValue(booliValue)

Sets the parameter value to a boolean.

The value is turned into 0.0f (false) or 1.0f (true) internally.

Parameters:

iValue:Boolean value for the parameter.

Variables documentation

Binding position.

Color used to store the parameter value.

Image address used to store the parameter value.

Matrix used to store the parameter value.

Name of the shader parameter.

Current shader stage target of the parameter.

Type of the parameter.

Vector used to store the parameter value.

Enumerations documentation

Indicates that a given RenderShaderParameter must target the vertex shader program, the geometry shader program or the pixel shader program of a given RED::RenderShader.

Enumerator:

VSH

Parameter targeting the vertex program.

PSH

Parameter targeting the pixel program.

GSH

Parameter targeting the geometry program.

List all possible types of shader parameters. The FREE value is reserved.

Enumerator:

FREE
VECTOR

(x,y,z,w) Program parameter value extracted from a RED::Vector4.

VECTOR3

(x,y,z,1.0) ARB or (x,y,z) GLSL. Defined by a SetValue call with a RED::Vector3 parameter. The value of the vector3 is stored in a RED::Vector4 and returned as a (x,y,z,1.0f) RED::Vector4 upon access.

COLOR

(r,g,b,a). Defined by a SetValue call with a RED::Color parameter. Returned as a RED::Color upon access.

FLOAT

(f,f,f,f) ARB or (f) GLSL. Defined by a SetValue call with a simple float parameter. The value of the float is stored in a RED::Vector4 and returned replicated 4 times for every component of the vector as a RED::Vector4 upon access.

BOOL

(b,b,b,b) ARB of (b) GLSL. Defined by a SetValue call with a simple bool parameter. The value of the bool is stored as 0.0f (false) or 1.0f (true) and returned as a RED::Vector4 replicated 4 times for every component of the vector.

TEXTURE

(texture) Program bound texture.

MATRIX

(matrix) Program parameter value extracted from a RED::Matrix, using the line major convention for ARB shaders and using the row major convention for GLSL shaders.

REF_EYE_POS_WCS

(x,y,z,w) ARB or (vec4) GLSL. Position of the camera in world space coordinates. The floating origin of the camera is applied to the value sent to the shader.

REF_LIGHT_AMBIENT

(x,y,z,w) ARB or (vec4) GLSL. Ambient light color.

REF_LIGHT_POS_VCS

(x,y,z,w) ARB or (vec4) GLSL. Position of the current light source in view space coordinates.

REF_LIGHT_POS_WCS

(x,y,z,w) ARB or (vec4) GLSL. Position of the current light source in world space coordinates.

REF_LIGHT_DIFCOL

(x,y,z,w) ARB or (vec4) GLSL. Current light source diffuse color.

REF_LIGHT_SPECOL

(x,y,z,w) ARB or (vec4) GLSL. Current light source specular color.

REF_LIGHT_RANGE

(x,y,z,w) ARB or (vec4) GLSL. Current light source effect distance.
x = Light intensity texture ramp pixel size / Light effect distance.
y = 0.0f.
z = Light intensity texture ramp pixel size.
w = Light effect distance.

REF_LIGHT_SIGHT_VCS

(x,y,z,w) ARB or (vec4) GLSL. Sight vector of the current light source in view space coordinates.

REF_LIGHT_SIGHT_WCS

(x,y,z,w) ARB or (vec4) GLSL. Sight vector of the current light source in world space coordinates.

REF_LIGHT_TOP_VCS

(x,y,z,w) ARB or (vec4) GLSL. Top vector of the current light source in view space coordinates.

REF_LIGHT_TOP_WCS

(x,y,z,w) ARB or (vec4) GLSL. Top vector of the current light source in world space coordinates.

REF_LIGHT_RIGHT_VCS

(x,y,z,w) ARB or (vec4) GLSL. Right vector of the current light source in view space coordinates.

REF_LIGHT_RIGHT_WCS

(x,y,z,w) ARB or (vec4) GLSL. Right vector of the current light source in world space coordinates.

REF_POLYGON_FACING

(x,y,z,w) ARB or (vec4) GLSL. Either (1,1,1,1) or (-1,-1,-1,-1). Whenever a material is declared as surfacic by a RED::StateShader, the polygon facing reference's value is +1 for the rendering of the first side of an object's polygons, and -1 for the rendering of the second side of an object's polygons.

REF_LIGHT_SHADOW_IMAGE_TEX

(image) Screen space texture sized to the rendered VRL dimensions. This image contains the per pixel shadow intensity to apply for the current rendering pass with the current light.

REF_LIGHT_SHADOW_ATT_TEX

(image) Intensity ramp for the current light. The size of the ramp is specified on the RED::ILightShape interface, and accessed using the RenderShaderParameter::REF_LIGHT_RANGE reference.

REF_LIGHT_SPOT_FALLOFF_TEX

(cube image) Cube image containing the directional spot intensity falloff.

REF_LIGHT_BEAM_RADIAL_TEX

(image) Texture containing the radial intensity falloff for a beam light.

REF_LIGHT_PROJECTOR_MATRIX

(matrix) Projection matrix to wrap onto the radial texture of a beam light, provided (uv) coordinates in the (right,top) referential of the light source.

REF_RAY_STARTING_POS_IMAGE

(image) Screen space ray starting positions in indirect lighting. This image does not exist for rays fired from the camera. Ray positions are expressed in world space coordinates.

REF_RAY_ENDING_POS_IMAGE

(image) Screen space ray ending positions in indirect lighting. This image does not exist for ray fired from the camera. Ray positions are expressed in world space coordinates.

REF_RAY_REFLECTED_ENDING_POS_IMAGE

(image) Screen space image containing reflected rays ending positions after a ray bounce. Ray positions are expressed in world space coordinates.

REF_RAY_REFRACTED_ENDING_POS_IMAGE

(image) Screen space image containing refracted rays ending positions after a ray bounce. Ray positions are expressed in world space coordinates.

REF_RAY_INCIDENT_DIR_IMAGE

(image) Screen space incident ray directions in indirect lighting. This image does not exist for rays fired from the camera. An incident ray will split in reflected and refracted rays whose directions will be REF_RAY_REFLECTED_DIR_IMAGE and REF_RAY_REFRACTED_DIR_IMAGE. Ray directions are expressed in world space coordinates.

REF_RAY_REFLECTED_DIR_IMAGE

(image) Screen space reflected ray directions in indirect lighting after a ray bounce at our current ray ending position. The texture contains:

  • image.xyz = reflection direction in WCS.
  • image.w = refraction index of the material we're currently in.

REF_RAY_REFRACTED_DIR_IMAGE

(image) Screen space refracted ray directions in indirect lighting after a ray bounce at our current ray ending position. The texture contains:

  • image.xyz = refraction direction in WCS.
  • image.w = refraction index of the material we'll step in after crossing our hit interface.

REF_RAY_TRIANGLE_IMAGE

(image) Screen space triangle identifiers image used for the shader pixel ownership test, that identify who has been really hit for each pixel. This image does not exist for rays fired from the camera.

REF_RAY_REFLECTED_TRIANGLE_IMAGE

(image) Screen space triangle identifiers image identifying hit triangles after a reflection bounce at our current ray ending position.

REF_RAY_REFRACTED_TRIANGLE_IMAGE

(image) Screen space triangle identifiers image identifying hit triangles after a refraction bounce at our current ray ending position.

REF_RAY_REFLECTION_IMAGE

(image) Screen space image that contains the reflection color that should be applied to reflective objects to complete their lighting.

REF_VRL_CLEAR_COLOR

(x,y,z,w) ARB or (vec4) GLSL. Value of the VRL clear color.

REF_VRL_CLEAR_DEPTH

(x,y,z,w) ARB or (vec4) GLSL. Value of the VRL clear depth. x = 0.0;
y = 0.0;
z = clear depth.
w = 1.0;

REF_VRL_BACKGROUND_CUBE_IMAGE

(imageCUBE) Cube image that may has been specified in the RED::IViewpointRenderList::SetBackgroundImages call.

REF_VRL_BACKGROUND_CUBE_IMAGE_MATRIX

(matrix) Additional transformation matrix that has been specified in the RED::IViewpointRenderList::SetBackgroundImages call.

REF_BACK_COLOR_IMAGE

(image) Screen space image of the back buffer color. This image is generated before the startup of each rendering pass (RED::MTL_LIT or RED::MTL_POSTLIT) that is requesting it. The contents of the image is the color of all previous rendering passes before the one asking for it.

REF_BACK_DEPTH_IMAGE

(image) Screen space image of the back buffer depth. This image is generated before the startup of each rendering pass (RED::MTL_LIT or RED::MTL_POSTLIT) that is requesting it. The contents of the image is the depth of all previous rendering passes before the one asking for it.

REF_VRL_DIMENSIONS

(x,y,z,w) ARB or (vec4) GLSL. Dimensions of the current VRL we are rendering into. Note that these values are modified by the engine anti-aliasing setting value used by the current VRL. The real VRL size is its pixel size times its engine anti-aliasing setup.
x = 1.0f / VRL pixel width.
y = 1.0f / VRL pixel height.
z = VRL pixel width.
w = VRL pixel height.

REF_VRL_ORIGIN

(x,y,z,w) ARB or (vec4) GLSL. Origin of the lower left pixel of the VRL we are rendering into. The engine may use many internal tiles to render a single VRL in separate pieces. This reference is to be added to the fragment.position value when the absolute coordinate of a pixel is to be retrieved.
x = VRL x origin.
y = VRL y origin.
z = 0.0f.
w = 0.0f.

REF_VRL_ENGINE_ANTI_ALIAS

(x,y,z,w) ARB or (vec4) GLSL. Engine anti-aliasing setup for the rendered VRL. This reference value may be used to scale pixel coordinates for screen space related texture sampling.
x = 1.0f / VRL engine anti alias.
y = 1.0f / VRL engine anti alias.
z = VRL engine anti alias.
w = VRL engine anti alias.

REF_RAY_FACE_CULL

(x,y,z,w) ARB or (vec4) GLSL. Ray tracer reference used to simulate polygon back face culling within the ray-traced shaders. This reference is part of the ray-tracer binding package needed to process indirect lighting workflows.

REF_CAMERA_SIGHT_WCS

(x,y,z,w) ARB or (vec4) GLSL. Current viewpoint sight vector in world space coordinates. The floating origin of the camera is applied to the value sent to the shader.

REF_CAMERA_TOP_WCS

(x,y,z,w) ARB or (vec4) GLSL. Current viewpoint top vector in world space coordinates. The floating origin of the camera is applied to the value sent to the shader.

REF_CAMERA_RIGHT_WCS

(x,y,z,w) ARB or (vec4) GLSL. Current viewpoint right vector in world space coordinates. The floating origin of the camera is applied to the value sent to the shader.

REF_SHADOW_MAP_TEX

(image) Direct access to the shadow map image of a given light. This reference is only valid for beam and spot lights. The texture has a depth texture setup on NVIDIA GPUs and has no depth texture setup on ATI GPUs.

REF_SHADOW_MAP_FRUSTUM_MATX

(matrix) World space to device space frustum matrix for the view of the light source for a shadow image. This matrix is for usage with REF_SHADOW_MAP_TEX.

REF_INSTANCE_COUNTER_IMAGE

(image) This reference associates a user defined image value to each object instance being rendered with a shader that is using the reference. The mapping table between an instance and the reference value is made by RED::IViewpoint::SetInstanceCounterImageCallback.

REF_RAY_ENDING_NOR_IMAGE

(image) Screen space ray hit points ending normals in indirect lighting. This image does not exist for ray fired from the camera. Ray hit points normals are expressed in world space coordinates.

REF_RAY_WORLD_CACHE_SAMPLE_SPREAD

(x,y,z,w) Value of the RED::OPTIONS_RAY_WORLD_CACHE_SAMPLE_SPREAD. x = (float)value.
y = 1.0f / (float)value.
z = 0.0f.
w = 1.0f.

REF_LIGHT_AREA_SAMPLE_POS

(image) This reference is used to bind area sample information for a pixel shader. Refer to the product documentation for details and example usage of this reference.

REF_FONT_GLYPH_TEX

(image 2D) This reference contains pre-rendered textures for all font characters (glyphs) that are used for a given font that is rendered using textured quads (RED::FNT_TEXTURE fonts).
This shader reference is not accessible in GLSL. It's usually accessed through the RED::RenderShaderText display shader.

REF_FONT_GLYPH_TEX_SIZE

(x,y,z,w) ARB only. This reference contains the size of the font glyph texture.
z = glyph texture pixel width. w = glyph texture pixel height. x = 1.0f / z. y = 1.0f / w.

REF_CUTOFF_TEX

(image) This reference contains the per pixel ray attenuation at the currently processed ray tree level. It can only be accessed by a shader in the RED::MTL_RAYTRACE pass that targets one of the possible indirect cutoffs targets:

RAY_GLOSSY_ANGLE

(RED::Vector4) Ray tracer parameter value. Defines the spread angle used for the calculations of glossy ray-traced reflections or refractions, depending on the shader target used to register the parameter.
We use the '.x' value of the provided vector that specify the glossiness angle in radians between 0.0f and RED_PI / 2.0f.

RAY_GLOSSY_SAMPLES

(RED::Vector4) Ray tracer parameter value. Defines the number of rays that'll be fired in the cone of glossy reflections or refraction for the shader that is using this parameter. Reflections or refractions are selected based on the shader target used to register the parameter.
We use the '.x' value of the provided vector to define that number of rays being fired. If the value is 0.0f or below, then the ray-tracer automatically selects the number of samples to shoot, based on the RAY_GLOSSY_ANGLE specified by the shader.

REF_GLOSSY_JITTER_TEX

(image) This reference converts a screen coordinates defined by 'fragment.position' into a random number in the [0,2048] range. This reference is only accessible if glossy effects are enabled.

REF_GLOSSY_DEVIATION_TEX

(image) This reference offsets a ray direction in the glossiness calculation basis. Too long to explain here in detail. Contact us if you need to compute glossiness by yourself. Otherwise, this reference is used by the ray-tracer shaders for all glossiness effects calculations.

REF_GLOSSY_SAMPLE_NUMBER

(RED::Vector4) Number of the glossy sample being currently rendered. .x = number of the sample. .y = number of the sample / 255.0f. .z = 0.0f. .w = 0.0f.

REF_AUTO_CUBE_MAP

(image cube) This reference launches the automatic calculation of a cube image that can be then accessed in shader programs. The cube image is calculated for each scene in which the material using this reference is used. The center of the cube image is set to the barycentric coordinates of all points of all objects using the material that is using this reference.
All objects using the reference through their material are discarded for the cube image rendering. Please note that using this reference has a clear impact on rendering performances.

REF_AUTO_CUBE_MAP_CENTER

(RED::Vector4) This reference is associated to REF_AUTO_CUBE_MAP. It stores the coordinates of the point that has been used to compute the REF_AUTO_CUBE_MAP image. It's used for example to correct parallax errors for real-time approximated effects. The floating origin of the viewpoint is applied in the resulting matrix.

RAY_GLOSSY_ANGLE_ANISO

(RED::Vector4) Ray tracer parameter value. This value is similar to the RED::RenderShaderParameter::RAY_GLOSSY_ANGLE except that it defines a second angular value that can be used to define an anisotropic basis for the calculation of glossiness spreading. We use the '.x' value of the provided vector that specify this glossiness angle in radians between 0.0f and RED_PI / 2.0f.

REF_EXPONENTIAL_TEX

(image RECT) Floating point texture of 2048 x 1 texels. Texel[0] is expf(0.0f); Texel[2047] is expf(-20.0f). This exponent ramp is used as a mathematical built-in exponent table for all shaders that need it.

REF_INSTANCE_COUNTER

(RED::Vector4) This reference associates a user defined RED::Vector4 value to each object instance being rendered with a shader that is using the reference. The mapping table between an instance and the reference value is made by RED::IViewpoint::SetInstanceCounterCallback.

REF_GI_CACHE_TEX

(image RECT) Screen space image containing the irradiance cache color that can be used to display a pre-processed global illumination contribution to the scene. See RED::IWindow::FrameDrawingGICache. The RED::RenderShaderAmbient uses this reference for automatic GI replay.

REF_VIEWPORT_DIMENSIONS

(x,y,z,w) ARB or (vec4) GLSL. Dimensions of the current viewport we are rendering into. These are the dimensions of the viewpoint being rendered as it was anchored inside the VRL hosting it. Note that these values are modified by the engine anti- aliasing setting value used by the current VRL. The real viewport size is its pixel size times the engine anti-aliasing setup for the VRL that contains it.
x = 1.0f / Viewport pixel width.
y = 1.0f / Viewport pixel height.
z = Viewport pixel width.
w = Viewport pixel height.

REF_VIEWPORT_ORIGIN

(x,y,z,w) ARB or (vec4) GLSL. Origin of the lower left pixel of the viewport we are rendering into. This is the position of the lower left pixel of the viewpoint being rendered as it was anchored inside the VRL hosting it. Note that the engine may use many internal tiles to render a single VRL in separate pieces. The viewport origin is calculated relatively to the current origin of the VRL tile as expressed by the RED::RenderShaderParameter::REF_VRL_ORIGIN reference. This reference value is to be subtracted from the fragment.position value when the coordinate of a pixel in the viewport are to be retrieved: viewport_coordinates = fragment.position - viewport_origin.
x = Viewport x origin.
y = Viewport y origin.
z = 0.0f.
w = 0.0f.

REF_LIGHT_SKY_IMAGE

(image RECT) This reference points to the sky texture image that was supplied to the RED::ISkyLightShape::SetSkyTexture method during the construction of a skylight.

REF_LIGHT_SKY_IMAGE_SMOOTH_CUBE

(image CUBE) This reference is a small cube image being generated from the sky texture of the skylight. This is a downsampled and blurred version of the original sky texture, turned into a cube texture. This is used as a noise reduction technique for the calculation of the diffuse shading of the skylight. This reference is only available on the GPU.

REF_VRL_BACKGROUND_2D_IMAGE

(imageCUBE) 2D image that may has been specified in the RED::IViewpointRenderList::SetBackgroundImages call.

REF_VRL_BACKGROUND_2D_IMAGE_MATRIX

(matrix) Additional transformation matrix that has been specified in the RED::IViewpointRenderList::SetBackgroundImages call.

REF_CAMERA_PARAMETER

(RED::Vector4) This reference stores an integer value in the first coordinate of the vector. The value can be set using RED::RenderShaderParameter::SetCameraParameterValue and retrieved using RED::RenderShaderParameter::GetCameraParameterValue. A camera parameter stores a reference to a parameter registered in a RED::IViewpoint, using RED::IViewpoint::AddRenderShaderParameter.

REF_VRL_VIEW_PROJECTION_VIEWPORT_MATRIX

(matrix) This reference returns the matrix that can be accessed otherwise using RED::IViewpointRenderList::GetFloatingViewProjectionViewportMatrix, for the current camera in the current VRL. The floating origin of the viewpoint is applied in the resulting matrix.

REF_VRL_MODEL_MATRIX

(matrix) This reference returns the current matrix corresponding to the matrix set for the currently rendered object. The reference is valid only if the RED::RenderCode of the corresponding shader has enabled the model matrix. This reference is not available in software rendering.

REF_VRL_MODELVIEW_MATRIX

(matrix) This reference returns the current modelview matrix corresponding to the matrix set for the currently rendered object ( inverse viewing matrix x model matrix ). The reference is valid only if the RED::RenderCode of the corresponding shader has enabled the modelview matrix. The floating origin of the viewpoint is applied in the resulting matrix. This reference is not available in software rendering.

REF_VRL_MODELVIEW_PROJECTION_MATRIX

(matrix) This reference returns the current modelview projection matrix corresponding to the matrix set for the currently rendered object ( projection x inverse viewing matrix x model matrix ). The reference is valid only if the RED::RenderCode of the corresponding shader has enabled the modelview projection matrix. The floating origin of the viewpoint is applied in the resulting matrix. This reference is not available in software rendering.

REF_VRL_VIEW_MATRIX

(matrix) This reference returns the current view matrix corresponding to the camera being currently rendered. The floating origin of the viewpoint is applied in the resulting matrix. That reference is not available in software rendering for which the RED::ISoftRenderingContext::GetViewingMatrix can be directly used instead to retrieve the matrix.

REF_VRL_VIEW_PROJECTION_MATRIX

(matrix) This reference returns the matrix that can be accessed otherwise using RED::IViewpointRenderList::GetFloatingViewProjectionMatrix, for the current camera in the current VRL. The floating origin of the viewpoint is applied in the resulting matrix. That reference is not available in software rendering for which the RED::ISoftRenderingContext::GetViewProjectionMatrix can be directly used instead to retrieve the matrix.

REF_VRL_VIEWPORT_MATRIX

(matrix) This reference returns the matrix that can be accessed otherwise using RED::IViewpointRenderList::GetViewportMatrix, for the current camera in the current VRL. That reference is not available in software rendering for which the RED::ISoftRenderingContext::GetViewportMatrix can be directly used instead to retrieve the matrix.

REF_VRL_VIEW_PROJECTION_VIEWPORT_MATRIX_INVERT

(matrix) Inverse of RED::RenderShaderParameter::REF_VRL_VIEW_PROJECTION_VIEWPORT_MATRIX.

REF_VRL_MODEL_MATRIX_INVERT

(matrix) Inverse of RED::RenderShaderParameter::REF_VRL_MODEL_MATRIX.

REF_VRL_MODELVIEW_MATRIX_INVERT

(matrix) Inverse of RED::RenderShaderParameter::REF_VRL_MODELVIEW_MATRIX.

REF_VRL_MODELVIEW_PROJECTION_MATRIX_INVERT

(matrix) Inverse of RED::RenderShaderParameter::REF_VRL_MODELVIEW_PROJECTION_MATRIX.

REF_VRL_VIEW_MATRIX_INVERT

(matrix) Inverse of RED::RenderShaderParameter::REF_VRL_VIEW_MATRIX.

REF_VRL_VIEW_PROJECTION_MATRIX_INVERT

(matrix) Inverse of RED::RenderShaderParameter::REF_VRL_VIEW_PROJECTION_MATRIX.

REF_VRL_VIEWPORT_MATRIX_INVERT

(matrix) Inverse of RED::RenderShaderParameter::REF_VRL_VIEWPORT_MATRIX.

REF_VRL_PROJECTION_MATRIX

(matrix) This reference returns the matrix that can be accessed otherwise using RED::IViewpoint::GetProjectionMatrix, for the current camera in the current VRL. That reference is not available in software rendering for which the value can be accessed from the camera retrieved from RED::ISoftRayContext::GetCamera.

REF_VRL_PROJECTION_MATRIX_INVERT

(matrix) Inverse of RED::RenderShaderParameter::REF_VRL_PROJECTION_MATRIX.