formZ SDK | 5.0 API Reference | Project | Modeling | Rendering | Shaders

# fz_shdr_spline_color

Description

This function can only be called inside the pixel callback function when implementing a plugin or script shader. It computes a smoothly blended color from a list of individual colors. The first argument is a parametric value that must be in the range of 0.0 to 1.0. For example, if there are four colors, and the fval argument is below 0.25, the first color is returned. If fval is around 0.25, a mixture between the first and second color is returned. If it is between 0.25 and 0.5 the second color is returned, etc. This function can be combined with a turbulence function to create a pattern of random colored spots.

Plugin Prototype

fzrt_int fz_shdr_spline_color(

double | fval,
fzrt_int | ncols,
fz_rgb_float_td * | cols,
fz_rgb_float_td * | col_out )

Parameters

fval [Input]

The parametric value.

Range: 0.0 <= fval <= 1.0

ncols [Input]

The number of colors in the color array.

Range: ncols >= 4

cols [Input]

The color array.

col_out [Result]

The computed color.

Returns

Error codes.

Availability

5.0.0.0

Plugin Example

fz_shdr_get_tspace_st(&st); val = fz_shdr_turbulance_2d(&st,3,FZ_SHDR_TURB_TYPE_BETTER,0); fz_shdr_spline_color(val,5,colors_in,&col_out);

See Also

, , fz_shdr_noise_2d, ,

Function Set

fz_shdr_fset

Defined in

fz_rzne_shdr_api.h