Agent skill

Shadow Mapping

by oframe in oframe/ogpu

Fold real-time shadow mapping into an existing RenderPipeline/shader in the OGPU engine.

UnlicenseAuto-check passedDevelopment

Install Shadow Mapping

skills CLI
$ npx skills add oframe/ogpu --skill shadow-mapping -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install oframe/ogpu shadow-mapping --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/oframe/ogpu.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/shadow-mapping .claude/skills/shadow-mapping && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
shadow-mapping
GitHub stars
151
Token cost
~1.9k tokens
SKILL.md length
872 words
Files
2 (incl. references)
Skills in repo
7
Repo updated
First seen
Licence
Unlicense

At a glance

Fold real-time shadow mapping into an existing RenderPipeline/shader in the OGPU engine.

  • Works in 3 steps: Static geometry (vertex attributes) →… → Skinned / compute-positioned / displaced… → IBL-only / ambient-only shader (no…
  • The user wants cast shadows
  • SKILL.md covers Decide the integration shape, Workflow, Things that break silently and References
  • Calls npm

What it does

Shadow Mapping is an agent skill from oframe/ogpu. Fold real-time shadow mapping into an existing RenderPipeline/shader in the OGPU engine. Use whenever the user wants cast shadows, a depth-pass / shadow-map shadow, a character or mesh to drop a shadow on a floor, self-shadowing, PCF soft shadows, "make it cast a shadow", "add shadows", or real-time shadows on a custom (skinned, displaced, instanced, IBL-lit) shader. Covers the depth-only caster pass + the receiver sampling fold.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/folding.md`).

It sits in Development. The repository describes itself as: Minimal WebGPU Library. The licence is Unlicense.

When your agent uses it

  • The user wants cast shadows
  • A depth-pass / shadow-map shadow
  • Mesh to drop a shadow on a floor
  • PCF soft shadows

Example prompts

  • “make it cast a shadow”
  • “add shadows”
  • “/shadow-mapping”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Static geometry (vertex attributes) → caster shader is a vertex-only
  2. Skinned / compute-positioned / displaced geometry → the caster MUST pull
  3. IBL-only / ambient-only shader (no punctual light) → there is nothing for

What it can do on your machine

Read from SKILL.md and the folder at commit 65e0a1a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Shadow Mapping loads about 1.9k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 112 tokens; SKILL.md has 872 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~112
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from oframe/ogpu at commit 65e0a1a, republished under its Unlicense licence (© oframe). 872 words, ~1,865 tokens.

Download SKILL.mdSave it as .claude/skills/shadow-mapping/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
shadow-mapping
description
Fold real-time shadow mapping into an existing RenderPipeline/shader in the OGPU engine. Use whenever the user wants cast shadows, a depth-pass / shadow-map shadow, a character or mesh to drop a shadow on a floor, self-shadowing, PCF soft shadows, "make it cast a shadow", "add shadows", or real-time shadows on a custom (skinned, displaced, instanced, IBL-lit) shader. Covers the depth-only caster pass + the receiver sampling fold.

Fold shadow mapping into a RenderPipeline

The engine has no shadow primitive. Shadow mapping is two passes you wire by hand: (1) a depth-only caster pass that renders the occluders from the light's POV into a depth RenderTarget, and (2) receivers that sample that depth map with a comparison sampler + PCF and darken their lighting. There is no shader-chunk system — integration means copying the WGSL pieces into the target shader and wiring the JS. This skill says which pieces and what breaks silently.

Two canonical, working implementations already in the repo — read the one that matches the geometry:

  • examples/shadowmapping/ — static geometry (plain vertex attributes). shadow.wgsl caster, mesh.wgsl receiver. The minimal reference.
  • examples/skinninggltf/ — skinned + IBL character. shadowcaster.wgsl pulls skinned positions from the Skin compute buffer so the cast shadow tracks the animation; skinnedmesh.wgsl receives (self-shadow), floor.wgsl receives (contact shadow). The reference for any compute/skinned/IBL case.

Decide the integration shape

  1. Static geometry (vertex attributes) → caster shader is a vertex-only MVP * position from the light camera. Copy examples/shadowmapping/shadow.wgsl.
  2. Skinned / compute-positioned / displaced geometry → the caster MUST pull position the same way the main vertex stage does (same storage buffer, same @builtin(vertex_index) indexing) or the shadow detaches from the animated mesh. Copy examples/skinninggltf/shadowcaster.wgsl.
  3. IBL-only / ambient-only shader (no punctual light) → there is nothing for a shadow to occlude. Add a directional light gated by the shadow factor, or the "shadow" does nothing visible. See references/folding.md.

The JS wiring (depth target, light camera, caster mesh, shadow uniform, comparison sampler, receiver bindings, two-pass render loop) is the same shape in every case — references/folding.md has the copy-paste blocks.

Workflow

  1. Read the target shader + its geometry and render loop. Note how the main vertex stage gets its position (attribute vs storage buffer) — the caster must match it. Confirm the receiver's Uniforms already carries modelMatrix and viewMatrix (needed for world pos + the lit term).
  2. Depth RenderTarget: color: false, depthTexture: true, depthFormat: 'depth32float', square (SHADOW_SIZE = 2048).
  3. Light camera: orthographic ({ left, right, top, bottom, near, far }) placed at the light, lookAt(target), then updateMatrixWorld(). Ortho extents must bound the occluders — too large wastes resolution and causes acne; geometry outside the frustum is silently unshadowed. Build shadowVP = new Mat4().copy(cam.projectionMatrix).multiply(cam.viewMatrix).
  4. Caster pipeline: vertex-only WGSL — declare NO fs entry point so RenderPipeline emits no fragment stage and no color target (it auto-detects defs.entryPoints.fs). Pass depthStencil verbatim with format: 'depth32float', depthWriteEnabled: true, depthCompare: 'less', and slope bias (depthBias: 1, depthBiasSlopeScale: 1.75). Make a separate Mesh sharing the geometry (and the skin storage buffer for skinned). Set frustumCulled = false on skinned casters.
  5. Shadow uniform buffer: a Shadow { projectionViewMatrix : mat4x4f, lightDirection : vec3f } block. makeStructuredView it off any receiver pipeline's defs.uniforms.shadowUniforms, set both fields, write once. Keep the struct identical across every receiver that shares this buffer.
  6. Comparison sampler: compare: 'less', min/magFilter: 'linear', addressMode*: 'clamp-to-edge'. Bind it as sampler_comparison against a texture_depth_2d view of the target's depthTexture.
  7. Fold receiving into each receiver shader: add the Shadow uniform + sampler_comparison + texture_depth_2d bindings and an override shadowDepthTextureSize. Vertex computes vShadowCoord (NDC→UV, flip y). Fragment runs PCF (shadowVisibility) and gates the light term. Full blocks in references/folding.md.
  8. Render loop: render the caster scene to the depth target with the light camera FIRST, then the lit scene with the real camera: renderer.render({ scene: casterMesh, camera: lightCamera, target: shadowBuffer }) then renderer.render({ scene, camera }).
  9. Verify: npm run validate:shaders (folded WGSL) and npm run build. The repomap also indexes examples/, so if you add files run npm run repomap before commit or the drift gate blocks it.
Show full SKILL.md (292 more words)Show less

Things that break silently

  • Caster must have no fs. A vertex-only module gives a color-target-free pipeline that matches the depth-only target. Adding an empty fs "to satisfy the builder" forces a color target the depth-only render pass can't supply.
  • Shadow-coord y flip. WebGPU clip-space y is opposite texture v: vShadowCoord = vec4f(ndc.xy * vec2f(0.5, -0.5) + 0.5, ndc.z, 1.0). Wrong sign mirrors the shadow off the caster.
  • Two-tier depth bias. depthBias/depthBiasSlopeScale live on the caster pipeline; the receiver subtracts a small constant from shadowCoord.z (~0.002) in the compare. Too little → shadow acne (self-stripes); too much → peter-panning (shadow detaches from contact point). Tune both.
  • Comparison binding types are not the color ones. A compare sampler must be sampler_comparison + texture_depth_2d and sampled with textureSampleCompare. A normal sampler/texture_2d<f32> won't compile against it (and vice-versa).
  • Skinned caster index must match the main stage. Same storage buffer, same vertexIndex * 3 stride. A mismatch makes the shadow drift off the mesh while the visible mesh looks fine.
  • Shared shadow uniform layout. Every receiver sampling the same shadowUniformBuffer must declare an identical Shadow struct (keep lightDirection even if a receiver ignores it) or std140 offsets diverge.
  • IBL-only shaders need an added light. Multiplying IBL ambient by the shadow factor wrongly darkens the whole object. Gate an added directional term instead; leave the ambient/IBL untouched.
  • depth32float is fine for comparison sampling but can't be linearly filtered as a color texture — don't bind it for display/debug without a copy.

References

  • references/folding.md — full copy-paste blocks: the caster WGSL (static + skinned), the receiver fold (bindings, Shadow struct, vShadowCoord, hash22+shadowVisibility PCF, light gating incl. the IBL+directional case), and the JS (depth target, light camera, caster pipeline+mesh, shadow uniform, comparison sampler, receiver bind-group entries, two-pass render loop).
  • Canonical working examples: examples/shadowmapping/ (static), examples/skinninggltf/ (skinned + IBL self-shadow + contact-shadow floor).

© oframe, Unlicense. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .claude/skills/shadow-mapping of oframe/ogpu.

  • SKILL.md
  • references/folding.md

Open the folder on GitHubat commit 65e0a1a

Compare with similar skills

Shadow Mapping next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Shadow Mapping compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Shadow Mapping this skilloframe/ogpu151—~1.9kAutomated safety check: PassUnlicense
Vercel Composition Patternssupabase/supabase111k59 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 59 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from oframe/ogpu

  • Scaffold Shader

    oframe/ogpu

    Scaffold a new simple WGSL shader for the OGPU engine, wired for a RenderPipeline + Mesh.

    151 GitHub stars~1.4k tokensUpdated 11 days ago
    Auto-check passed
  • Scaffold App

    oframe/ogpu

    Scaffold a new OGPU example/app from scratch — a Renderer + Camera + Orbit + update loop and a single spinning cube wired through the vanilla Box primitive - RenderPipeline - Mesh setup.

    151 GitHub stars~1.1k tokensUpdated 11 days ago
    Auto-check passed
  • Ground any answer about the webgpu-utils library (greggman/webgpu-utils) in its actual API before responding.

    151 GitHub stars~1.4k tokensUpdated 11 days ago
    Auto-check passed
  • Naga Setup

    oframe/ogpu

    Get naga WGSL validation working in a repo — installs the naga/jq toolchain, a PostToolUse hook that compiles every .wgsl on write, and a batch validate-shaders script, so shader checking then…

    151 GitHub stars~1.9k tokensUpdated 11 days ago
    Auto-check passed
  • Ground any answer about the WebGPU platform itself — browser support/compatibility, feature availability, limits, what's shipping or behind a flag, and exact spec behavior — in the live Chrome…

    151 GitHub stars~1.3k tokensUpdated 11 days ago
    Auto-check passed
  • Pbr Shading

    oframe/ogpu

    Fold PBR/IBL shading into a RenderPipeline in the OGPU engine.

    151 GitHub stars~1.6k tokensUpdated 11 days ago
    Auto-check passed

Categories

Questions about Shadow Mapping

What does Shadow Mapping do?

Fold real-time shadow mapping into an existing RenderPipeline/shader in the OGPU engine. Shadow Mapping is an agent skill from oframe/ogpu. Fold real-time shadow mapping into an existing RenderPipeline/shader in the OGPU engine.

When should I use Shadow Mapping?

Shadow Mapping fits situations like: the user wants cast shadows; A depth-pass / shadow-map shadow; mesh to drop a shadow on a floor; PCF soft shadows.

How do I install Shadow Mapping in Claude Code?

Run `npx skills add oframe/ogpu --skill shadow-mapping -a claude-code`. Or copy the skill folder (.claude/skills/shadow-mapping in oframe/ogpu) into .claude/skills/shadow-mapping in your project. Claude Code loads it when a task matches its description.

How do I install Shadow Mapping in Codex?

Run `npx skills add oframe/ogpu --skill shadow-mapping -a codex`. Or copy the skill folder (.claude/skills/shadow-mapping in oframe/ogpu) into .agents/skills/shadow-mapping in your project. Codex loads it when a task matches its description.

Can I use Shadow Mapping in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add oframe/ogpu --skill shadow-mapping -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/shadow-mapping, .gemini/skills/shadow-mapping, .github/skills/shadow-mapping and .opencode/skills/shadow-mapping in your project.

What does Shadow Mapping need to run?

Going by SKILL.md and its folder, Shadow Mapping needs the command-line tools its instructions call (npm).

Does Shadow Mapping access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Shadow Mapping safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Shadow Mapping use?

Shadow Mapping is published under the Unlicense licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Shadow Mapping use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.9k tokens, read only when the agent opens those files.

What are the alternatives to Shadow Mapping?

Skills that share tags, products or a category with Shadow Mapping: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Shadow Mapping?

oframe (a GitHub organization) maintains it in oframe/ogpu, which has 151 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on September 26, 2026.

Source: oframe/ogpu on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.