Wiki 9Minecraft Wiki 9Minecraft

Modify Sky Colors and Gradients

Java EditionShaderGuides 4FAQ 10Related mods 60
DownloadSkyboxTemplate Shaders

Get the files on 9Minecraft

Contents (4)
  1. Understand Color Output
  2. Create a Color Gradient
  3. Add Time-Based Changes
  4. Test and Iterate

Understand Color Output

The fragment shader's final output determines what players see. Locate the line that sets the final color value — this is where you control the sky's appearance. The template includes comments explaining each section.

Create a Color Gradient

Instead of a flat color, use the sky's vertical position to blend between two colors. Access the normalized screen position (usually gl_FragCoord or a varying variable) to determine height. Use mix() function to smoothly transition between your chosen colors based on vertical position.

Add Time-Based Changes

The shader has access to game time through uniform variables. Use u_GameTime or similar to create dynamic effects — colors that shift throughout the day or cycle through different hues. Multiply the time value by a speed factor to control how quickly changes occur.

Test and Iterate

Reload shaders frequently using F3+S. Small adjustments to color values create noticeable differences. Keep the template's example code nearby for reference on proper syntax and available variables.

More guides for this mod