lens-studio-materials-shaders

Installation
SKILL.md

Lens Studio Materials & Shaders — Reference Guide

Lens Studio uses a graph-based Material Editor to create shaders, combined with a runtime TypeScript API for modifying material properties. Most visual customization flows through RenderMeshVisual.material.


The Golden Rule: Clone Before Modify

Materials in Lens Studio are shared assets — multiple scene objects can use the same material. Modifying it directly changes every object using it. Always clone first:

const meshVisual = this.sceneObject.getComponent('Component.RenderMeshVisual')

// BAD: modifies the shared asset, affecting all objects
meshVisual.material.mainPass.baseColor = new vec4(1, 0, 0, 1)

// GOOD: clone creates a per-instance copy
const mat = meshVisual.material.clone()
meshVisual.material = mat
Related skills

More from rolandsmeenk/lensstudioagents

Installs
6
GitHub Stars
5
First Seen
Mar 5, 2026