Files
settled-reach/spikes/3dpipeline/shaders/spike/toon.gdshader
T
jpmschweitzerandClaude Opus 4.6 f204bf3372 feat(assets): add 3D pipeline spike — Trellis to Godot with recoloring
Proves the full asset pipeline: concept image → Trellis 3D → Blender
post-process → Godot render with toon shader and recolor masks.

Key findings:
- gltf/embedded_image_handling=3 required (extract mode silently fails)
- Luminance-preserving recolor shader keeps texture detail
- Trellis output quality is sufficient for isometric game assets
- Camera uses pivot-based system with screen-aligned WASD pan

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 23:33:35 +01:00

17 lines
571 B
Plaintext

shader_type spatial;
render_mode unshaded;
uniform vec4 base_color : source_color = vec4(0.8, 0.6, 0.4, 1.0);
uniform vec4 shadow_color : source_color = vec4(0.4, 0.3, 0.2, 1.0);
uniform float shadow_threshold : hint_range(0.0, 1.0) = 0.5;
void fragment() {
// Simple toon shading: use normal dot light to pick between base and shadow
vec3 light_dir = normalize(vec3(0.3, -1.0, 0.5));
float ndl = dot(NORMAL, -light_dir);
float toon = step(shadow_threshold, ndl);
vec3 color = mix(shadow_color.rgb, base_color.rgb, toon);
ALBEDO = color;
ALPHA = base_color.a;
}