formZ SDK | 4.0 Call Back Reference | RenderZone Shader

fz_shdr_cbak_fgnd_fset

FZ_SHDR_CBAK_FGND_FSET_TYPE

formZ depth effect shader callbacks function set id.

FZ_SHDR_CBAK_FGND_FSET_NAME

formZ depth effect shader callbacks function set name.

FZ_SHDR_CBAK_FGND_FSET_VERSION

formZ depth effect shader callbacks function set version.

Description

Function set for depth effect (foreground) shaders. The functions in this set need to be supplied by the plugin or script to implement a foreground shader.
The main shader function is the fz_shdr_cbak_fgnd_pixel callback. It is expected to adjust the color of a surface pixel based on the distance of the pixel from the eye point. Prior to the call to the depth effect shader's fz_shdr_cbak_fgnd_pixel function, the color, reflection, transparency and bump shader's pixel functions were called. The current color of the pixel contains the value of all these shader functions. This color can be retrieved with the function call (col). The distance of the pixel from the eye point can be retrieved by the function call (). If the current pixel is a background pixel, the distance is a very large (i.e. meaningless) number and () returns FALSE. This needs to be taken into account when adjusting the pixel color based on the distance.
There are required and optional functions. The required functions are : fz_shdr_cbak_fgnd_name fz_shdr_cbak_fgnd_pixel All other functions are optional, but must be supplied to enable a certain functionality. For example, if the depth effect shader has any parameters, the fz_shdr_cbak_fgnd_set_parameters function must be supplied. It is also advisable to implement a fz_shdr_cbak_fgnd_pre_render function, if the fz_shdr_cbak_fgnd_pixel function uses information which can be calculated once and does not change during the course of a rendering. It is important to note, that the fz_shdr_cbak_fgnd_pixel function is called at least once for each pixel, potentially thousands of times during a single rendering. The faster the fz_shdr_cbak_fgnd_pixel function, the faster the rendering will be.

Availability

5.0.0.0

Functions:

fz_shdr_cbak_fgnd_iface_tmpl

fz_shdr_cbak_fgnd_name

fz_shdr_cbak_fgnd_pdf_help

fz_shdr_cbak_fgnd_pixel

fz_shdr_cbak_fgnd_post_render

fz_shdr_cbak_fgnd_pre_render

fz_shdr_cbak_fgnd_set_parameters

fz_shdr_cbak_fgnd_uuid

fz_shdr_cbak_fgnd_version

Defined in

fz_rzne_shdr_api.h