forge-basic-lighting

Implement Blinn-Phong lighting in SDL3 GPU pipelines with world-space normals.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-basic-lighting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-basic-lighting
Source: https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317/tree/main/.claude/skills/forge-basic-lighting
Command: npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-basic-lighting

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill teaches how to add Blinn-Phong lighting to a rendered 3D scene, enabling realistic shading with ambient, diffuse, and specular components.

Core Features & Use Cases

  • Ambient, Diffuse, and Specular Lighting: implement comprehensive Blinn-Phong shading for meshes.
  • World-space Lighting Calculations: transform normals using adjugate-transpose for correct shading under non-uniform scale.
  • Shader Uniforms & Pipeline Integration: push MVP and model matrices, lighting parameters, and camera position to the GPU via SDL3 GPU APIs.
  • Real-time Rendering in SDL3 GPU: integrate with SDL_CreateGPUGraphicsPipeline and draw calls to render lit geometry.

Quick Start

Integrate the provided Blinn-Phong lighting shaders into your SDL3 GPU project and render a lit mesh.

Frequently Asked Questions about forge-basic-lighting

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

FAQPage Schema
How do I add Blinn-Phong lighting to an SDL3 GPU rendering pipeline?

You add Blinn-Phong lighting by integrating vertex and fragment shaders into your SDL3 GPU pipeline, passing MVP, model matrices, light direction, and eye position as uniforms to calculate ambient, diffuse, and specular components.

Why do my 3D mesh normals break under non-uniform scale in GLSL shaders?

Mesh normals break under non-uniform scale because standard transformation matrices distort them. You must transform normals using the adjugate-transpose of the model matrix to maintain correct world-space lighting calculations.

How does world-space lighting calculation work with SDL3 GPU APIs?

World-space lighting calculation works by pushing lighting parameters, camera position, and model matrices to the GPU via SDL3 APIs, allowing fragment shaders to compute Blinn-Phong shading using accurately transformed world-space normals.

Can I use Blinn-Phong shading for real-time mesh rendering in SDL3?

Yes, you can use Blinn-Phong shading for real-time rendering in SDL3 by integrating the provided shaders with SDL_CreateGPUGraphicsPipeline and draw calls to render lit geometry with adjustable light direction and camera position.

What shader uniforms are needed for Blinn-Phong lighting in 3D scenes?

Required shader uniforms include the MVP matrix, model matrix, light direction, and eye position. These allow the GPU to calculate the ambient, diffuse, and specular lighting components for the mesh.