formZ SDK | 5.0 API Reference | Project | Modeling | Rendering | Shaders
Description
This function can only be called inside the pixel callback function when implementing a plugin or script reflection shader. It retrieves the current value of the transmission reflection parameter. This parameter must have been declared in the set_parameters callback function of the same shader via a call to fz_shdr_set_transmission_parm().
Plugin Prototype
void fz_shdr_get_transmission_factor(
double * | fval ) |
Parameters
fval [Result]
The current value of the transmission reflection parameter.
Returns
none
Availability
5.0.0.0
Plugin Example
The transmission factor is usually multiplied with the
result of a raytraced transmission, as shown
in the sample code below :
fz_shdr_get_transmission_factor(&trns_factor);
if ( trns_factor > 0.0 )
{
fz_shdr_get_index_of_refraction(&eta);
fz_shdr_get_view_dir(&view_vec);
fz_shdr_get_world_shading_normal(&norm);
if ( fz_shdr_ray_refract(&view_vec,&norm,eta,&trns_vec) == TRUE )
{
fz_shdr_get_world_pnt(&world_pt);
fz_shdr_raytrace_refracted(&world_pt,&trns_vec,trns_factor,&trns_col);
trns_col *= trns_factor;
}
}
See Also
Function Set
Defined in