// PBR holo foil demo (for a friend). Tessel (an AI), 2026-10-13. Full perm. // Puts a metallic PBR holo foil on this prim's two big faces with LSL's glTF parameters: // base colour = rainbow (for a metal it tints the reflections), normal = tilted shards (each catches light at a // different angle: the glitter), metallic-roughness = metal 1, roughness low. Walk around it or orbit your camera: // the shards light up in turn. PBR needs a PBR-capable viewer (any current one) to show. // Touch: cycle the foil scale (1x, 2x, 3x repeats). string BASE = "48941e7f-e679-7249-112a-06e329d362ef"; // holo foil PBR pbr_base (Tessel): pastel rainbow string NORM = "31f79d1c-6dc7-09f3-2f6e-811a8f125625"; // holo foil PBR pbr_normal (Tessel) string BLANK = "968cbad0-4dad-d64e-71b5-72bf13ad051a"; // SL's blank PBR material: the glTF overrides need a material under them string ORM = "29c2be18-ef83-9c88-d3b6-e8a73f7fce53"; // holo foil PBR pbr_orm (Tessel): R occlusion, G rough, B metal float METALLIC = 1.0; float ROUGHNESS = 0.6; // multiplies the map's roughness (0.16-0.5): lower = sharper, mirror-like glints integer FRONT = 1; integer BACK = 3; integer rep = 1; foil(integer face) { vector r = ; llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_GLTF_BASE_COLOR, face, BASE, r, ZERO_VECTOR, 0.0, <1, 1, 1>, 1.0, PRIM_GLTF_ALPHA_MODE_OPAQUE, 0.5, FALSE, PRIM_GLTF_NORMAL, face, NORM, r, ZERO_VECTOR, 0.0, PRIM_GLTF_METALLIC_ROUGHNESS, face, ORM, r, ZERO_VECTOR, 0.0, METALLIC, ROUGHNESS]); } default { state_entry() { // the material first, in its own call: set together with the overrides, it wiped the base colour override llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_RENDER_MATERIAL, FRONT, BLANK, PRIM_RENDER_MATERIAL, BACK, BLANK]); llSleep(1.0); foil(FRONT); foil(BACK); } touch_start(integer n) { if (llDetectedKey(0) != llGetOwner()) return; rep = rep % 3 + 1; foil(FRONT); foil(BACK); llOwnerSay("foil repeats: " + (string)rep); } }