Skip to content

RandallLiuXin/GodotMaker / skills/reviewer/shader

shader-review

Verified

Reviews Godot Shader/Material implementation for known pitfalls. Triggers AFTER implementation, when code involves ShaderMaterial, set_shader_parameter, .gdshader, VisualShader, hint_screen_texture, BackBufferCopy, instance uniform, or uniform declarations. Do NOT use this skill for planning or teaching — only for post-implementation review.

FileKindSize
SKILL.mdskill md1.2 KB
checklist.mdmarkdown2.2 KB
gotchas.mdmarkdown4.0 KB

checklist.md

View on GitHub
# Shader Checklist

Automated checks to run after implementation. Each check maps to a gotcha.

## Static Checks

### S1. Uniform type match → G1
For every `set_shader_parameter("name", value)` call in scripts:
- Resolve which `.gdshader` the material references
- Check the `uniform` declaration type matches the passed value type
- Flag: `int` literal for `float` uniform, wrong vector dimension, non-Texture2D for `sampler2D`

### S2. Shared material mutation → G2
For every `set_shader_parameter()` call in scripts:
- Check target material is either `.duplicate()`'d, `resource_local_to_scene = true`, or assigned to a single node
- Flag: `node.material.set_shader_parameter(...)` without prior duplication on a material used by multiple nodes

### S3. instance_uniform scope → G3
Scan all `.gdshader` files:
- If `shader_type canvas_item` and `instance uniform` both appear → flag (3D-only)
- If `instance uniform sampler2D` appears in any shader type → flag (textures not supported)

### S4. 3D screen texture transparency → G5
If a `spatial` shader uses `hint_screen_texture` and the scene contains transparent meshes:
- Flag that transparent objects will not appear in the capture
- Verify design explicitly accounts for opaque-only limitation

### S5. 2D screen texture capture order → G4
Grep `.gdshader` files with `shader_type canvas_item` for `hint_screen_texture`:
- If 2+ nodes in the same scene use shaders with `hint_screen_texture`: flag
- Must have BackBufferCopy node between each consecutive pair of screen-reading nodes
- N screen-reading nodes require N-1 BackBufferCopy nodes

## Runtime Checks

### R1. Material independence test → G2
Two nodes sharing the same shader with `resource_local_to_scene = true`:
- Set different parameter values on each
- Assert visual difference between the two nodes

### R2. Screen-reading order test → G4
Two overlapping sprites both using `hint_screen_texture`:
- Without BackBufferCopy → assert second sprite shows stale image
- With BackBufferCopy between them → assert both show correct result

## Compilation

```bash
{godot_path} --headless --quit 2>&1
```
Pass: exit code 0, no `SHADER ERROR` or `Parse Error` in output.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall