Srib view
Skill sayonsom/srib-godot-skills-demo/.claude/skills/srib-view
Implement view-layer features in the SRIB Godot 4.6 Android 3D SmartThings home app — shaders (.gdshader), materials, lighting, post-processing, viewports, camera effects, particle systems, and the project's 3-tier shader system. Use when a feature is about how something looks or renders. Triggered by: "srib-view", "implement the shader", "fix the visual", "make the glow effect", "update the material", "lighting change", or any SRIB ticket classified as "view" by srib-identify. Do NOT use for animation math (srib-model) or connecting data to the visual (srib-integration). Always read the ticket from issues/SRIB-NNN.md before starting.From its SKILL.md
npx -y skills add sayonsom/srib-godot-skills-demo --skill srib-viewAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.2 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it
srib-view
Project: SRIB — Godot 4.6 Android application with a 3D SmartThings home view. Role: Rendering and visual layer. Everything about how the 3D home scene looks.
Invocation
srib-view SRIB-NNN
Read issues/SRIB-NNN.md for the full spec. If no ticket is given, ask the user to describe the visual feature and confirm the scope before implementing.
The 3-Tier Shader System
This project organises shaders into three tiers. Identify which tier a new feature belongs to before writing any code.
| Tier | Purpose | Examples | File location |
|---|---|---|---|
| Tier 1 — Base material | Per-object surface appearance: color, roughness, metallic, emissive | Wall paint, floor texture, furniture base coat | generated_shaders/tier1_<object>.gdshader |
| Tier 2 — State overlay | SmartThings device state reflected in appearance: on/off, active, alert | Light on = warm emissive, door open = highlight ring, leak = pulse | generated_shaders/tier2_<device>_state.gdshader |
| Tier 3 — Post-FX / global | Scene-wide effects: ambient glow, depth of field, vignette, color grade | Night mode, focus highlight, selection outline | generated_shaders/tier3_<effect>.gdshader or existing shaders/ |
When in doubt, ask: does this affect one object (Tier 1), reflect device state (Tier 2), or change the whole scene (Tier 3)?
Workflow
Step 1 — Read the ticket and locate relevant files
cat issues/SRIB-NNN.md
find . -name "*.gdshader" | head -40
find . -name "*.tres" | head -20 # ShaderMaterial resources
Identify: which MeshInstance3D or CanvasItem uses this shader, which .tres material file wraps it, and which scene (.tscn) contains the node.
Step 2 — Understand the existing shader
Read the shader file before modifying it. Note:
- Existing
uniformdeclarations — any new uniform must not collide - Which rendering mode (
spatial,canvas_item,particles) - Whether it uses
FRAGMENT,VERTEX, or both
Step 3 — Implement the change
GDShader structure:
shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_burley, specular_schlick_ggx;
// Uniforms — driven by srib-integration via set_shader_parameter()
uniform vec4 base_color : source_color = vec4(1.0);
uniform float emissive_strength : hint_range(0.0, 5.0) = 0.0;
uniform float roughness : hint_range(0.0, 1.0) = 0.5;
void fragment() {
ALBEDO = base_color.rgb;
EMISSION = base_color.rgb * emissive_strength;
ROUGHNESS = roughness;
}
Mobile GPU rules (Android GLES3 / Vulkan Mobile):
- Use
lowpormediumpprecision qualifiers on non-critical floats to save ALU cycles - Avoid
discardin fragment shaders — breaks early-z on Mali/Adreno - Avoid dynamic array indexing; unroll loops manually when N ≤ 4
- Texture samples: use
hint_default_white/hint_normalhints so the editor provides defaults - Max 4 texture samples per fragment shader on low-end targets
- No
varyingarrays — usevec4packing
Naming conventions:
- Shader file:
tier<N>_<object_or_effect>_<variant>.gdshader - Uniform names:
snake_case, descriptive (e.g.,emissive_strengthnote) - ShaderMaterial resource: same base name,
.tresextension
Step 4 — Create or update the ShaderMaterial resource
If a .tres file already exists for this material, update it. If not, create one:
[gd_resource type="ShaderMaterial" load_steps=2 format=3]
[ext_resource type="Shader" path="res://generated_shaders/tier2_light_state.gdshader" id="1_abc"]
[resource]
shader = ExtResource("1_abc")
shader_parameter/base_color = Color(1, 1, 1, 1)
shader_parameter/emissive_strength = 0.0
Step 5 — Test the visual
- Open the relevant scene in the Godot editor
- Play Scene (F6) — check Output panel for shader errors
- Verify the visual matches the acceptance criteria screenshot or description
- Check on mobile: shader errors that are silent on desktop often crash on Android (wrong precision, missing extension)
Common shader patterns for SRIB
Device ON/OFF state (Tier 2)
uniform float device_on : hint_range(0.0, 1.0) = 0.0;
uniform vec4 on_color : source_color = vec4(1.0, 0.9, 0.6, 1.0); // warm white
uniform vec4 off_color : source_color = vec4(0.2, 0.2, 0.2, 1.0);
void fragment() {
ALBEDO = mix(off_color.rgb, on_color.rgb, device_on);
EMISSION = on_color.rgb * device_on * 1.5;
}
Pulse / breathing effect (Tier 2, driven by model)
uniform float pulse_phase : hint_range(0.0, 1.0) = 0.0; // set every frame by model
uniform vec4 pulse_color : source_color = vec4(1.0, 0.3, 0.1, 1.0);
void fragment() {
float intensity = pulse_phase; // model handles the sine wave
EMISSION = pulse_color.rgb * intensity;
}
Selection / hover highlight (Tier 3 via outline)
Use Godot's built-in next_pass with a back-face cull-front shader for an outline effect. See existing shaders/ for the project's existing outline shader if one exists.
Two-tone shadow (existing in project)
The project has furniture_two_tone_shadow shader — extend rather than replace when adding furniture visual states.
Acceptance checklist
- Shader compiles without errors (Output panel clean)
- Visual matches the ticket description / screenshot
- No new uniforms shadow existing ones (check all
.tresthat use this shader) - Tested on Play Scene (F6) in editor
- Tested on Android (or confirmed mobile-safe precision qualifiers)
- ShaderMaterial
.tresupdated with any new uniform defaults - No regressions in other scenes using the same shader
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.