formZ SDK | 5.0 API Reference | Project | Modeling | Rendering | Render Materials

# fz_shdr_ptr_get_parm

Description

Gets a parameter of a render shader. The parameter is identified by parm_id and is enumerated for each shader.
For reflection shaders the parameters are in the same order as in the respective dialog, except that the reflection maps are listed at the end. For example for the MATTE shader, the parameters are : ambient factor, diffuse factor, glow factor, ambient map, diffuse map, glow map.
For texture map based shaders the parameters are as follows :
Color map :
0 scale
1 texture map
2 texture type ( FZ_SHDR_TMAP_TYPE_MIPMAP, FZ_SHDR_TMAP_TYPE_SUMTABLE)
3 smoothness
4 horizontal infinite on/off
5 horizontal # of repetitions
6 horizontal centering
7 vertical infinite on/off
8 vertical # of repetitions
9 vertical centering
10 repeat color at edges on/off
11 color beyond image edges
Transparency map :
0 scale
1 texture map
2 texture type ( FZ_SHDR_TMAP_TYPE_MIPMAP, FZ_SHDR_TMAP_TYPE_SUMTABLE)
3 smoothness
4 horizontal infinite on/off
5 horizontal # of repetitions
6 horizontal centering
7 vertical infinite on/off
8 vertical # of repetitions
9 vertical centering
10 repeat color at edges on/off
11 color beyond image edges
12 alpha channel on/off
13 invert alpha channel on/off
14 black as mask on/off
Bump map :
0 scale
1 texture map
2 texture type ( FZ_SHDR_TMAP_TYPE_MIPMAP, FZ_SHDR_TMAP_TYPE_SUMTABLE)
3 smoothness
4 horizontal infinite on/off
5 horizontal # of repetitions
6 horizontal centering
7 vertical infinite on/off
8 vertical # of repetitions
9 vertical centering
10 repeat bumps at edges on/off
11 bump amplitude
12 alpha channel on/off
Background map :
0 scale
1 texture map
2 fit option ( FZ_SHDR_BGMAP_FIT_WINDOW, FZ_SHDR_BGMAP_KEEP_SIZE, FZ_SHDR_BGMAP_SCALE)
3 maintain proportions on/off
Spherical environment map :
0 scale
1 texture map
2 rotation around world z
3 horizontal start
4 horizontal end
5 vertical top
6 vertical bottom
Ambient, diffuse, specular, mirror, transmission, glow maps
0 scale
1 texture map
2 texture type ( FZ_SHDR_TMAP_TYPE_MIPMAP, FZ_SHDR_TMAP_TYPE_SUMTABLE)
3 smoothness
4 horizontal infinite on/off
5 horizontal # of repetitions
6 horizontal centering
7 vertical infinite on/off
8 vertical # of repetitions
9 vertical centering
10 repeat color at edges on/off
11 color beyond image edges
12 alpha channel on/off
13 invert alpha channel on/off
To match the value of the Roughness parameter of a reflection shader to what the dialog interface does, you need to azpply the square root to the value retrieved by fz_shdr_ptr_get_parm. For example, if the dialog shows 10% (i.e. 0.1) you will get 0.01 from fz_shdr_ptr_get_parm. Applying the square root will give you 0.1. The reason for this is, that the dialog applies an exponential scaling of the value entered by the user.

Plugin Prototype

fzrt_error_td fz_shdr_ptr_get_parm(

fzrt_int | windex,
fz_shdr_ptr | shdr,
fzrt_int | parm_id,
fz_type_td * | data )

Parameters

windex [Input]

project window index

shdr [Input]

shader

parm_id [Input]

parameter identifier

data [Result]

parameter data

Returns

Error codes

Availability

5.0.0.0

Example Files

util_attr_rmtl.fsl
util_rmtl.fsl

Function Set

fz_rmtl_fset

Defined in

fz_rmtl_api.h