formZ SDK | 4.0 Call Back Reference | RenderZone Shader

# fz_shdr_cbak_bump_fset

FZ_SHDR_CBAK_BUMP_FSET_TYPE

formZ bump shader callbacks function set id.

FZ_SHDR_CBAK_BUMP_FSET_NAME

formZ bump shader callbacks function set name.

FZ_SHDR_CBAK_BUMP_FSET_VERSION

formZ bump shader callbacks function set version.

Description

Function set for bump shaders. The functions in this set need to be supplied by the plugin or script to implement a bump shader.
The main shader function is the fz_shdr_cbak_bump_pixel callback. It is expected to compute the amplitude (height) of a surface pixel. Amplitude values should be in the range of -1.0 to +1.0 or 0.0 to +1.0. larger values can be computed, but may distort the bump effect. 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 amplitude computation. These coordinate values can be retrieved with the functions (2d) or fz_shdr_get_tspace_pnt (3d). Note, that it is not the absolute amplitude value of a pixel, that creates a bump pattern, but the change of amplitude relative to the neighboring pixels. If that change is small, the bumps appear lower. If the change is rapid, the bumps appear higher.
There are required and optional functions. The required functions are : fz_shdr_cbak_bump_name fz_shdr_cbak_bump_pixel All other functions are optional, but must be supplied to enable a certain functionality. For example, if the bump shader has any parameters, the fz_shdr_cbak_bump_set_parameters function must be supplied. It is also advisable to implement a fz_shdr_cbak_bump_pre_render function, if the fz_shdr_cbak_bump_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_bump_pixel function is called at least once for each pixel, potentially thousands of times during a single rendering. The faster the fz_shdr_cbak_bump_pixel function, the faster the rendering will be.

Availability

5.0.0.0

Functions:

fz_shdr_cbak_bump_iface_tmpl

fz_shdr_cbak_bump_name

fz_shdr_cbak_bump_pdf_help

fz_shdr_cbak_bump_pixel

fz_shdr_cbak_bump_post_render

fz_shdr_cbak_bump_pre_render

fz_shdr_cbak_bump_set_parameters

fz_shdr_cbak_bump_uuid

fz_shdr_cbak_bump_version

Defined in

fz_rzne_shdr_api.h