forge-linear-fog

Add depth-based distance fog to SDL GPU fragment shaders.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Add depth-based distance fog to any SDL GPU project to simulate atmospheric perspective and obscure distant geometry.

Core Features & Use Cases

  • Supports linear, exponential, and exponential-squared fog modes.
  • Applies fog in the fragment shader after lighting using a uniform block to control color, distance start/end, density, and mode.
  • Real-world use: enhance scene realism in 3D SDL GPU applications such as outdoor environments, terrain, or foggy scenes.

Quick Start

Add the fog uniform block to your fragment shader, set initial parameters, and ensure the fog calculation runs after the lighting.

Frequently Asked Questions about forge-linear-fog

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

FAQPage Schema
How do I add depth-based distance fog to an SDL GPU scene?

To add depth-based distance fog to an SDL GPU scene, integrate fog calculations into your fragment shader after lighting and introduce a uniform block to control color, distance, density, and mode.

Can I use different fog modes like exponential in SDL GPU shaders?

Yes, SDL GPU shaders can use linear, exponential, and exponential-squared fog modes by setting the desired mode within the fog uniform block during fragment shader calculations.

What parameters are needed to configure distance fog in a fragment shader?

Configuring distance fog requires a uniform block containing fields for fog_color, fog_start, fog_end, fog_density, and fog_mode to accurately calculate atmospheric perspective in the fragment shader.

Does distance fog calculation happen before or after lighting in SDL GPU projects?

Distance fog calculation happens after lighting in SDL GPU projects, ensuring the atmospheric perspective correctly blends with the illuminated geometry in the final fragment shader output.

Why add atmospheric perspective haze to 3D SDL GPU environments?

Adding atmospheric perspective haze to 3D SDL GPU environments simulates distance fading and obscures distant geometry, creating horizon realism for outdoor terrain and foggy scenes.

Is forge-linear-fog suitable for fading distant objects in 3D graphics?

forge-linear-fog is suitable for fading distant objects in 3D graphics, specifically providing depth-based distance fading for SDL GPU projects requiring atmospheric haze and horizon realism.