webgl-shader-constraints

webgl-shader-constraints is a skill for Claude Code, Codex from adevra/unity-shader-agent-skills. It costs 36 tokens per session (2,177 once invoked), scanned A, original, MIT.

Guidelines for writing Unity shaders that work in WebGL, the technology used to run games and graphics in web browsers.

In plain words
What is it for?
Use it when deploying Unity shaders to WebGL 1.0 or 2.0, handling loops and array indexing, reducing shader variants, or troubleshooting web-only failures.
Why use it?
It explains browser-specific shader restrictions and ways to avoid compilation errors, excessive build sizes, and unsupported code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when deploying Unity shaders to WebGL 1.0 or 2.0, handling loops and array indexing, reducing shader variants, or troubleshooting web-only failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/adevra/unity-shader-agent-skills/webgl-shader-constraints
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add adevra/unity-shader-agent-skills --skill webgl-shader-constraints
Clone the repo
git clone --depth 1 https://github.com/adevra/unity-shader-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for webgl-shader-constraints

README.md
[![agentmods](https://agentmods.dev/badge/skills/adevra/unity-shader-agent-skills/webgl-shader-constraints/github.svg)](https://agentmods.dev/skills/adevra/unity-shader-agent-skills/webgl-shader-constraints)
Your own site
<a href="https://agentmods.dev/skills/adevra/unity-shader-agent-skills/webgl-shader-constraints"><img src="https://agentmods.dev/badge/skills/adevra/unity-shader-agent-skills/webgl-shader-constraints/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for webgl-shader-constraints

Your own site · 80×15
<a href="https://agentmods.dev/skills/adevra/unity-shader-agent-skills/webgl-shader-constraints"><img src="https://agentmods.dev/badge/skills/adevra/unity-shader-agent-skills/webgl-shader-constraints.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,177 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.02177
Opus 5 $0.00018 $0.01089
Sonnet 5 $0.00007 $0.00435
Haiku 4.5 $0.00004 $0.00218

Measured 11d ago against content hash 1eab92fd5584, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

webgl-shader-constraints scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/webgl-shader-constraints/SKILL.md · 203 lines

How it starts

The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.

WebGL Shader Constraints and Workarounds for Unity

TRIGGER

Use this skill when the user is developing Unity shaders for WebGL browser deployment. Triggers include: "WebGL", "browser game", "web build", "WebGL 1.0", "WebGL 2.0", "WebGPU", "GLSL", "OpenGL ES 2.0/3.0", "shader compilation web", "web build size", "shader variants web", "Always Included Shaders", or any mention of deploying Unity content to browsers. Also trigger when the user reports shader errors only on web builds, or when dealing with build size issues related to shaders.


CORE RULES

  1. WebGL 1.0 (OpenGL ES 2.0) forbids dynamic array indexing. You can only index arrays with constants or loop counter variables. This is the #1 cause of shader failures on WebGL 1.0.

  2. WebGL 1.0 only allows counting for loops. No while loops, no do-while loops. The loop counter must be initialized, compared, and incremented in the for statement. The loop bound must be a constant expression.

  3. WebGL 2.0 (OpenGL ES 3.0) removes loop and indexing restrictions but adds mandatory precision qualifiers. All variables must have explicit precision (highp, mediump, lowp) or use the default precision statement.

  4. WebGL only supports baked GI and non-directional lightmaps. No real-time GI, no directional lightmaps, no light probes with L2 spherical harmonics.

  5. Never use the Standard Shader for WebGL builds. It compiles hundreds of variants and can add 50MB+ to build size. Use Simple Lit, Unlit, or custom shaders with minimal keywords.

  6. Aggressively strip shader variants for web. Every variant increases download size and initial shader compilation time (which blocks the main thread in the browser).


WEBGL 1.0 vs 2.0 FEATURE COMPARISON

Feature WebGL 1.0 (ES 2.0) WebGL 2.0 (ES 3.0)
Array indexing Constants/loop index only Dynamic indexing allowed
Loops Counting for only All loop types
GPU instancing No Yes
3D textures No Yes
Texture arrays No Yes
Integer textures No Yes
texelFetch No Yes
Uniform Buffer Objects No Yes
Vertex texture units 0 guaranteed ≥16 guaranteed
MRT (Multiple Render Targets) No Yes
Deferred rendering Not possible Possible (but expensive)
Directional lightmaps No No (Unity limitation)
Precision qualifiers Optional Mandatory

Read the full file on GitHub · 203 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 203 lines · 36 tokens per session scan A 1eab92fd5584

Subscribe to this mod's changes

webgl-shader-constraints is a skill published in the GitHub repository adevra/unity-shader-agent-skills (9 stars, last pushed 5mo ago), licensed MIT. It adds 36 tokens to every session and 2,177 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

threejs-docs

Comprehensive Three.js reference covering core API (objects, cameras, lights, materials, geometries, renderers, scenes, textures, math, animation, audio, loaders, helpers, nodes), all addons (controls, postprocessing, loaders, exporters, geometries, shaders, WebXR, physics), TSL (Three.js Shading Language) functions…

pledgeandgrow/pledge-skills · 112 tokens

html-to-ugui

A pipeline for turning HTML interface prototypes into Unity UGUI Prefabs, which are reusable Unity interface objects. It uses browser-rendered layout data to preserve positions, images, text, controls, and device-adaptation intentions.

Alex-Rachel/TEngine · 150 tokens

pixijs-rendering

Build a PixiJS v8 render layer: create the async Application, load textures with Assets, compose the scene graph with Container and Sprite, drive the ticker loop, wire pointer events, and group draws with render groups. Use when building or debugging PixiJS v8 — when the user mentions PixiJS, Pixi, Application…

gamedev-skills/awesome-gamedev-agent-skills · 101 tokens

component-system

Use when building reusable node components — composition patterns, component communication, and interface design.

jame581/GodotPrompter · 19 tokens

godot-ui

Use when building user interfaces — Control nodes, themes, anchors, containers, and layout patterns.

jame581/GodotPrompter · 22 tokens

inventory-system

Use when building inventory systems — Resource-based items, slot management, stacking, and UI binding.

jame581/GodotPrompter · 21 tokens