About the Shaders category

Get help with shaders and visual effects.

1 Like

Here’s a concise overview of the main shader types in Godot 4 (latest version) and their functionalities:

  1. Spatial Shader (3D)
    Used for 3D objects/meshes
    Controls lighting, shadows, reflections in 3D space
    Has multiple render modes (opaque, transparent, etc.)
    Processes vertex, fragment, and lighting calculations
  2. CanvasItem Shader (2D)
    Used for 2D nodes (sprites, UI elements)
    Processes pixels in screen space
    Can modify colors, apply effects to 2D elements
    Doesn’t receive 3D lighting
  3. Particle Shader
    Specifically for particle systems
    Controls particle appearance/behavior over time
    Can modify particles in vertex and fragment stages
    Works with both CPU and GPU particles
  4. Sky Shader
    Creates dynamic sky backgrounds
    Generates sky colors based on sun position
    Used for procedural skies and skyboxes
  5. Fog Shader
    Controls volumetric fog effects
    Determines how fog interacts with 3D scenes
    Can create height-based or distance-based fog
  6. Post-Processing Shader
    Applies screen-space effects
    Works on the entire viewport after rendering
    Used for effects like bloom, color correction, etc.

Each shader type has specific built-in variables and functions tailored for its purpose. The shader language is based on a modified version of GLSL with Godot-specific enhancements.

PS:
generated by AI; i did checked and modified;