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

fz_rmtl_set_generic_parm

Description

Sets the parameters of a surface style from generic parameters. This function is intended to facilitate the creation of a surface style during import of foreign file formats. Based on the values of the function arguments, formZ will choose the most appropriate shader. For example, if the refl, specular and trans arguemnts are all 0.0, the matte reflection shader is used. If specular is greater than 0.0, plastic is used. If refl is greater than 0.0, mirror is used etc.
When setting the color and the rgb col parameter is not NULL, the surface style will be set to a plain color shader. If col is NULL and col_fname (texture map file name) is not NULL, the surface style will be set to the color map shader. If the col_path parameter (texture map path) is NULL, the path will be set to the default texture map path (application directory).
Likewise for transparency and bump maps.

Plugin Prototype

fzrt_error_td fz_rmtl_set_generic_parm(

fzrt_int

windex,

fz_rmtl_ptr

rmtl,

fz_rgb_float_td *

col,

char *

col_fname,

fzrt_floc_ptr

col_floc,

double

ambient,

double

diffuse,

double

specular,

double

spec_expo,

double

refl,

double

trans,

double

refr,

fz_rgb_float_td *

spec_col,

char *

trn_fname,

fzrt_floc_ptr

trn_floc,

char *

bmp_fname,

fzrt_floc_ptr

bmp_floc,

double

bmp_amp )

Parameters

windex [Input]

project window index

rmtl [Input]

surface style

col [Input, Optional]

color

col_fname [Input, Optional]

color map file name

col_floc [Input, Optional]

color map file locator

ambient [Input]

ambient reflection

Range: ambient >= 0.0

diffuse [Input]

diffuse reflection

Range: diffuse >= 0.0

specular [Input]

specular reflection

Range: specular >= 0.0

spec_expo [Input]

specular exponent

Range: spec_expo > 0.0

refl [Input]

reflectivity

Range: refl >= 0.0

trans [Input]

transmission

Range: trans >= 0.0

refr [Input]

refraction

Range: refr >= 0.0

spec_col [Input, Optional]

specular color

trn_fname [Input, Optional]

transparency map file name

trn_floc [Input, Optional]

transparency map file locator

bmp_fname [Input, Optional]

Bump map file name

bmp_floc [Input, Optional]

Bump map file locator

bmp_amp [Input, Optional]

Bump amplitude

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