Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

Instance Color Unlit

An unlit white surface that every instance wearing it colours from its own shader-data lane 2, built on the unlit shader with instance_color_lane = 2. It draws exactly the picture Model.tint gives an unlit surface for the same colour and blend, at the cost of one renderer.instanceData.set per member and with nothing replicated, so it is the material for flat per-instance colour that changes every frame: a heat map, a stress readout, indicator lights.

renderer.instanceData.set(id, 2, 1, 0, 0, 1)    -- this member red, fully covered
renderer.instanceData.set(id, 2, 1, 0, 0, 0)    -- back to the material's white

The lane's rgb is the colour and its a is how much of it covers the material's own colour, 0 none through 1 all; a lane never written reads zero and leaves it white. Set instance_emission above 0 to add the colour again on top, scaled, for a colour that blooms.

Inputs

  • floats.instance_color_lane (2): the lane read.
  • floats.instance_emission (0): how much of the lane colour is added on top where it covers.
  • colors.base_color (white) over textures.base_color_texture (default:white): the colour under the lane colour.