Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
PbrMediumStack Class Reference

The PbrMediumStack class Contains all the mediums being used for one ray path, the last medium in the stack is the one that must be used to compute the transmittance for the current sample. More...

Public Member Functions

void push (const GMathVec3f &attenuation, const GMathVec3f &scattering_color, const float &scattering_anisotropy, ModuleMaterial *material, const ModuleSceneObject *scene_object)
 Push a medium in the stack with his attenuation factor.
 
void pop (ModuleMaterial *material)
 Pop the last medium in the stack.
 
bool is_empty () const
 True when there is no medium in the stack.
 
void clear ()
 Clear the medium stack.
 
bool update_stack (const CtxEval &eval_ctx, const CtxShader &shader_ctx, const PbrMaterial *pbr_material, const CtxFragment *old_fragment)
 update_stack Push or Pop a medium depending if the bxdf has attenuation or scattering and if the fragment is facing
 
GMathVec3f evaluate_transmittance (const double distance) const
 evaluate_transmittance Compute the transmittance of the last medium in the stack using the distance
 
const GMathVec3f & get_attenuation () const
 
const GMathVec3f & get_scattering_color () const
 
const float & get_scattering_anisotropy () const
 
const unsigned int & get_count () const
 
ModuleMaterialget_material () const
 
const ModuleSceneObjectget_scene_object () const
 
const PbrMedium get_medium (const unsigned medium_id) const
 

Detailed Description

The PbrMediumStack class Contains all the mediums being used for one ray path, the last medium in the stack is the one that must be used to compute the transmittance for the current sample.

Push a Medium when the sample is BACK_DOMAIN and the fragment is facing; Pop a Medium when the sample is BACK_DOMAIN and the fragment is not facing, we pop the medium corresponding at the pushed medium


| | | | | | –>push pop—>push->push->pop->pop–> |-—| | |-—| | |-------------—|

Member Function Documentation

GMathVec3f PbrMediumStack::evaluate_transmittance ( const double  distance) const

evaluate_transmittance Compute the transmittance of the last medium in the stack using the distance

Parameters
distanceis the distance travelled by the ray in the medium
Returns
the transmittance
bool PbrMediumStack::update_stack ( const CtxEval eval_ctx,
const CtxShader shader_ctx,
const PbrMaterial pbr_material,
const CtxFragment old_fragment 
)

update_stack Push or Pop a medium depending if the bxdf has attenuation or scattering and if the fragment is facing

Returns
true if there is attenuation or scattering on the bxdf