Agent skill

Pbr Shading

by oframe in oframe/ogpu

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

UnlicenseAuto-check passedDevelopment

Install Pbr Shading

skills CLI
$ npx skills add oframe/ogpu --skill pbr-shading -a claude-code

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

GitHub CLI
$ gh skill install oframe/ogpu pbr-shading --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/pbr-shading .claude/skills/pbr-shading && 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
pbr-shading
GitHub stars
154
Token cost
~1.6k tokens
SKILL.md length
777 words
Files
4 (incl. references)
Skills in repo
7
Repo updated
First seen
Licence
Unlicense

At a glance

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

  • Works in 2 steps: Stock shading, standard geometry → use… → **Custom shader keeps its vertex work…
  • The user wants physically based shading
  • SKILL.md covers Decide the integration shape, Workflow, Things that break silently and References
  • Calls npm

What it does

Pbr Shading is an agent skill from oframe/ogpu. Fold PBR/IBL shading into a RenderPipeline in the OGPU engine. Use whenever the user wants physically based shading, IBL, image-based lighting, metallic/roughness materials, an environment-lit mesh, "make this look like a real material", or wants to combine their own custom vertex/fragment work with the engine's PBR lighting. Also use when a mesh has no textures and needs sensible fallback (factor-only) material setup.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `evals/evals.json`, `references/js-wiring.md` and `references/wgsl-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 physically based shading
  • Image-based lighting
  • Metallic/roughness materials
  • An environment-lit mesh

Example prompts

  • “make this look like a real material”
  • “/pbr-shading”

Workflow steps

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

  1. Stock shading, standard geometry → use @modules/pbr/pbr.wgsl?raw
  2. **Custom shader keeps its vertex work (displacement, instancing, skinning,

What it can do on your machine

Read from SKILL.md and the folder at commit 8ebfacd. 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

Pbr Shading loads about 1.6k tokens when it runs, and up to ~6.1k if it reads all its reference files. Until then it costs about 109 tokens; SKILL.md has 777 words of instructions outside code blocks.

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

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 8ebfacd, republished under its Unlicense licence (© oframe). 777 words, ~1,638 tokens.

Download SKILL.mdSave it as .claude/skills/pbr-shading/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
pbr-shading
description
Fold PBR/IBL shading into a RenderPipeline in the OGPU engine. Use whenever the user wants physically based shading, IBL, image-based lighting, metallic/roughness materials, an environment-lit mesh, "make this look like a real material", or wants to combine their own custom vertex/fragment work with the engine's PBR lighting. Also use when a mesh has no textures and needs sensible fallback (factor-only) material setup.

Fold PBR shading into a RenderPipeline

The engine has a complete PBR implementation in src/modules/pbr/pbr.wgsl (metallic-roughness + IBL: prefiltered specular cube, SH irradiance, split-sum BRDF LUT). There is no runtime shader-chunk system — integration means copying the right WGSL pieces into the target shader and wiring the right JS resources. This skill tells you which pieces, in what order, and what breaks silently if you get it wrong.

Decide the integration shape

  1. Stock shading, standard geometry → use @modules/pbr/pbr.wgsl?raw directly as the pipeline code. No WGSL editing. Works when the mesh just needs to look PBR-lit and the vertex stage is plain MVP transform.
  2. Custom shader keeps its vertex work (displacement, instancing, skinning, procedural normals) → fold the PBR fragment stage into the user's WGSL. Read references/wgsl-folding.md for exactly which blocks to copy and how to splice them.

Either way the JS wiring (IBL resources, fallback textures, bind group) is the same — references/js-wiring.md has the full copy-paste blocks.

Workflow

  1. Read the target pipeline/shader and its geometry. Confirm attribute ORDER — webgpu-utils assigns @location by declaration order in the data object, not by name. pbr.wgsl expects position (loc 0), normal (loc 1), uv (loc 2). A geometry declared {position, normal, texcoord} works (third attr lands on loc 2 regardless of name); {position, uv, normal} silently shades garbage.
  2. Wire IBL resources (specular cube + SH buffer + BRDF LUT + sampler). Copy initIBL() from examples/gltf/GLTF.js or examples/pbrshader/PBRShader.js — they are the canonical block. loadIBLCubeMap returns mipLevels; pass it back to the pipeline as constants: { roughnessLevels: ibl.mipLevels } or the roughness→lod mapping is wrong. Default environment assets: ./assets/pbr/artistworkshop_oct.exr (specular env) + ./assets/pbr/artistworkshop_sh.json (precomputed 9-coeff diffuse-irradiance SH, consumed by loadSphericalHarmonics).
  3. Resolve material textures. For every map the user did NOT provide, bind a 2×2 solid fallback instead — never leave a binding empty (pipeline creation throws) and never branch the shader on "has texture" per-map (the material factors already make white/black fallbacks behave as pass-throughs):
    • white → tMap, tMetallicRoughness, tOcclusion, tOpacity (sample = 1.0, so the *Factor uniforms fully control the material and opacity stays fully opaque)
    • black → tEmissive (no emission), tNormal (paired with hasNormalMap: 0 so the shader keeps the geometric normal — the normal map path uses screen-space derivatives and must not run on garbage data)
  4. Set ALL Material factors once at init — they live in a separate uniform block (binding 12), not the per-frame Uniforms, so they aren't written by Mesh.draw; you own that buffer. webgpu-utils zero-initializes, and a zeroed baseColorFactor renders black. Defaults that mean "plain mid-grey dielectric": see references/js-wiring.md.
  5. Create the bind group with the device — RenderPipeline exposes pipeline.bindGroupLayout(group) and pipeline.defs, but owns no uniform buffer or createBindGroup helper. With stock pbr.wgsl the layout is fixed: 0 per-frame Uniforms (the Mesh's uniformResource slice), 1 specular cube view, 2 SH buffer, 3 BRDF LUT view, 4 iblSampler (linear, mipmap linear, clamp), 5 tMap, 6 tMetallicRoughness, 7 tNormal, 8 tOcclusion, 9 tEmissive, 10 materialSampler (linear, repeat), 11 tOpacity, 12 Material buffer.
  6. Verify with npm run build (pipeline construction / reflection errors are runtime, but build catches JS/import mistakes) and npm run validate:shaders for folded WGSL. If a dev server check is possible, load the example view and check the console for device validation errors.
Show full SKILL.md (252 more words)Show less

Things that break silently

  • The uniform block must be var<uniform> uniforms : Uniforms — reflection looks up defs.uniforms.uniforms by that exact name.
  • Mesh.draw writes only the standard per-frame fields that exist in the Uniforms struct (projection/view/model/normalMatrix/cameraPosition/ resolution/time, written by name). Keep those field names verbatim. It does NOT touch the Material block — that buffer is yours: write it once at init, and re-writeBuffer it yourself when a factor changes (e.g. from a GUI).
  • roughnessLevels is an override constant fed from the IBL build's mipLevels. Forget constants: { roughnessLevels: ibl.mipLevels } and the pipeline still builds (default 6.0), but reflections sample the wrong mip whenever the cube has a different mip count — silent, not an error.
  • Output is tonemapped (filmic) + gamma encoded in the fragment shader. If the pipeline renders into an intermediate RenderTarget that later gets its own display/post pass, don't gamma-encode twice — drop the filmic/pow tail and do it in the final pass instead.
  • When rendering into an MSAA RenderTarget, pass both targets: rt.getTargets() and sampleCount: rt.sampleCount to the RenderPipeline.
  • loadIBLCubeMap is EXR-decode + GGX-prefilter heavy; wrap the promise in renderer.trackCompile(...) so the boot overlay holds until it settles.

References

  • references/js-wiring.md — IBL init (specular cube + SH + BRDF LUT), loadSphericalHarmonics shape, roughnessLevels wiring, fallback textures, Material buffer + defaults, full 0–12 bind group (copy-paste blocks)
  • references/wgsl-folding.md — folding the PBR fragment stage into a custom shader: the Uniforms/Material/SHConstants blocks, bindings, the normal precedence (tangent vs screen-space), functions, fragment flow
  • Canonical working examples: examples/gltf/GLTF.js (stock pbr.wgsl via GLTFLoader), examples/pbrshader/PBRShader.js (stock pbr.wgsl, hand-wired, fallback textures, swizzled RMO map, debug SH/specular probes)

© 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 3 other files (references) in .claude/skills/pbr-shading of oframe/ogpu.

  • SKILL.md
  • evals/evals.json
  • references/js-wiring.md
  • references/wgsl-folding.md

Open the folder on GitHubat commit 8ebfacd

Compare with similar skills

Pbr Shading 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.

Pbr Shading compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pbr Shading this skilloframe/ogpu154—~1.6kAutomated safety check: PassUnlicense
Vercel Composition Patternssupabase/supabase111k58 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 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 58 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.

    297k 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.

    154 GitHub stars~1.4k tokensUpdated yesterday
    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.

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

    154 GitHub stars~1.4k tokensUpdated yesterday
    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…

    154 GitHub stars~1.9k tokensUpdated yesterday
    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…

    154 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Shadow Mapping

    oframe/ogpu

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

    154 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Pbr Shading

What does Pbr Shading do?

Fold PBR/IBL shading into a RenderPipeline in the OGPU engine. Pbr Shading is an agent skill from oframe/ogpu. Fold PBR/IBL shading into a RenderPipeline in the OGPU engine.

When should I use Pbr Shading?

Pbr Shading fits situations like: the user wants physically based shading; image-based lighting; metallic/roughness materials; an environment-lit mesh.

How do I install Pbr Shading in Claude Code?

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

How do I install Pbr Shading in Codex?

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

Can I use Pbr Shading 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 pbr-shading -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pbr-shading, .gemini/skills/pbr-shading, .github/skills/pbr-shading and .opencode/skills/pbr-shading in your project.

What does Pbr Shading need to run?

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

Does Pbr Shading 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 Pbr Shading 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 Pbr Shading use?

Pbr Shading 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 Pbr Shading use?

About 1.6k tokens (SKILL.md is roughly 6.6k 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 4.4k tokens, read only when the agent opens those files.

What are the alternatives to Pbr Shading?

Skills that share tags, products or a category with Pbr Shading: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k 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 Pbr Shading?

oframe (a GitHub organization) maintains it in oframe/ogpu, which has 154 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 8, 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.