Shader Programming

Write game shaders from cross-engine fundamentals — the vertex-to-fragment pipeline, coordinate spaces, UV math, and common 2D/3D effects…

You say
Buy it · $12 Read it before you buy $12 Written by gamedev-skills · unverified publisher
Context cost
3k tokensestimated from the bundle, loaded when it triggers
Bundle
2 files · 11.9 kBtext throughout, nothing executable
Licence
Apache-2.0paid listing
Last change
no release on file
Servers it uses
Noneruns standalone

What it does

Write game shaders from cross-engine fundamentals — the vertex→fragment pipeline, coordinate spaces, UV math, and common 2D/3D effects (tint, UV scroll, dissolve, outline, fresnel rim, vignette) in GLSL with HLSL equivalents. Use when the user mentions shaders, fragment/pixel shader, vertex shader, UV, GLSL, HLSL, or effects like dissolve, outline, or rim light.

Installed, it changes the agent in these ways.

What this skill changes about the agent is not written down here yet. The listing was collected from its source, and the description is in its own SKILL.md.

Expertise

Domain judgement the base model does not have.

shadersglslhlslgraphics

The skill itself

This is the whole product. A skill is instructions the model reads, so there is nothing behind the listing you cannot see first — the front matter loads with every session, and the body below it loads when the skill triggers.

SKILL.md6.8 kB · 152 lines
--- name: shader-programming description: > Write game shaders from cross-engine fundamentals — the vertex→fragment pipeline, coordinate spaces, UV math, and common 2D/3D effects (tint, UV scroll, dissolve, outline, fresnel rim, vignette) in GLSL with HLSL equivalents. Use when the user mentions shaders, fragment/pixel shader, vertex shader, UV, GLSL, HLSL, or effects like dissolve, outline, or rim light. ---
11# Shader programming (cross-engine)
12
13Shaders are small programs that run **per vertex** and **per pixel** on the GPU.
14The concepts — the pipeline, coordinate spaces, UVs, and how common effects are
15built — port across engines; only the language dialect and built-in variable
16names change. This skill teaches those portable fundamentals in GLSL with HLSL
17equivalents; use godot-shaders (or Unity/Unreal material docs) for the exact
18engine syntax and built-ins.
19
20## When to use
21
22- Use to understand or write vertex/fragment shaders and to reason about UVs,
23 coordinate spaces, and the GPU pipeline.
24- Use to build common effects: tint/recolor, scrolling textures, dissolve,
25 outlines, fresnel/rim light, vignette, color grading.
26- Use to translate a shader concept between GLSL and HLSL, or between engines.
27
28**When *not* to use:** for an engine's exact shader language and built-ins, use
29godot-shaders (Godot shading language) or the engine's material docs. For full
30particle VFX systems, see unreal-niagara. For post-process *stacks*, defer to
31the engine's renderer settings.
32
33## Core workflow
34
351. **Know which stage you're in.** The **vertex** shader transforms each vertex
36 into clip space and passes data (UVs, normals) onward; the **fragment/pixel**
37 shader runs per rasterized pixel and outputs a color. Most game effects live
38 in the fragment stage.
392. **Track coordinate spaces.** Positions move model → world → view → clip space;
40 normals belong in world or view space. Mixing spaces is the most common bug.
413. **Drive effects with UVs and time.** UVs are 0..1 texture coordinates;
42 offset, scale, or distort them, and animate with a time uniform.
434. **Work per pixel, branch-light.** Prefer mix, step, smoothstep, and
44 clamp over if where possible; GPUs run pixels in lockstep and dislike
45 divergent branches.
465. **Pass data via uniforms** (constant per draw) and **varyings** (interpolated
47 vertex→fragment). Keep texture samples few; they dominate cost.
486. **Verify visually and on target hardware.** Shaders that look right on desktop
49 can break on mobile (precision, missing features). Test where it ships.
50
51## Patterns
52
53GLSL-style fragment snippets (close to Godot's canvas_item/spatial
54shaders and OpenGL). See references/effects.md for the HLSL equivalents and
55the full outline/fresnel/vignette shaders.
56
57### 1. Fragment basics: sample, tint, and combine
58
59```glsl
60// Per-pixel: read the texture at this UV, multiply by a color (tint), keep alpha.
61uniform sampler2D tex;
62uniform vec4 tint; // e.g. (1,0,0,1) reddens; multiply is non-destructive
63in vec2 uv; // interpolated 0..1 texture coordinate (a "varying")
64out vec4 frag;
65void main() {
66 vec4 c = texture(tex, uv); // HLSL: tex.Sample(samp, uv)
67 frag = c * tint; // component-wise multiply tints without clipping
68}
69```
70
71### 2. Scrolling UVs (animated texture) — frame-rate independent
72
73```glsl
74// Add time * speed to the UV to scroll. fract() wraps it into 0..1 so it tiles.
75uniform sampler2D tex;
76uniform float time; // seconds, supplied by the engine
77uniform vec2 scroll_speed; // UV units per second, e.g. (0.1, 0.0)
78in vec2 uv;
79out vec4 frag;
80void main() {
81 vec2 scrolled = fract(uv + scroll_speed * time); // HLSL: frac(...)
82 frag = texture(tex, scrolled);
83}
84// Drive with a real time uniform, not a per-frame accumulator, so speed is stable.
85```
86
87### 3. Dissolve (threshold a noise map, glow the edge)
88
89```glsl
90// Hide pixels where noise < threshold; tint a thin band at the boundary.
91uniform sampler2D tex;
92uniform sampler2D noise_tex; // grayscale noise, 0..1
93uniform float amount; // 0 = fully visible, 1 = fully dissolved
94uniform float edge = 0.05; // width of the glowing edge band
95uniform vec4 edge_color;
96in vec2 uv;
97out vec4 frag;
98void main() {
99 vec4 c = texture(tex, uv);
100 float n = texture(noise_tex, uv).r;
101 if (n < amount) discard; // cut away dissolved pixels
102 float e = smoothstep(amount, amount + edge, n); // 0 at the edge -> 1 inside
103 frag = mix(edge_color, c, e); // HLSL: lerp(edge_color, c, e)
104}
105```
106
107### 4. Fresnel rim light (3D) — brighten glancing angles
108
109```glsl
110// Rim = 1 where the surface faces away from the camera (silhouette glow).
111in vec3 world_normal; // normalized, world space (from the vertex stage)
112in vec3 view_dir; // normalized, surface -> camera, world space
113uniform float power = 3.0;
114uniform vec3 rim_color;
115out vec4 frag;
116void main() {
117 float f = pow(1.0 - clamp(dot(world_normal, view_dir), 0.0, 1.0), power);
118 frag = vec4(rim_color * f, 1.0); // add to lighting; f peaks at the silhouette
119}
120// Correctness: normal and view_dir MUST be in the same space and normalized.
121```
122
123## Pitfalls
124
125- **Mixing coordinate spaces** (lighting a world-space normal against a
126 view-space light) yields subtly wrong shading. Pick one space and convert
127 everything into it.
128- **Forgetting to normalize** interpolated normals/directions: interpolation
129 shortens vectors, so dot() results drift. normalize() in the fragment stage.
130- **UV assumptions across engines.** Some engines flip V (top-left vs bottom-left
131 origin); a texture may appear upside-down. Know your engine's convention.
132- **Heavy branching / dynamic loops** stall GPUs. Prefer step/smoothstep/
133 mix; reserve if/discard for genuinely cheap early-outs.
134- **discard defeats early-Z** and can hurt performance on tiled mobile GPUs;
135 prefer alpha blending where you can.
136- **Precision on mobile**: highp vs mediump matters; large UVs or time values
137 in low precision shimmer. Use adequate precision for coordinates and time.
138- **Assuming GLSL == HLSL.** mixlerp, fractfrac, texture().Sample(),
139 vec2float2, column- vs row-major matrices. See the reference mapping.
140
141## References
142
143- references/effects.md — full outline (2D sprite + 3D), vignette, and color
144 grading shaders; the GLSL↔HLSL function/type mapping table; per-engine notes
145 (Godot canvas_item/spatial, Unity ShaderLab/HLSL, Unreal material nodes).
146
147## Related skills
148
149- godot-shaders — Godot shading language syntax, built-ins, and screen-reading.
150- unreal-niagara — GPU particle VFX (a different shader use).
151- procedural-gen — the noise that drives dissolve and procedural texturing.
152
In the file
SKILL.md994 words
Files2
LicenceApache-2.0
Why you can read it

Nothing in a skill executes. The client loads the text and the model follows it, so a skill can be audited the way a runbook is — by reading it.

What it costs in context

Skills are not billed by the call. They are paid for in context: every token the instructions occupy is a token your code, your diff and your conversation cannot use. Here is what this one takes and when it takes it.

≈110
always loaded
The name and description, so the model knows the skill exists and when to reach for it.
2,865
on trigger
The instruction body and 1 supporting file, read only when the skill fires.
1.5%
of a 200k window
Ten skills this size would take about 15% of the window before you open a file.
050k100k150k200k context window

3k tokens, estimated from the bundle at four bytes to the token, held for the rest of the session once it triggers. Middling. Fine to keep on in a project where you use it weekly, worth unloading in one where you never do.

Servers bill, skills cost

A server charges by the month. A skill charges once per session, in context, and then keeps charging it for as long as the session lives.

Before and after

The same question, put to the same model twice: once as it comes, and once with these instructions loaded.

No worked example has been published for this skill yet.

Adoption
Installsnone yet
Ratingno reviews yet

The procedure it runs

The procedure has not been published here. It is in the skill’s own SKILL.md, which its author has not sent to the marketplace yet.

Prose, not code

These steps are written for a model to follow, not executed by a runtime. It can still be told to skip one, and it will say so when it does.

Servers it uses

None. This skill calls no MCP servers at all.

Everything it needs is in the instructions, so it works in a project with nothing connected — the model reads the file and changes how it works with what it can already reach.

It writes no files and reaches no network. All it changes is how the model reasons and writes.

What it asks for
Writes filesno
Network accessno

Read from the allowed-tools line of this skill’s own SKILL.md. A skill grants no permissions of its own — it can only ask for tools your client already has.

What it will not do

Every skill is narrow, and the useful ones say where they stop. These are the jobs this one is the wrong tool for.

What this skill is not for has not been published here. Nothing is implied by that: it is a section the author has not filled in.

What is in the bundle

2 files, 11.9 kB on disk. A bundle is text throughout: the instructions the model reads, plus the templates it fills in.

  • SKILL.md6.8 kB
  • references/effects.md5.1 kB
What is not in it

No dependencies and nothing executable: a skill is text the agent reads, so the bundle is 2 files you can review in full before installing. The Apache-2.0 licence covers the templates and examples as well as the instructions.

Install

Installing copies the bundle into your project. Nothing runs at install time — the files sit on disk until the model reads them.

$12 once
Shader Programming · Apache-2.0 · gamedev-skills
one-time
Price$12 once
LicenceApache-2.0 — the author’s, unchanged by this purchase
Paid throughStripe, once, on the card you add at the checkout
Keeps workingfor good — the files are yours once they are on disk
Updatesevery update its author ships, delivered through this account

You can read the whole bundle before paying — the SKILL.md above is the product, not a preview of it. What the money buys is the delivery: the folder packaged and handed to your machine by key, every update its author ships, and our support if it does not do what this listing says. The terms of use are Apache-2.0, set by the author and unchanged by buying it here.

Payment runs through Stripe, on a page like this one rather than a redirect. Once there is an account it joins the same mcprush invoice as everything else you run, so there is never a second card to enter.

Which clients pick it up on their own

A skill is a folder of text. A client with a skills folder reads it without being told; everywhere else the same text works, it is just handed to the model rather than found.

Claude Code.claude/skills/
Claude Desktop
ChatGPT
Cursor.cursor/skills/
VS Code.github/skills/
Codex CLI.agents/skills/
Gemini CLI.gemini/skills/
Grok.grok/skills/
Zed.agents/skills/
Windsurf.windsurf/skills/
Agent SDK.claude/skills/
HTTP / API
This release
Versionnot versioned
Publishedno release date on file
Price$12
Referencegamedev-skills/shader-programming

Versions

Its author publishes no version number, so there is nothing here to pin to: what you install is the folder as it stands today. Instructions change more often than APIs do — a skill can be rewritten entirely without anything it depends on moving.

v
  • No earlier releases have been published to the marketplace.
Pinning

Nothing to pin to: this skill carries no version number of its own. What you install is what the folder holds on the day you install it.

Reviews

no reviews yet · no installs yet

Nobody has reviewed this skill yet. The rating is the mean of the reviews written here, so there is none until somebody writes the first.

Who can post

Only accounts that have had the skill installed for fourteen days, so a review is written after living with it rather than after reading it. Publishers may reply once.

Publisher
Servers0