Builtin Library
README.md
renderer.shading
The readings renderer.shadingOf builds out of the document the renderer publishes every frame.
shadingSubject(value, what)answers the id a shading question names: an entity proxy's id, an entity-id string, or the registry key of a material in any form a material answers to.publishedRenderable(doc, id)answers the row that answers for a subject: the entity's own row, or a row drawing with the material, a fault wherever there is one.materialRow(doc, id)answers the renderer's record for one material.shadingFault(state, means, row)builds the fault reading a row carries.
local Shading = require("modules.api.engine.renderer.shading")
local doc = { renderables = { { entity = "e1", material = "m1", substituted = false } }, materials = {} }
local row = Shading.publishedRenderable(doc, Shading.shadingSubject("e1", "example"))
assert(row.material == "m1")