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

fz_shdr_spline_value

Description

This function can only be called inside the pixel callback function when implementing a plugin or script shader. It computes a smoothly blended float value from a list of individual float values. 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 values, and the fval argument is below 0.25, the first float value is returned. If fval is around 0.25, a mixture between the first and second float value is returned. If it is between 0.25 and 0.5 the second float value is returned, etc. For example, this function can be combined with a turbulence function to create a pattern of random amplitude values for a bump shader or transparency values for transparency shader.

Plugin Prototype

fzrt_int fz_shdr_spline_value(

double

val,

fzrt_int

nvals,

double *

dvals,

double *

val_out )

Parameters

val [Input]

The parametric value.

Range: 0.0 <= val <= 1.0

nvals [Input]

The number of float values in the float array.

Range: nvals >= 4

dvals [Input]

The float values array.

val_out [Result]

The computed float values.

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_value(val,5,amp_in,&_out);

See Also

, , fz_shdr_noise_2d, , fz_shdr_spline_color

Function Set

fz_shdr_fset


Defined in

fz_rzne_shdr_api.h