formZ SDK | 4.0 Call Back Reference | RenderZone Shader

fz_shdr_cbak_trns_fset

FZ_SHDR_CBAK_TRNS_FSET_TYPE

formZ transparency shader callbacks function set id.

FZ_SHDR_CBAK_TRNS_FSET_NAME

formZ transparency shader callbacks function set name.

FZ_SHDR_CBAK_TRNS_FSET_VERSION

formZ transparency shader callbacks function set version.

Description

Function set for transparency shaders. The functions in this set need to be supplied by the plugin or script to implement a transparency shader.
The main shader function is the fz_shdr_cbak_trns_pixel callback. It is expected to compute the transparency of a surface pixel. Depending on whether the shader is a 2d or 3d shader, the 2d texture space coordinate (s,t) or the 3d texture space coordinate (x,y,z) relating to the pixel should be taken as the basis of the transparency computation. These coordinate values can be retrieved with the functions (2d) or fz_shdr_get_tspace_pnt (3d). The pixel transparency may also be computed from other surface information, such as the surface normal, which is the case in the formZ Neon transparency shader. If the fz_shdr_cbak_trns_pixel function returns 0.0 the pixel is considered completely opaque. If the fz_shdr_cbak_trns_pixel function returns 1.0 the pixel is considered completely transparent and therefore invisible. Values less than 0.0 and greater than 1.0 are not accepted and will be clamped to 0.0 or 1.0.
There are required and optional functions. The required functions are : fz_shdr_cbak_trns_name fz_shdr_cbak_trns_pixel All other functions are optional, but must be supplied to enable a certain functionality. For example, if the transparency shader has any parameters, the fz_shdr_cbak_trns_set_parameters function must be supplied. It is also advisable to implement a fz_shdr_cbak_trns_pre_render function, if the fz_shdr_cbak_trns_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_trns_pixel function is called at least once for each pixel, potentially thousands of times during a single rendering. The faster the fz_shdr_cbak_trns_pixel function, the faster the rendering will be.

Availability

5.0.0.0

Functions:

fz_shdr_cbak_trns_avg

fz_shdr_cbak_trns_iface_tmpl

fz_shdr_cbak_trns_name

fz_shdr_cbak_trns_pdf_help

fz_shdr_cbak_trns_pixel

fz_shdr_cbak_trns_post_render

fz_shdr_cbak_trns_pre_render

fz_shdr_cbak_trns_set_parameters

fz_shdr_cbak_trns_uuid

fz_shdr_cbak_trns_version

Defined in

fz_rzne_shdr_api.h