Skip to content

GLSL fragment shader guide for Shadertoy covering entry points, built-in inputs, and ray marching patterns.

CCM score
61 of 100
skills.sh installs
1.5K
GitHub stars
53
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the mainImage entry point, Shadertoy inputs (iResolution, iTime, iMouse, iChannel0-iChannel3), and coordinate normalization setup
  • Includes reusable patterns: cosine color palettes, 2D hashing, ray marching with normals, 2D and 3D rotations, domain folding, and post-processing
  • Enforces GLSL ES rules such as no f suffixes, clamp in place of saturate(), and guarded pow, sqrt, and division
  • Designed for writing .glsl files, multi-pass buffer setups, and WebGL procedural or generative graphics

Install

$ npx -y skills add bfollington/terma --skill shadertoy -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Shadertoy Shader Development

Overview

Shadertoy is a platform for creating and sharing GLSL fragment shaders that run in the browser using WebGL. This skill provides comprehensive guidance for writing shaders including GLSL ES syntax, common patterns, mathematical techniques, and best practices specific to real-time procedural graphics.

When to Use This Skill

Activate this skill when:

  • Writing or editing .glsl shader files
  • Creating procedural graphics, generative art, or visual effects
  • Working with Shadertoy.com projects or WebGL fragment shaders
  • Implementing ray marching, distance fields, or procedural textures
  • Debugging shader code or optimizing shader performance
  • Need GLSL ES syntax reference or Shadertoy input variables

Core Concepts

Shader Entry Point

Every Shadertoy shader implements the mainImage function:

void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
    // fragCoord: pixel coordinates (0 to iResolution.xy)
    // fragColor: output color (RGBA, typically alpha = 1.0)

    vec2 uv = fragCoord / iResolution.xy;
    fragColor = vec4(uv, 0.0, 1.0);
}

Shadertoy Built-in Inputs

Always available in shaders:

Details

Repository
github.com/bfollington/terma
Categories
3D, CAD & Modeling, Animation & Motion

More from bfollington/terma

All 2

Similar to Shadertoy

More 3D, CAD & Modeling