fix: amplify ambient shader motion for visible animation
Previous shader was too subtle — drift, rotation, and breathing were imperceptible with the smooth 8x8 texture. Now with much larger values: - Drift: 0.05 -> 0.20 max (Lissajous with two frequencies) - Scale breathing: 2% -> 12% range - Rotation: 0.86deg -> 5deg range - Added warm/cool color shifting over time - Stronger vignette pulsing and brightness breathing Safe because the 8x8-sourced texture has zero structure to reveal.
This commit is contained in:
1 file changed
+27
-19
@@ -2,10 +2,9 @@
|
||||
/**
|
||||
* Ambient Immersion Shader
|
||||
*
|
||||
* Single-layer approach with slow drift, rotation, and breathing.
|
||||
* Produces smooth organic motion without multi-layer blending artifacts.
|
||||
* The pre-blurred texture does all the heavy lifting — the shader just
|
||||
* adds gentle life to it.
|
||||
* Single-layer approach with pronounced drift, rotation, scale breathing,
|
||||
* and color modulation. No multi-layer blending = no geometric artifacts.
|
||||
* Safe because the texture is generated at 8x8 and has no structure.
|
||||
*/
|
||||
|
||||
precision mediump float;
|
||||
@@ -19,22 +18,25 @@ uniform float u_intensity;
|
||||
|
||||
void main() {
|
||||
vec2 uv = v_texCoord;
|
||||
float time = u_time * 0.8;
|
||||
float time = u_time;
|
||||
float intensity = u_intensity;
|
||||
vec2 center = vec2(0.5);
|
||||
|
||||
// Slow organic drift (Lissajous-like path, never repeats quickly)
|
||||
// === DRIFT: Lissajous-like wandering path ===
|
||||
// Multiple frequencies for organic, non-repeating motion
|
||||
vec2 drift = vec2(
|
||||
sin(time * 0.07) * 0.03 + sin(time * 0.03) * 0.02,
|
||||
cos(time * 0.05) * 0.025 + cos(time * 0.02) * 0.015
|
||||
sin(time * 0.13) * 0.12 + sin(time * 0.07 + 1.3) * 0.08,
|
||||
cos(time * 0.11) * 0.10 + cos(time * 0.05 + 2.1) * 0.07
|
||||
) * intensity;
|
||||
|
||||
// Gentle scale breathing around center
|
||||
float scaleBreath = 1.0 + sin(time * 0.09) * 0.02 * intensity;
|
||||
vec2 center = vec2(0.5);
|
||||
// === SCALE: Pronounced breathing (zoom in/out) ===
|
||||
float scaleBreath = 1.0
|
||||
+ sin(time * 0.17) * 0.08 * intensity
|
||||
+ sin(time * 0.09 + 0.7) * 0.04 * intensity;
|
||||
vec2 scaledUV = center + (uv - center) * scaleBreath;
|
||||
|
||||
// Slow rotation
|
||||
float angle = sin(time * 0.04) * 0.015 * intensity;
|
||||
// === ROTATION: Slow but visible swaying ===
|
||||
float angle = (sin(time * 0.08) * 0.06 + sin(time * 0.04 + 1.5) * 0.03) * intensity;
|
||||
vec2 centered = scaledUV - center;
|
||||
float c = cos(angle);
|
||||
float s = sin(angle);
|
||||
@@ -49,21 +51,27 @@ void main() {
|
||||
// Sample texture (MIRRORED_REPEAT handles out-of-range UVs)
|
||||
vec3 color = texture(u_texture, finalUV).rgb;
|
||||
|
||||
// === COLOR MODULATION: Warm/cool shifting ===
|
||||
// Slowly shifts hue warmth over time
|
||||
float warmShift = sin(time * 0.06) * 0.08 * intensity;
|
||||
color.r *= 1.0 + warmShift;
|
||||
color.b *= 1.0 - warmShift * 0.6;
|
||||
|
||||
// Radial distance from center (0 at center, ~1 at corners)
|
||||
float radial = length(uv - center) * 1.414;
|
||||
|
||||
// Subtle pulsing vignette
|
||||
float vignetteStrength = 0.25 + sin(time * 0.12) * 0.05 * intensity;
|
||||
// === VIGNETTE: Pulsing edge darkening ===
|
||||
float vignetteStrength = 0.30 + sin(time * 0.14) * 0.10 * intensity;
|
||||
float vignette = 1.0 - radial * vignetteStrength;
|
||||
color *= vignette;
|
||||
|
||||
// Vertical gradient tint (cool top, warm bottom)
|
||||
vec3 tintTop = vec3(0.96, 0.97, 1.0);
|
||||
vec3 tintBottom = vec3(1.0, 0.97, 0.94);
|
||||
vec3 tintTop = vec3(0.95, 0.97, 1.0);
|
||||
vec3 tintBottom = vec3(1.0, 0.96, 0.93);
|
||||
color *= mix(tintBottom, tintTop, uv.y);
|
||||
|
||||
// Gentle brightness breathing
|
||||
float breath = 1.0 + sin(time * 0.15) * 0.06 * intensity;
|
||||
// === BRIGHTNESS BREATHING: Pronounced pulse ===
|
||||
float breath = 1.0 + sin(time * 0.20) * 0.12 * intensity;
|
||||
color *= breath;
|
||||
|
||||
fragColor = vec4(color, 1.0);
|
||||
|
||||
Reference in new issue
Block a user