formZ SDK | 5.0 API Reference | Project | Modeling | Rendering | Render Materials
Description
Renders a reflection map 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 intensity
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.
The reflection map is identified by the refl_map argument as follows :
0 : ambient map
1 : diffuse map
2 : specular map
3 : mirror map
4 : transmission map
5 : glow map
nl>
Note, that only those reflection maps actually are rendered, that are present in
the given reflection shader of the surface style. For example, rendering the
mirror map in a matte shader will produce a sold white texture, since the
matte shader does not have a mirror factor.
Plugin Prototype
fzrt_error_td fz_rmtl_get_reflmap_shdr_rndr_txr(
fzrt_int | windex, |
rmtl_ptr, | |
fzrt_int | refl_map, |
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 reflection map shader
refl_map [Input]
which reflection map to render
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