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

# fz_shdr_noise_2d

Description

This is a simple utility function to create a random wiggly curve based on a x,y coordinate input value. If plotted as a graph each input value yields a value between 0.0 and 1.0, that, creates a smooth wiggly curve that progresses more or less horizontally, but without recognizable repetitive patterns. This function is similar to , but does not use the passes parameter.
fz_shdr_noise_2d can be used to create random surface patterns from 2d texture space coordinates.

Plugin Prototype

double fz_shdr_noise_2d(

fz_xy_td * | xy,
fz_shdr_turb_type_enum | type,
fzrt_int | nimpulses )

Parameters

xy [Input]

The input value

type [Input]

The turbulence type

nimpulses [Input]

The number of impulses if type is FZ_SHDR_TURB_TYPE_BEST. The higher the value, the more random the pattern. Higher values also cause this function to execute slower. A value of 3 is a good default.

Range: 1 <= nimpulses <= 10

Returns

noise value in the range 0.0 to 1.0

Availability

5.0.0.0

Plugin Example

The example below creates a random pattern of black and white spots :
fz_shdr_get_tspace_st(&st); val = fz_shdr_noise_2d(&st,FZ_SHDR_TURB_TYPE_BETTER,0); if ( val < 0.5 ) col = black; else col = white;

See Also

Function Set

fz_shdr_fset

Defined in

fz_rzne_shdr_api.h