basic-lighting

Implement Blinn-Phong per-pixel lighting with SDL3 GPU API and HLSL shaders.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/RosyGameStudio/forge-gpu --skill basic-lighting
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: basic-lighting
Source: https://github.com/RosyGameStudio/forge-gpu/tree/main/.claude/skills/basic-lighting
Command: npx skills add https://github.com/RosyGameStudio/forge-gpu --skill basic-lighting

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables the addition of realistic lighting and shading to 3D models rendered in real-time applications, transforming flat surfaces into visually engaging objects.

Core Features & Use Cases

  • Blinn-Phong Shading: Implements ambient, diffuse, and specular lighting components for per-pixel shading.
  • Shader Uniforms: Manages the passing of necessary data like light direction, camera position, and material properties to the GPU shaders.
  • Normal Transformation: Correctly transforms surface normals from object space to world space for accurate lighting calculations, even with non-uniform scaling.
  • Use Case: Integrate this Skill to give a 3D model of a product a realistic sheen and depth, making it appear more tangible and appealing in a product configurator or game.

Quick Start

Use the basic-lighting skill to apply Blinn-Phong lighting to the loaded 'dragon.gltf' model with a light source positioned at (10, 10, 10).

Frequently Asked Questions about basic-lighting

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

FAQPage Schema
How do I add Blinn-Phong lighting to 3D scenes using SDL3?▼

To add Blinn-Phong lighting to 3D scenes with SDL3, you implement per-pixel shading using the SDL3 GPU API and HLSL shaders. This involves managing ambient, diffuse, and specular components for real-time rendering of textured or solid-colored meshes.

How do shader uniforms manage light direction and camera position in 3D rendering?▼

Shader uniforms manage 3D rendering data by passing light direction, camera position, and material properties directly to GPU shaders. This mechanism allows the Blinn-Phong model to calculate accurate real-time per-pixel shading on textured surfaces.

Does this Blinn-Phong lighting implementation handle non-uniform scaling of surface normals?▼

Yes, the Blinn-Phong lighting implementation handles non-uniform scaling by correctly transforming surface normals from object space to world space. This ensures accurate lighting calculations and per-pixel shading across dynamically lit 3D models.

Can I use HLSL shaders with SDL3 GPU API for real-time per-pixel shading?▼

Yes, you can use HLSL shaders with the SDL3 GPU API to achieve real-time per-pixel shading. This combination supports Blinn-Phong lighting calculations, enabling dynamic ambient, diffuse, and specular highlights on your 3D meshes.

What is the best way to apply dynamic lighting to a glTF model in an SDL3 application?▼

The best way to apply dynamic lighting to a glTF model in an SDL3 application is using Blinn-Phong shading. By setting a light source at a specific coordinate, the shader calculates per-pixel ambient, diffuse, and specular components to give the model realistic depth.