formZ SDK | 5.0 API Reference | Project | Modeling | Rendering | Shaders

fz_shdr_get_mirror_factor

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 mirror 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_mirror_parm().

Plugin Prototype

void fz_shdr_get_mirror_factor(

double *

fval )

Parameters

fval [Result]

The current value of the mirror reflection parameter.

Returns

none

Availability

5.0.0.0

Plugin Example

The mirror factor is usually multiplied with the result of a raytraced mirror reflection, as shown in the sample code below :
fz_shdr_get_mirror_factor(&mirr_factor); if ( mirr_factor > 0.0 ) { fz_shdr_get_world_pnt(&world_pt); fz_shdr_get_world_shading_normal(&norm); fz_shdr_get_view_dir(&view_vec); fz_shdr_ray_reflect(&view_vec,&norm,&mirr_vec); fz_shdr_raytrace_reflected(&world_pt,&mirr_vec,mirr_factor,&mirr_col); mirr_col *= mirr_factor; }

See Also

fz_shdr_set_specular_parm

Function Set

fz_shdr_fset


Defined in

fz_rzne_shdr_api.h