Files
forge-steel/lab/frag1.example.glsl
2026-11-08 18:14:21 +01:00

39 lines
826 B
GLSL

#version 460
#include inc_functions.glsl
#include inc_magic.glsl
in vec2 vUV;
out vec4 fragColor;
uniform sampler2D iTex0; // feedback
uniform int iSeed1;
uniform vec3 iGroup1_1[6];
vec4 src_stage(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3)
{
// start
vec2 uv0 = vUV.st;
float ratio = iResolution.x / iResolution.y;
vec2 uv1 = (uv0 - .5) * vec2(ratio, 1.);
// controls
float ctrl1 = magic(f1, b1, seed + 10.);
float ctrl2 = magic(f2, b2, seed + 20.);
float ctrl3 = magic(f3, b3, seed + 30.);
// logic
vec3 c = vec3(uv1.x, uv1.y, cos(iBeats) * 0.5 + 0.5);
// output
return vec4(c, 1.);
}
void main() {
fragColor = src_stage(vUV, iSeed1, iGroup1_1[0], iGroup1_1[1].xy, iGroup1_1[2], iGroup1_1[3].xy, iGroup1_1[4], iGroup1_1[5].xy);
}