forge-normal-maps

Apply tangent-space normal mapping in SDL GPU-based rendering.

36|6|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/Nebulavenus/forge-gpu --skill forge-normal-maps-nebulavenus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-normal-maps
Source: https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-normal-maps
Command: npx skills add https://github.com/Nebulavenus/forge-gpu --skill forge-normal-maps-nebulavenus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Add tangent-space normal mapping to a 3D scene rendered with SDL's GPU API to provide per-texel surface detail without increasing geometry.

Core Features & Use Cases

  • Extend your vertex layout with a vec4 tangent to carry tangent, bitangent, and handedness data.
  • Compute tangents for models lacking precomputed tangents (Lengyel's method) and reconstruct a robust TBN basis in the vertex shader.
  • Sample and decode a normal map in the fragment shader and apply it via a TBN transform to modulate lighting.

Quick Start

Update your vertex struct to include a tangent, implement Tangent computation if missing, and sample the normal map in the fragment shader using a TBN transform.

Frequently Asked Questions about forge-normal-maps

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add normal mapping to an SDL GPU rendering pipeline?

To add normal mapping in SDL GPU, you extend your vertex layout with a vec4 tangent, reconstruct the TBN basis in the vertex shader, and apply a TBN transform to a sampled normal map texture in the fragment shader to modulate lighting.

What is tangent-space normal mapping and when do I need it for 3D rendering?

Tangent-space normal mapping provides per-texel surface detail without increasing geometry by decoding a normal map texture relative to the mesh surface. You need it when your 3D pipeline requires enhanced surface lighting detail on low-poly models.

Can I use normal maps in SDL GPU if my mesh lacks precomputed tangents?

Yes, you can compute tangents for models lacking precomputed data using Lengyel's method. This approach calculates the tangent, bitangent, and handedness data to reconstruct a robust TBN basis directly within your rendering workflow.

What do I need to set up before implementing normal mapping with SDL GPU?

You need a working 3D pipeline, a shader pipeline supporting TBN transforms, and a vertex structure extended with a vec4 tangent. Tangent computation capabilities are also required if your models lack precomputed tangent data.

How does the TBN basis work when applying a normal map in a fragment shader?

The TBN basis transforms the decoded tangent-space normal map values into world space for lighting calculations. The vertex shader reconstructs the tangent, bitangent, and normal vectors, which the fragment shader uses to modulate per-pixel lighting.

Why are my normal maps not working with the SDL GPU shader pipeline?

Normal maps often fail when the vertex shader lacks the correct TBN basis reconstruction from the vec4 tangent data, or if the fragment shader does not properly decode the normal map texture and apply the TBN transform for lighting modulation.