fantasyMaterials.package
This package holds more than this page lists. See all of its files in its world.
README.md
FantasyGlowLight
The light a glowing material throws on what is around it. Put it on an entity standing just in front of a glowing surface (a rune stone, a lava crack, a mana pool, a wisp of ectoplasm): it adds or drives a point Light on that entity — unshadowed, small radius, in the glow's colour — and pulses its intensity the way the material pulses: breathe (slow sine, runes and crystals), travel (rolling waves, the cursed stone's veins), heartbeat (the ectoplasm shader's lub-dub, same curve), flicker (fire and lava), shimmer (a mana pool), blink or steady.
Fields: color, intensity (top of the pulse, point-light scale), radius (metres), pulse, speed (cycles/s), depth (0 steady .. 1 to black), phase, material (registry name of the glowing material, e.g. fantasyMaterials.materials.ectoplasm) and syncClock.
In step with the shader: a shader's input.time is the world's gameplay seconds, which Luau cannot read directly, so every FantasyGlowLight shares one clock built from update(dt) (FantasyGallery's glow clock) and, with syncClock on, hands the material that same clock through renderer.material.setClock — the shader and its light read one time. The pulse rate (pulse_speed, or beat_rate/beat_depth for a heartbeat) is read live from the material every two seconds, so a retuned material keeps its light in step. While gameplay is paused (edit mode) the light holds its pulse's mean level, as the shader holds still. The material goes back to the world's time when the last light on it is removed. Costs one unshadowed point light and a few multiplies per frame. Used by FantasyShowcase (one per glowing gallery bay, from FantasyGallery.GLOW_LIGHTS) and FantasyShrine.