Procedural Art logo

Procedural Art

Community
danicat
procedural-art

Pure-code procedural graphics, sprite generation, and visual effects (VFX) guide for 2D games. Generates sprites, tilesets, particle systems, and vector shapes in memory without external image files, enforcing 2D matrix transformation order, sub-frame animation easing, and pre-allocated particle pools. Activate when creating procedural 2D sprites, building zero-asset games, designing particle effects, or implementing 2D matrix transformations.

Overview

Publisherdanicat
Repositoryskills
Skill nameprocedural-art
Stars
24
Forks
4
Bundled files
2
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by danicat on GitHub. Read the source before you install it.

Installation

Install the Procedural Art AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/danicat/skills/tree/main/game-dev/procedural-art
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/danicat/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/game-dev/procedural-art .claude/skills/procedural-art
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Procedural Art in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Procedural Art on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Procedural Art is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Procedural Art: Pure-Code 2D Sprites, SDF Primitives, Material Ramps & VFX Guide

This skill provides mathematical, graphical, and software architecture patterns for generating high-quality 2D sprites, tilesets, Signed Distance Field (SDF) shapes, particle systems, and visual effects (VFX) purely in code—without relying on external .png, .jpg, or .svg asset files.

[!TIP] Reference Implementation:


1. Core Architectural Principles & Zero-Asset Strategy

Procedural art generates graphical textures in memory at startup (Boot state) or renders vector/particle effects dynamically during game frames:

  • Zero Disk I/O: Eliminates asset loading delays, missing file errors, and external bundle dependencies.
  • Signed Distance Field (SDF) Rasterization: Composes organic characters, weapons, and tiles mathematically using SDFCircle, SDFBox, SDFCapsule, and SDFSmoothMin.
  • Strict Premultiplied Alpha Invariant: Enforces $R, G, B \le A$ on every color.RGBA pixel via PremultiplyRGBA(r, g, b, a).

2. "Retro-HD" Visual Style, Premultiplied Alpha & 4-Step Material Ramps

Target the aesthetic richness of classic 16-bit/32-bit console art (SNES, Sega Saturn, Neo Geo) combined with modern 32-bit truecolor shading.

2.1 Premultiplied Alpha Invariant (PremultiplyRGBA)

In Go's image/color and Ebitengine (image.NewRGBA / ebiten.NewImageFromImage), color.RGBA values are alpha-premultiplied ($R \le A, G \le A, B \le A$). Writing non-premultiplied values like color.RGBA{255, 255, 255, alpha} or color.RGBA{200, 30, 10, 0} causes glowing halos and blending corruption. Always construct translucent colors via PremultiplyRGBA:

go
func PremultiplyRGBA(r, g, b, a uint8) color.RGBA {
	alpha := uint16(a)
	return color.RGBA{
		R: uint8((uint16(r)*alpha + 127) / 255),
		G: uint8((uint16(g)*alpha + 127) / 255),
		B: uint8((uint16(b)*alpha + 127) / 255),
		A: a,
	}
}

2.2 4-Step Material Ramp Structure (MaterialRamp)

Every material in a procedural sprite (steel, crimson, flesh, gold, foliage) uses a structured 4-step shading ramp ([4]color.RGBA) paired with a dark 1-pixel silhouette outline (#0F0C1C):

  1. Step 0 — Deep Shadow ([0]): Primary hue shifted toward cool blue/violet (illumination < 0.25).
  2. Step 1 — Base Tone ([1]): Core saturated material color (0.25 <= illumination < 0.65).
  3. Step 2 — Light Highlight ([2]): Primary hue shifted toward warm yellow/orange (0.65 <= illumination < 0.90).
  4. Step 3 — High Specular ([3]): Crisp specular edge or rim highlight (illumination >= 0.90).

3. 2D Signed Distance Field (SDF) Primitives & Smooth Blending

Instead of drawing blocky raw rectangles, sculpt multi-part sprites at startup by evaluating 2D Signed Distance Fields per pixel $(p_x, p_y)$ and blending limbs/armor plates with polynomial smooth minimum (SDFSmoothMin):

  • Circle (SDFCircle): $d = |(p_x - c_x, p_y - c_y)|_2 - r$
  • Rounded Box (SDFBox): Box centered at $(c_x, c_y)$ with half-extents $(h_w, h_h)$ and corner radius $r$.
  • Line Capsule (SDFCapsule): Swept sphere of radius $r$ along segment $\overline{AB}$ (ideal for limbs, blades, beams, and pauldrons).
  • Smooth Union (SDFSmoothMin): Blends two distance fields $d_1, d_2$ with smoothing factor $k > 0$: $$h = \frac{\max(k - |d_1 - d_2|, 0)}{k}, \quad \text{smin}(d_1, d_2, k) = \min(d_1, d_2) - \frac{1}{4} h^2 k$$

4. Transformation Mathematics & Order of Operations (CRITICAL)

In 2D graphics programming (ebiten.GeoM), matrix multiplication is non-commutative. Applying operations in the wrong order causes sprites to orbit wildly or scale off-screen.

4.1 Exact Sequence: Pivot -> Scale -> Rotate -> World Translation

$$M_{\text{correct}} = T(X + O_x, Y + O_y) \cdot R(\theta) \cdot S(S_x, S_y) \cdot T(-O_x, -O_y)$$

  1. m.Translate(-OriginX, -OriginY) — Move pivot to $(0, 0)$.
  2. m.Scale(ScaleX, ScaleY) — Scale relative to pivot.
  3. m.Rotate(Rotation) — Rotate around pivot.
  4. m.Translate(OriginX+X, OriginY+Y) — Translate to world position.

5. Sub-Frame Interpolation & Non-Linear Easing

Use delta time ($dt$) and non-linear easing functions to model physical weight, momentum, and elasticity:

  • Linear (EaseLinear): $f(t) = t$
  • Ease-In Quadratic (EaseInQuad): $f(t) = t^2$ (accelerating under gravity)
  • Ease-Out Quadratic (EaseOutQuad): $f(t) = t(2 - t)$ (decelerating friction slide)
  • Ease-InOut Cubic (EaseInOutCubic): Smooth S-curve for breathing idle and hover loops
  • Elastic Overshoot (EaseElasticOut): $f(t) = 2^{-10t} \sin\left(\frac{(t - 0.075) \cdot 2\pi}{0.3}\right) + 1$ (springy attacks and UI pop-ups)

6. Retro-HD Sprite Sheet Architecture & Frame Requirements

Animation StateRequired Frames / DirKeyframes & Pose ProgressionEasing / Timing Guidelines
Idle / Breathing4–8 framesSubtle chest rise, shoulder dip, weapon idle shimmer.Smooth EaseInOutCubic (1.2s–1.8s cycle).
Walk / Run Cycle8–12 framesContact $\rightarrow$ Recoil $\rightarrow$ Passing $\rightarrow$ High Point.Continuous loop (0.6s–0.9s cycle).
Attack / Strike6–10 framesWind-up $\rightarrow$ Fast Strike/Impact $\rightarrow$ Follow-through $\rightarrow$ Recovery.Fast EaseInQuad to impact, EaseOutQuad recovery.
Hurt / Hit Recoil3–5 framesSharp backward tilt, hit-flash, recovery.High speed (0.15s–0.25s total).
Death / Collapse6–10 framesStagger $\rightarrow$ Knees buckle $\rightarrow$ Ground impact $\rightarrow$ Settle.Heavy EaseInQuad drop, non-looping final frame.

7. Zero-Allocation Particle Systems & VFX

High-performance visual effects (explosions, thrusters, magic trails, sparks) require both a pre-allocated []Particle pool and a reusable ebiten.DrawImageOptions struct field (ps.drawOp) so Draw() never allocates on the heap:

go
func (ps *ParticleSystem) Draw(screen *ebiten.Image) {
	for i := range ps.pool {
		p := &ps.pool[i]
		if !p.Active {
			continue
		}
		progress := p.Age / p.Life
		size := p.StartSize + progress*(p.EndSize-p.StartSize)
		curColor := LerpColor(p.StartColor, p.EndColor, progress)

		ps.drawOp.GeoM.Reset()
		ps.drawOp.GeoM.Translate(-8, -8)
		ps.drawOp.GeoM.Scale(size, size)
		ps.drawOp.GeoM.Translate(p.X, p.Y)

		ps.drawOp.ColorScale.Reset()
		ps.drawOp.ColorScale.ScaleWithColor(curColor)

		if p.Additive {
			ps.drawOp.Blend = ebiten.BlendLighter
		} else {
			ps.drawOp.Blend = ebiten.BlendSourceOver
		}

		screen.DrawImage(ps.texture, &ps.drawOp)
	}
}

8. Mandatory Quality Directives for AI Art Generation

  1. Premultiplied Alpha Enforcement: Every translucent color.RGBA pixel written to image.RGBA or interpolated in particle systems MUST use PremultiplyRGBA ($R, G, B \le A$).
  2. Zero Allocations in Draw(): Pre-render all procedural *ebiten.Image textures at boot and reuse ebiten.DrawImageOptions (Reset()) inside Draw().
  3. SDF + 4-Step Material Ramp Composition: Combine SDFCircle, SDFBox, SDFCapsule, and SDFSmoothMin with MaterialRamp ([4]color.RGBA) surface normal illumination and 1px dark outlines (ApplyPixelOutline).
  4. Correct Matrix Transformation Order: Always execute Translate(-pivot) -> Scale -> Rotate -> Translate(+pivot + pos).

📚 Progressive Disclosure & References

  • Procedural Art Driver: references/art.go — Premultiplied RGBA helpers, 4-step MaterialRamp shading, SDFCircle/SDFBox/SDFCapsule/SDFSmoothMin primitives, zero-allocation ParticleSystem, and character sprite rasterization.
  • Verification Test Suite: references/art_test.go — Unit tests verifying PremultiplyRGBA, SDF geometry, 4-step material ramps, matrix transformation order, and particle pool lifecycle.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Procedural Art AI skill do?

Pure-code procedural graphics, sprite generation, and visual effects (VFX) guide for 2D games. Generates sprites, tilesets, particle systems, and vector shapes in memory without external image files, enforcing 2D matrix transformation order, sub-frame animation easing, and pre-allocated particle pools. Activate when creating procedural 2D sprites, building zero-asset games, designing particle effects, or implementing 2D matrix transformations.

Why use Procedural Art on TypingMind?

Because you install it once and use it with any model. Procedural Art is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Procedural Art in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/danicat/skills/tree/main/game-dev/procedural-art. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Procedural Art?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Procedural Art?

As many as you like. As long as a model supports skills, you can use Procedural Art with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Procedural Art AI skill free?

Yes. It is published on GitHub by danicat under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇