linear-fog

Integrate distance-based fog effects into SDL3 GPU rendering pipelines.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill adds atmospheric perspective and visual depth to 3D scenes by simulating fog, making distant objects fade into a background color.

Core Features & Use Cases

  • Fog Modes: Supports linear, exponential, and exponential-squared fog.
  • Shader Integration: Provides HLSL code snippets to integrate fog calculations into fragment shaders.
  • Use Case: Enhance the realism of a game or simulation by making distant mountains or buildings fade into a hazy sky, or to hide the clipping plane of the camera.

Quick Start

Apply the linear fog skill to your SDL GPU project by adding the provided HLSL code to your fragment shader and setting the fog uniforms.

Frequently Asked Questions about linear-fog

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

FAQPage Schema
How do I add distance-based fog to an SDL3 GPU rendering pipeline?▼

To add distance-based fog to an SDL3 GPU rendering pipeline, integrate HLSL code snippets into your fragment shader and define uniform buffers for fog parameters like color, start and end distances, density, and mode to apply the effect after lighting calculations.

What fog modes are supported for 3D rendering in HLSL?▼

Supported fog modes for 3D rendering in HLSL include linear, exponential, and exponential-squared fog. These modes are applied in the fragment shader after lighting calculations to simulate atmospheric perspective by fading distant objects into a background color.

Does linear fog work with SDL GPU fragment shaders?▼

Yes, linear fog works with SDL GPU fragment shaders by applying provided HLSL code snippets after lighting calculations. You must set uniform buffer definitions for fog parameters including color, start and end distances, density, and the specific fog mode.

What uniforms do I need to define for 3D scene fog calculation?▼

For 3D scene fog calculation, you need to define uniform buffers for fog parameters including color, start and end distances, density, and mode. These uniforms configure the HLSL fragment shader calculations for linear, exponential, or exponential-squared fog.

When should I use exponential fog instead of linear fog in 3D rendering?▼

Use exponential or exponential-squared fog instead of linear fog in 3D rendering when you need density-based atmospheric perspective rather than distance-based fading. Exponential modes provide smoother fog transitions for hazy environments, while linear fog uses strict start and end distances.