Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

instances.set_material (procNode)

Dress every point of a population with one material: each point's Material, read when the points are drawn (io.output). instances.realize takes the material of the merged geometry through its own material input. The record kind the material names is stated on the detail attribute records.

Inputs

  • instances (Points). The set to dress. It comes out carrying the material on every point.
  • material (Points or AssetRef<material>, optional). The material for the whole set: what a material node answers (material.pbrMat, material.shader, io.import of a material), or a reference to a material asset, written asset.resolve("<identity>", "material"). Unwired, the set comes out as it went in.

Outputs

  • instances (Points). The set wearing the material.
local rocks = g.instances.on_points({ source = g.mesh.sphere({}), points = g.points.grid({ countX = 2, countZ = 2, spacing = 3 }) })
local mossy = g.instances.set_material({ instances = rocks, material = g.material.pbrMat({ baseColor = { 0.2, 0.5, 0.2, 1 } }) })