/ls-clad:materialsfrom ls-clad
Creates, configures, and assigns materials in Lens Studio scenes. Covers preset selection (SimplePBR, Unlit, PBR), property tweaks like baseColor and roughness, and the critical Editor vs Runtime API distinction to avoid silent failures.
Ships in ls-clad. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill for any work that can be expressed as "pick a preset and tweak its properties":
SimplePBRMaterialPreset, UnlitMaterialPreset, etc.)baseColor, metallic, roughness, or other shader-exposed properties on an existing materialbaseTex, normalTex, ...)Use a graph skill instead when the task requires editing the shader/VFX itself:
.graphShader YAML, adding a parameter that doesn't exist on any preset) → shader-graph.graphVfx, particle pipeline configuration) → vfx-graphDefault to this skill. Escalate to a graph skill only when (a) the user explicitly asks for a custom shader/VFX, or (b) no preset combined with property tweaks can produce the requested look.
Use asset-graphql to create from a preset:
mutation {
createAssetFromPreset(
presetName: "SimplePBRMaterialPreset"
name: "MyMaterial"
destinationPath: "Materials" # folder relative to Assets/ — do NOT prefix with "Assets/"
) {
id
name
}
}
Common presets:
| Preset | Description | Color setting |
|---|---|---|
SimplePBRMaterialPreset | PBR material with baseColor, metallic, roughness properties. Responds to scene lighting. | Set baseColor directly (VEC4) — no texture required for solid colors |
PBRMaterialPreset | Full PBR material requiring texture maps (baseTex, normalTex, materialParamsTex). Use when you have prepared texture assets. | Requires textures — not suitable for setting colors directly |
UnlitMaterialPreset | Renders without lighting calculations. Flat color/texture, ignores lights and shadows. | Good for UI elements, debug visuals, or flat-shaded objects |
Material properties are accessed through the passInfos.0 property path prefix:
mutation {
setProperty(
id: "material-asset-id"
propertyPath: "passInfos.0.baseColor"
value: "0.8, 0.1, 0.1, 1.0"
valueType: VEC4
)
}
| Property | Path | ValueType | Notes |
|---|---|---|---|
| Base color | passInfos.0.baseColor | VEC4 | RGBA, each 0-1 |
| Roughness | passInfos.0.roughness | NUMBER | 0 = mirror, 1 = matte |
| Metallic | passInfos.0.metallic | NUMBER | 0 = dielectric, 1 = metal |
These paths are for PBR materials (SimplePBRMaterialPreset). The passInfos.0 prefix refers to the first render pass of the material's shader graph — it is not discoverable from the GraphQL schema, it must be known. See Discovering Material Properties below for other material types.
Imported GLB (glTF) materials use different property names: metallicFactor / roughnessFactor (not SimplePBR's metallic/roughness). Their lighting mode is a preprocessor define — the string ENABLE_GLTF_LIGHTING in the pass's defines array — not a property: a GraphQL setProperty on passInfos.0.ENABLE_GLTF_LIGHTING returns success: true but changes nothing (verified silent no-op). To inspect or change it, use ExecuteEditorCode on the embedded material (assetManager.getFileMeta(sourcePath).assets.filter(a => a.isOfType('Material')) → edit passInfos[i].defines) and read the array back to confirm.
blendMode (and depthWrite) on the passSetting alpha on an editor-side material does not make it transparent on its own. The alpha rides on passInfos.0.baseColor (the .w channel), but the surface keeps compositing opaque until the pass's blendMode is switched off Disabled. Set blendMode (and depthWrite) with asset-graphql setProperty on the pass:
mutation {
setProperty(id: "<materialId>", propertyPath: "passInfos.0.blendMode",
value: "Normal", valueType: ENUM, enumType: "Editor.Assets.BlendMode") { changed after }
}
Use Normal for alpha blend and Add for additive; reading blendMode back returns its full options list and default, and the members live in the Editor.Assets.BlendMode enum — prefer the symbolic names. Set passInfos.0.depthWrite (BOOLEAN) false for transparent surfaces, true for opaque/cutout. This is the single most common "I set alpha but it's still solid" failure in editor-side scene builds.
(Runtime Lens scripts use the opposite handle: mat.mainPass.blendMode = BlendMode.Normal — see lens-api/references/materials-shaders.md. The passInfos (editor) / mainPass (runtime) split is the same Editor-vs-Runtime divide as the baseColor row in the table below.)
UberPBRMaterialPreset is the default PBR material for imported / converted content, and its shader + preset defaults cause a family of surface bugs that are otherwise chased in lighting. These are shader/preset behaviors (not visible in the type declarations) — observed against the migration material pipeline as of 2026-09; re-verify against the installed preset, since a new preset revision can change its shipped defaults:
baseColor.a × baseTex.a. The shader does Opacity *= Albedo.a, so a baseColor.a of 0 renders the surface fully invisible regardless of texture, and texture-borne transparency is missed if you only inspect the color's alpha.opacityTex samples luminance (brightness), not alpha. Binding a light-background albedo there reads as fully opaque → white shards. For alpha-cutout foliage, set ENABLE_OPACITY_TEX=false and use a cutout blendMode on baseTex's own alpha instead.ENABLE_*_TEX define is true while its slot is null/unresolved. (A color-only material with an emissive define but no emissive texture is a valid exception.) A bound-but-undecoded albedo renders black, not magenta.Base.png as the default baseTex (with ENABLE_BASE_TEX auto-on). A color-only material left untouched therefore renders baseColor × 0.5 grey — half brightness. Bind a project-local white 1×1 so color-only = baseColor × white. The preset may symmetrically ship ENABLE_NORMALMAP on with a default normal map, giving false relief to a flat surface.ENABLE_* define. To turn one OFF, read-modify-write the passInfos.N.defines array via asset-graphql setProperty (verified: a STRING-array write applies). Do not set the define as a property path (passInfos.0.ENABLE_GLTF_LIGHTING) — that's the silent no-op described above.UnlitMaterialPreset's baseTex slot is gated behind ENABLE_BASE_TEX, which is OFF by default. With the define off the slot is hidden and a setProperty on passInfos.N.baseTex reads back null (it does not bind — and the assignment does not auto-add the define here). Enable the define first (write passInfos.N.defines, see above), then set baseTex: it binds and renders the texture normally. (Verified in LS 5.25 — the texture does render; it does not show a magenta tile.)metallic surface with nothing to reflect samples black/flat. Keep water/metal metallic ~0–0.1 and get glint from low roughness ~0.1–0.25 + a ripple normal. A cubemap on a planar reflectionTex (ENABLE_SIMPLE_REFLECTION) logs texture has different texture type with uniform — that slot takes a 2D texture only.Materials are assigned to a RenderMeshVisual component, not to the scene object directly:
setProperty with REFERENCE type:mutation {
setProperty(
id: "render-mesh-visual-component-id"
propertyPath: "materials.0"
value: "material-asset-id"
valueType: REFERENCE
)
}
The id must be the RenderMeshVisual component ID, not the scene object ID. Query the scene object's components to get the RenderMeshVisual component ID (see the scene-construction skill for the components query pattern).
Screen-space Image components (created via ScreenImageObjectPreset) come with a default Image material that has specific properties for screen-space compositing:
PremultipliedAlphaAuto, required for correct screen-space renderingbaseTex, used for the Image's texture contentbaseColor on the materialDo not replace the default Image material with a custom UnlitMaterial or PBR material — it will not render correctly in screen-space. Instead, modify the existing default material's baseColor to change the Image's color. If you need a solid color with no texture, you can clear the baseTex property — but be aware this may produce a checkerboard pattern, which is Lens Studio's visual indicator that a required texture input is missing or empty.
There are two completely different APIs for working with materials. Using the wrong one causes silent failures:
| GraphQL / Editor API | Runtime Lens API | |
|---|---|---|
| Set color | setProperty(propertyPath: "passInfos.0.baseColor") | mat.mainPass.baseColor = new vec4(...) |
| Where it runs | Scene construction tools, ExecuteEditorCode | TypeScript Lens scripts (.ts files) |
| Documented in | This skill | lens-api/references/materials-shaders.md |
mat.mainPass.baseColor is runtime API only — it does not work in ExecuteEditorCode or GraphQL. The passInfos.0.baseColor path is for GraphQL/Editor API only — it does not work in Lens scripts.
The properties under passInfos.0 are shader-determined — they vary by material type and custom shader. The table above lists common SimplePBR properties, but other materials (Graph Materials, custom shaders) expose different properties entirely.
Before setting a material property, query the asset's properties field via asset-graphql to discover the actual property names available on that specific material. Look for entries prefixed with passInfos.0. — these are the settable shader properties.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
lens-studio, material-presets, pbr, graphql-api, scene-construction
npx claudepluginhub lens-studio-devs/ls-extensions --plugin ls-clad74 skills in this plugin
/build-imageGenerate a 2D image from a text prompt via SPECS text-to-image, to Assets/GeneratedImages/<Name>.png (build-mesh reference, texture, or screen-space). Transparent RGBA cutout, cropped tight, by default; opt out for an opaque image.
/build-meshGenerate a 3D mesh, model, or asset for a Lens — build, create, or make props, characters, scenery. Four peer backends chosen per asset: SPECS text-to-3D (static default — best texture fidelity, async minutes-long jobs), FAST3D (faster static AI props), code-authored MeshBuilder via the mesh-builder-scripting skill (articulated, animated, parametric TypeScript content), and Blender voxel (blocky aesthetic; the only source of rigged GLBs). GLB backends return the file plus AABB metadata so the caller can size colliders and place the mesh in the world.
/build-musicGenerate musical phrases, chord progressions, beats, jingles, and short pieces via local algorithmic synthesis. Sample-free, license-clean, fully offline. Scale-degree composition, pattern-based arrangement, frequency-separated mixing rules. Outputs 44.1 kHz stereo WAV to Assets/GeneratedSFX/./build-sfxGenerate non-pitched sound effects (UI, impacts, sweeps, foley, ambient textures, retro 8-bit) via local algorithmic synthesis. Outputs 44.1 kHz WAV to Assets/GeneratedSFX/. For musical phrases or chord progressions use /build-music instead./camera-and-renderingCamera configuration, 2D/screen-space rendering, RenderMeshVisual patterns, and visibility debugging for Lens Studio scene construction. Use when setting up cameras (orthographic/perspective), creating screen-space content (ScreenTransform, Image, Text), debugging invisible objects, or planning any scene involving rendering config./editor-apiExecuteEditorCode contract and Editor API paradigms — runtime, access patterns, gotchas, references. Use before writing Editor API TS (`pluginSystem.findInterface`, `LensStudio:*`), grepping `editor.d.ts`, or routing to scene/asset-graphql.Other plugins' skills for the same job