Forge Ssao logo

Forge Ssao

Community
Nebulavenus
forge-ssao

Add screen-space ambient occlusion (SSAO) to an SDL3 GPU application

Overview

PublisherNebulavenus
Repositoryforge-gpu
Skill nameforge-ssao
Stars
46
Forks
7
Bundled files
Instructions only
LicenseZlib
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

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

Installation

Install the Forge Ssao 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/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-ssao
  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/Nebulavenus/forge-gpu.git /tmp/forge-gpu
mkdir -p .claude/skills
cp -r /tmp/forge-gpu/.claude/skills/forge-ssao .claude/skills/forge-ssao
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Forge Ssao 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 Forge Ssao 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 Forge Ssao 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.

SSAO — Screen-Space Ambient Occlusion

Add hemisphere-kernel SSAO with blur and composite passes to an existing SDL3 GPU application. Based on the John Chapman / LearnOpenGL approach.

When to use

  • You want contact shadows in crevices, corners, and where objects meet
  • You have a depth buffer and can add a view-normal G-buffer pass
  • You want a screen-space effect that works with any geometry

How it works

SSAO requires 3 additional render passes after your main geometry pass:

  1. SSAO pass — samples the depth buffer in a hemisphere around each pixel's surface normal; outputs a single-channel AO factor
  2. Blur pass — 4x4 box blur smooths the noise tile pattern
  3. Composite pass — multiplies scene color by the AO factor

The geometry pass must output view-space normals as a second render target (MRT), and the depth buffer must be readable as a sampler.

Key API calls

Render targets needed

c
/* Scene depth — readable as sampler for SSAO reconstruction */
ti.format = SDL_GPU_TEXTUREFORMAT_D32_FLOAT;
ti.usage  = SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET |
            SDL_GPU_TEXTUREUSAGE_SAMPLER;

/* View normals — MRT target 1 from geometry pass */
ti.format = SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT;
ti.usage  = SDL_GPU_TEXTUREUSAGE_COLOR_TARGET |
            SDL_GPU_TEXTUREUSAGE_SAMPLER;

/* SSAO raw + blurred — single channel AO factor */
ti.format = SDL_GPU_TEXTUREFORMAT_R8_UNORM;
ti.usage  = SDL_GPU_TEXTUREUSAGE_COLOR_TARGET |
            SDL_GPU_TEXTUREUSAGE_SAMPLER;

Pipeline setup

Set num_color_targets = 2 on the MRT geometry pipeline (color + normals). The three fullscreen-quad pipelines (SSAO, blur, composite) use no vertex buffer and no depth test — see existing pipeline patterns from earlier lessons.

SSAO kernel generation

c
/* 64 hemisphere samples with quadratic falloff */
for (int i = 0; i < 64; i++) {
    /* Random direction in hemisphere (+Z up) */
    float x = random_signed(), y = random_signed(), z = random_01();
    normalize(&x, &y, &z);

    /* Concentrate samples near the surface */
    float t = (float)i / 64.0f;
    float scale = 0.1f + 0.9f * t * t;
    kernel[i] = {x * scale, y * scale, z * scale, 0};
}

Depth reconstruction (HLSL)

hlsl
float3 view_pos_from_depth(float2 uv, float depth) {
    float2 ndc_xy = uv * 2.0 - 1.0;
    ndc_xy.y = -ndc_xy.y;
    float4 clip = float4(ndc_xy, depth, 1.0);
    float4 view = mul(inv_projection, clip);
    return view.xyz / view.w;
}

MRT fragment shader output (HLSL)

hlsl
struct PSOutput {
    float4 color       : SV_Target0;  /* lit scene color */
    float4 view_normal : SV_Target1;  /* view-space normal */
};

Step-by-step integration

  1. Add view-normal output to your geometry pass vertex shader (transform normal by view matrix) and fragment shader (output as SV_Target1)

  2. Change depth texture usage to include SDL_GPU_TEXTUREUSAGE_SAMPLER so the SSAO pass can read it

  3. Create SSAO render targets — ssao_raw and ssao_blurred (R8_UNORM)

  4. Create noise texture — 4x4, R32G32B32A32_FLOAT, random unit XY vectors, REPEAT wrapping

  5. Generate SSAO kernel — 64 hemisphere samples at init time

  6. Add 3 fullscreen-quad pipelines — SSAO, blur, composite (no vertex buffer, no depth test)

  7. Render 3 additional passes after your geometry pass:

    • SSAO: bind normals + depth + noise, push kernel + matrices
    • Blur: bind raw SSAO, push texel size
    • Composite: bind scene color + blurred AO, push display mode

Common issues

  • Black screen — check that depth texture has SAMPLER usage flag
  • All white AO — verify inv_projection is correct; check depth reconstruction flips Y correctly
  • Visible 4x4 pattern — ensure blur pass runs; check noise texture uses REPEAT wrapping
  • Self-occlusion (dark flat surfaces) — increase bias parameter
  • AO halo around objects — decrease radius or add range check with smoothstep(0, 1, radius / abs(frag_z - stored_z))

Reference

See Lesson 27 — SSAO for the complete implementation with 5 render passes, shadow mapping, and view mode switching.

Frequently asked questions

What does the Forge Ssao AI skill do?

Add screen-space ambient occlusion (SSAO) to an SDL3 GPU application

Why use Forge Ssao on TypingMind?

Because you install it once and use it with any model. Forge Ssao 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 Forge Ssao in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-ssao. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Forge Ssao?

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 Forge Ssao?

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

Is the Forge Ssao AI skill free?

Yes. It is published on GitHub by Nebulavenus under the Zlib 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 👇