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 glow 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_glow_parm().
Plugin Prototype
void fz_shdr_get_glow_factor(
double * | fval ) |
Parameters
fval [Result]
The current value of the glow reflection parameter.
Returns
none
Availability
5.0.0.0
Plugin Example
The glow factor is usually used to increase the surface
brightness by adding more of the original pixel color
to the shaded pixel color. For example, a simple shading
calculation performed in the pixel function using
ambient, diffuse and glow would look like this :
// GET THE UNSHADED PIXEL COLOR
fz_shdr_get_col(&org_col);
// GET THE REFLECTION PARAMETERS
fz_shdr_get_ambient_factor(&ambt_factor);
fz_shdr_get_diffuse_factor(&diff_factor);
fz_shdr_get_glow_factor(&glow_factor);
// GET THE ILLUMINATION TERMS
fz_shdr_get_ambient_term(&ambt_col);
fz_shdr_get_diffuse_term(&diff_col);
// COMPUTE FINAL SHADED PIXEL
col = org_col * (ambt_factor * ambt_col + diff_factor * diff_col + glow_factor);
See Also
Function Set
Defined in