Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

material

Materials made from any surface shader, with every property the shader declares set, animated or wired from the graph.

procgen.searchNodes("", { pack = "material" }) lists the family and procgen.describeNode("op.<id>") describes any one of them.

Ops

  • material.shader: a material from a surface .shader. Each property its properties.yaml declares is set by name in properties, as a constant, an animated value or a wired output, and each texture slot by name in textures. blend, cull and depthWrite set how it draws. A shader that declares a buffer property reads, through elements, one vec4 per live element another part of the graph made.

shader is a reference, written asset.resolve("<identity>", "shader"); a name alone is refused.

local ember = g.op.material.shader({ shader = asset.resolve("@builtin::shaders.unlit", "shader"),
    properties = { base_color = { r = 1, g = 0.5, b = 0.1, a = 1 } }, blend = "additive", depthWrite = "false",
    cull = "none" })

material.pbr, the metallic-roughness material, comes with the texture pack.

g.material.shader and g.material.pbrMat, nodes of the material nodebox, answer one element holding the material record (records/material.procRecord), which any input taking a material takes, io.output shows and io.export saves as a .material.