The y-component of the ray direction provides a natural UV for sky gradient and cloud placement
In a raymarcher the sky is rendered for rays that escape the scene. The ray direction’s y-component (rd.y) naturally ranges from -1 (looking straight down) to +1 (looking straight up), with 0 at the horizon. This gives a free parameterization for the sky: blend from a bright desaturated grey at rd.y=0 (horizon haze) to deep blue at rd.y=1. For clouds, intersect a virtual horizontal plane at height H with the ray to get 2D UVs (uv = rd.xz / rd.y) and evaluate a smooth-stepped sine pattern on those UVs.
Examples
vec3 sky = mix(horizonColor, zenithColor, clamp(rd.y,0.,1.)); vec2 cloudUV = rd.xz/rd.y;
Assessment
Explain why rd.xz / rd.y gives the correct horizontal coordinates at height H for cloud UVs regardless of camera position.