Skip to content
Back to skills

Shader

ASecurity

Write and wire up a GLSL or WGSL shader with correct varyings and uniforms

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 3, 2026
ai-agentsgoapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill shader --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Shader?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Shader
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-shader/badge)](https://www.skillsdirectory.com/skills/black141312-shader)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: shader
description: Write and wire up a GLSL or WGSL shader with correct varyings and uniforms
category: gamedev
---

# Shader

Use when authoring a vertex/fragment (or compute) shader and binding it to geometry, uniforms, and textures.

1. Decide the stage and language target (GLSL ES 3.0, GLSL 4.x core, or WGSL) and match it to your graphics API.
2. Declare inputs explicitly: vertex attributes by location, varyings (`out`/`in`) matching between stages by name and type.
3. Pass per-draw data via uniforms / uniform buffers / push constants; keep the layout in sync with host-side structs.
4. In the vertex stage output clip-space position; in the fragment stage compute color, sampling textures with a bound sampler.
5. Compile and check the info log; fail loudly on shader compile and program link errors before first draw.
6. Verify output with a flat color or UV-visualization pass before adding lighting or effects.

## Rules
- Varying names and types must match exactly across vertex→fragment, or linking silently mismatches.
- Watch precision qualifiers in GLSL ES (`highp`/`mediump`) — defaults differ between desktop and mobile.
- Respect uniform buffer std140/std430 alignment; a `vec3` is padded to 16 bytes and will corrupt later fields.
- Y axis and clip-space depth range differ between OpenGL, Vulkan/WGSL, and D3D — flip UVs/viewport as needed.
- Avoid dynamic branching and unbounded loops in fragment shaders on mobile GPUs; prefer `mix`/`step`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.