Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

field.call

A function of a prelude shader module of kernels/ applied to fields.

The only way a node names device code: rand, noise, color and the modules added beside them define the functions, and this node applies one to its operands as a field a consumer evaluates in the same dispatch as the chain around it. A name stands for the function of that name or for its <name>2 / <name>3 form whose vector parameters take the operands' widths, so zero_proc_value reads a plane or a space by the position it is given. The operands follow the function's own parameters: zero_proc_value takes a seed and a position, zero_flow_worley a seed, a position and a jitter. Operands that fit no form of the name are refused, naming the forms and the widths given.

Inputs

  • fn (String). Default "". The function's name, for example zero_proc_value (the plane or the space form is picked by the position's width) or zero_flow_worley.
  • args (List<Value>). The operands, in the function's parameter order: numbers, vectors, Columns or Fields. A number given to an integer parameter is converted; a number given to a vector parameter is widened.

Outputs

  • field: a field of the function's result type.

Example

local points = g.points.grid({ countX = 4, countZ = 1, spacing = 1 })
local out = g.attribute.set({ geometry = points, name = "v", value = g.field.call({ fn = "zero_proc_value", args = { 1, g.field.position() } }) })

Value noise of each point's position, seed 1.