All skills
thedivergentai avatar

/godot-shaders-basics

@9d6e91e

Expert Godot shader patterns for batch-safe hitflash, alpha-scissor foliage/dissolve, screenspace postFX, depth reconstruction, triplanar, and instance uniforms — not first-shader tutorials. Trigger on draw-call batching breaks, discard vs depth-prepass, foliage shadows, post-process quads, or world-position FX. Keywords: instance uniform, ALPHA_SCISSOR, hint_screen_texture, hint_depth_texture, global uniform, sampler2DArray, canvas_item, spatial, post-processing.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-shaders-basics

This session only. Nothing lands on disk.

referencesexpert-advanced-patterns.md

≈312 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Expert advanced shader patterns

Deferred fog volume

shader_type fog;
uniform float base_density : hint_range(0.0, 10.0) = 1.0;
uniform vec3 edge_color : source_color = vec3(0.1, 0.5, 0.8);

void fog() {
    float distance_factor = clamp(-SDF, 0.0, 1.0);
    float edge_fade = pow(distance_factor, 2.0);
    DENSITY = base_density * edge_fade;
    ALBEDO = edge_color;
}

Compute particle sim (RenderingDevice overview)

See Official Docs: Compute shaders. Pattern: local RenderingDevice, storage buffer, compute_pipeline_create, dispatch workgroups — for boids/fluids beyond fragment shaders.

Shader debug visualizer

Depth / normal / UV modes on a full-screen spatial quad using hint_depth_texture and hint_normal_roughness_texture. Production depth work: depth_world_reconstruction.gdshader.

VisualShaderNodeCustom

Extend VisualShaderNodeCustom in GDScript to expose reusable math nodes in the visual editor (_get_code returns GLSL snippet).

Shader precompilation warmup

During loading: instantiate heavy scenes in front of camera, await RenderingServer.frame_post_draw, then queue_free() children — forces pipeline cache before gameplay.

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    Error: AI Analysis failed - API error after retries

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    1/3 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-shaders-basics