formZ SDK | 5.0 API Reference | Project | Modeling | Rendering | Render Materials
Description
Renders a bump shader into a texture map of a given size. The texture map can be returned in a memory buffer of bytes or can be written to an image file. To return the texture map in memory, the bytes parameter must be passed as non NULL and the bytes storage must be allocated by calling code to res * res bytes. Pixel displacement is stored as an unsigned char. i.e. from 255 (white) to 0 (black). Pixels are stored in row major order with the top left pixel of the texture in the first three bytes. To write the texture map to file, the floc parameter must be passed as non NULL and must contain a valid file name and file directory. The format reference id parameter, ffmt_id, must identify a file format that is capable of writing a bitmap image.
Plugin Prototype
fzrt_error_td fz_rmtl_get_bmp_shdr_rndr_txr(
fzrt_int | windex, |
rmtl_ptr, | |
fzrt_int | res, |
fzrt_int | num_tiles, |
unsigned char * | bytes, |
floc, | |
ffmt_id ) |
Parameters
windex [Input]
project window index
rmtl_ptr [Input]
the surface style from which to render the bump shader
res [Input]
The (horizontal and vertical) resolution of the square texture.
num_tiles [Input]
The number of (horizontal and vertical) tiles with which the pattern is rendered into the texture. For example, num_tiles == 3 generates 3 x 3 = 9 tiles of the pattern.
bytes [Input, Optional]
byte storage for the texture. IMPORTANT : it is the calling code's responsibility to allcoate at least res * res bytes.
floc [Input, Optional]
texture map file locator
ffmt_id [Input, Optional]
The file format reference id.
Returns
Error codes
Availability
6.0.0.0
Function Set
Defined in