SoftFrameBufferSample

Fields

double

_out_color

double

_out_depth

double

_out_ior

double

_out_color_reflect

double

_out_color_refract

double

_out_color_direct

double

_out_color_indirect

double

_out_color_diffuse

bool

_out_wcs_normal

BSDF_REQUEST

_in_bsdf_request

double

_in_bsdf_rnd

double

_in_out_bsdf_dir

double

_out_bsdf_specular_refl_dir

double

_out_bsdf_specular_tran_dir

double

_in_out_bsdf_ior

BSDF_EVENT

_in_out_bsdf_event

double

_out_bsdf_weight

double

_out_bsdf_specular_refl_weight

double

_out_bsdf_specular_tran_weight

double

_out_bsdf_pdf

double

_out_bsdf_emitted

bool

_out_bsdf_matte_shadow

Functions

SoftFrameBufferSample

~SoftFrameBufferSample

Detailed Description

class SoftFrameBufferSample

Storage of all frame buffer informations for a pixel sample rendered in software.

@related The CPU Programming Pipeline, Writing a Custom Software Rendering Shader, class RED::IMaterial, class RED::RenderShader

This structure is an I / O data structure that is used by the RED::SOFT_SHADER_CALLBACK software shading callback to read input pixel informations and to produce results for the final image frame buffer.

Public Functions

SoftFrameBufferSample()

Default constructor.

~SoftFrameBufferSample()

Destructor.

Public Members

double _out_color[4]

Output shader color. This is the color that is produced by the software shader callback. This color will be used as the SRC_COLOR in the equation defined by the last RED::StateShader that was read before the RED::RenderShader that called the callback.

double _out_depth

Output shader depth. This is the depth value that is produced by the software shader callback. By default, it’s set to DBL_MAX, indicating that the shader does not produce any depth buffer value and that the produced depth is the depth of the geometrical primitive intersected with the incoming ray. If set to another value, it’ll override the geometrical depth resulting of the primitive.

Please note that ‘_out_depth’ is ignored for all reflection and refraction rays.

double _out_ior

Output shader index of refraction (IOR). This information is supplied by global illumination refraction shaders (like RED::RayGIRefractionColorShader for example) to support refraction caustics. Other shaders let it set to 1.0.

double _out_color_reflect[4]

Output shader reflection color. This color is filled by reflection shaders so that one can isolate the contribution of reflections to an image. That color is initialized with DBL_MAX values for each component. Writing any other value to it indicates that a reflection color has been written.

double _out_color_refract[4]

Output shader refraction color. This color is filled by refraction propagation so that one can isolate the contribution of refractions to an image. That color is initialized with DBL_MAX values for each component. Writing any other value to it indicates that a reflection color has been written.

double _out_color_direct[4]

Output shader direct color. This color is filled by lighting shaders. It’s the result of the evaluation of the direct lighting term at the surface.

double _out_color_indirect[4]

Output shader indirect color. This color is filled by ambient lighting shaders. It’s the result of the evaluation of the indirect lighting term at the surface.

double _out_color_diffuse[4]

Output shader diffuse color. This color is filled by lighting shaders. It’s the result of the evaluation of the surface diffuse component.

bool _out_wcs_normal

This output flag indicates that a world space (WCS) normal direction has been calculated. This is used to bypass normal map calculations that occur during a call to RED::ISoftRayContext::SampleNormalMap

. Whenever a composite image is connected as a normal map input, it can set this flag to true to indicate that a WCS normal has been calculated in ‘_out_color’ rather than a tangent space (TCS) value that is turned then later on into a WCS normal using the ( tangent, binormal, normal ) local basis at the triangle. Note that this feature has no equivalence on the GPU where a normal map composite must return TCS directions encoded as colors.

This flag must enforce the indications provided by

RED::ISoftRayContext::IsNoBumpNormalOnly to decide on whether to add a bump mapping contribution to the result or not.

BSDF_REQUEST _in_bsdf_request

Type of request made to the BSDF.

double _in_bsdf_rnd[2]

Random numbers used by the BSDF shader to make statistical decisions.

double _in_out_bsdf_dir[4]

BSDF unit direction: can be used in input (to get its PDF through BSDF_REQUEST_PDF) or in output as a result of a BSDF_REQUEST_SAMPLE request.

double _out_bsdf_specular_refl_dir[4]

Specular reflection direction returned by the BSDF on a BSDF_REQUEST_SAMPLE request.

double _out_bsdf_specular_tran_dir[4]

Specular transmission direction returned by the BSDF on a BSDF_REQUEST_SAMPLE request.

double _in_out_bsdf_ior

BSDF IOR.

BSDF_EVENT _in_out_bsdf_event

Sampling event resulting from a BSDF_REQUEST_SAMPLE request.

double _out_bsdf_weight[4]

Weight of the BSDF in the provided or sampled direction.

double _out_bsdf_specular_refl_weight[4]

Weight of the BSDF for the specular reflection.

double _out_bsdf_specular_tran_weight[4]

Weight of the BSDF for the specular transmission.

double _out_bsdf_pdf

Pdf of the provided or sampled direction.

double _out_bsdf_emitted[4]

BSDF: emitted light component.

bool _out_bsdf_matte_shadow

BSDF from a matte shadow material.