#version 430 core uniform float u_time; out vec4 outColor; in vec2 vtc; in vec3 worldPos; vec2 u_resolution = vec2(1024, 1024); float random (in vec2 st) { return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123); } // Based on Morgan McGuire @morgan3d // https://www.shadertoy.com/view/4dS3Wd float noise (in vec2 st) { vec2 i = floor(st); vec2 f = fract(st); // Four corners in 2D of a tile float a = random(i); float b = random(i + vec2(1.0, 0.0)); float c = random(i + vec2(0.0, 1.0)); float d = random(i + vec2(1.0, 1.0)); vec2 u = f * f * (3.0 - 2.0 * f); return mix(a, b, u.x) + (c - a)* u.y * (1.0 - u.x) + (d - b) * u.x * u.y; } #define OCTAVES 6 float fbm (in vec2 st) { // Initial values float value = 0.0; float amplitude = .5; float frequency = 0.; // // Loop of octaves for (int i = 0; i < OCTAVES; i++) { value += amplitude * noise(st); st *= 2.; amplitude *= .5; } return value; } void main() { /* vec2 st = vtc; float cloudIntensity = 15.0; // Efekt lustrzanego odbicia vec2 mirroredSt = vec2(1.0 - st.x, st.y); mirroredSt.x += u_time * 0.07; vec3 mirroredColor = vec3(0.0); mirroredColor += fbm(mirroredSt * cloudIntensity); st.x -= u_time * 0.07; // Efekt oryginalny vec3 color = vec3(0.0); color += fbm(st * cloudIntensity); // Dodaj gradientowe mieszanie między oryginałem a lustrzanym odbiciem float gradient = smoothstep(0.45, 0.55, st.x); vec3 finalColor = mix(color, mirroredColor, gradient); outColor = vec4(finalColor, 1.0); */ vec2 st = vtc; st.x -= u_time * 0.07; vec3 color = vec3(0.0); color += fbm(st*10.0); //vec3 mixedColor = mix(vec3(0.4), color, color.r); //color = mix(vec3(1.0), fbm(st*3.0), 0.1); outColor = vec4(color,1.0); }