Here's a GLSL shader that creates a realistic, animated cloud effect with a baroque-inspired color palette. This uses 3D noise and ray marching techniques:
// Cloud Shader with Baroque Palette - Shadertoy Version
// MiniMax-M1 Engineered
#define MAX_STEPS 64
#define CLOUD_DENSITY 0.2
#define CLOUD_SCALE 3.0
// Baroque Color Palette
vec3 getBaroqueColor(float value) {
// Deep crimson to gold gradient with teal accents
vec3 deepRed = vec3(0.7, 0.1, 0.2);
vec3 gold = vec3(0.9, 0.7, 0.1);
vec3 teal = vec3(0.1, 0.5, 0.5);
value = clamp(value, 0.0, 1.0);
vec3 color = mix(deepRed, gold, smoothstep(0.0, 0.7, value));
color = mix(color, teal, smoothstep(0.5, 1.0, value));
// Add subtle color variation
float pulse = sin(iTime * 0.2) * 0.1 + 0.9;
return color * pulse;
}
// 3D Noise Function
float noise(vec3 p) {
vec3 i = floor(p);
vec3 f = fract(p);
f = f*f*(3.0-2.0*f);
return mix(mix(mix(hash(i+vec3(0,0,0)),
hash(i+vec3(1,0,0)), f.x),
mix(hash(i+vec3(0,1,0)),
hash(i+vec3(1,1,0)), f.x), f.y),
mix(mix(hash(i+vec3(0,0,1)),
hash(i+vec3(1,0,1)), f.x),
mix(hash(i+vec3(0,1,1)),
hash(i+vec3(1,1,1)), f.x), f.y), f.z);
}
float fbm(vec3 p) {
float value = 0.0;
float amplitude = 0.5;
float frequency = 1.0;
for (int i = 0; i < 5; i++) {
value += amplitude * noise(p * frequency);
frequency *= 2.0;
amplitude *= 0.5;
}
return value;
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord.xy - 0.5*iResolution.xy)/iResolution.y;
vec3 ro = vec3(0.0, 0.0, 5.0);
vec3 rd = normalize(vec3(uv, -1.0));
// Animation parameters
float time = iTime * 0.2;
vec3 cloudOffset = vec3(time * 0.2, time * 0.1, time * 0.3);
// Ray marching
float totalDensity = 0.0;
float maxDist = 10.0;
float distStep = 0.05;
for(float i = 0.0; i < MAX_STEPS; i++) {
vec3 pos = ro + rd * (i * distStep);
// Growing animation
float growthFactor = 1.0 + sin(time * 0.5) * 0.2;
vec3 scaledPos = pos * (CLOUD_SCALE * growthFactor);
// Cloud density calculation
float n = fbm(scaledPos + cloudOffset);
float density = max(0.0, n - 0.4) * CLOUD_DENSITY;
// Height-based falloff
float height = pos.y + 0.5;
density *= smoothstep(-1.0, 1.0, height) *
(1.0 - smoothstep(2.0, 4.0, height));
totalDensity += density * (1.0 - totalDensity);
// Early termination
if(totalDensity > 0.99 || i > MAX_STEPS) break;
}
// Apply baroque coloring
vec3 cloudColor = getBaroqueColor(totalDensity);
// Add lighting
vec3 lightDir = normalize(vec3(0.5, 0.7, 0.9));
float lighting = max(0.0, dot(vec3(0.0, 1.0, 0.0), lightDir));
cloudColor *= 0.5 + 0.5 * lighting;
// Background
vec3 bg = vec3(0.05, 0.07, 0.1) * (0.8 + 0.2 * lighting);
// Final composite
fragColor = vec4(mix(bg, cloudColor, totalDensity), 1.0);
}
// Hash function
float hash(vec3 p) {
p = fract(p * vec3(5.3983, 5.4427, 5.93297));
p += dot(p.yzx, p.xyz + vec3(43.2, 43.2, 43.2));
return fract(p.x * p.y * p.z);
}
Key features:
- Baroque color palette using deep reds, golds, and teal accents
- Animated growth effect through time-based scaling
- Realistic 3D cloud formation using fractal Brownian motion
- Height-based density falloff for realistic cloud shapes
- Subtle lighting effects to enhance depth
- Smooth color transitions with time-based pulsing
To use in Shadertoy:
- Create a new shader
- Paste this code
- Set the shader type to "Fragment"
- Add any additional parameters you want to tweak
The clouds will grow and evolve over time while maintaining their baroque-inspired coloration. You can adjust the CLOUD_DENSITY and CLOUD_SCALE constants to modify the effect's intensity and size.