add fps uniform
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
uniform float iTime;
|
||||
uniform float iTempo;
|
||||
uniform int iFPS;
|
||||
uniform vec2 iResolution;
|
||||
|
||||
// 2. other frames
|
||||
|
||||
+1
-1
@@ -12,5 +12,5 @@ void main() {
|
||||
vec2 uv1 = (uv0 - .5) * vec2(ratio, 1);
|
||||
vec3 color = vec3(vUV, sin(iTime * 0.5) * 0.5 + 0.5);
|
||||
color *= 1 - step(cos(iTime) * 0.1 + 0.4, length(uv1));
|
||||
fragColor = color + texture(frame0, vUV - 0.04).xyz * 0.5;
|
||||
fragColor = color + texture(frame0, vUV - 0.01).xyz * 0.5;
|
||||
}
|
||||
+17
-1
@@ -7,5 +7,21 @@ in vec2 vUV;
|
||||
layout(location = 4) out vec3 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = vec3(vUV, 0.0) * step(0.3, vUV.x) * step(-0.4, -vUV.x);
|
||||
vec2 uv0 = vUV.st;
|
||||
float ratio = iResolution.x / iResolution.y;
|
||||
vec2 uv1 = uv0 * vec2(ratio, 1);
|
||||
vec2 uv2 = uv1 * 20;
|
||||
|
||||
// uv2 = mod(uv2, 1);
|
||||
|
||||
bool v = false;
|
||||
|
||||
v = v || iFPS > 99 && char(uv2 - vec2(0.5, 0.5), 0x30 + (iFPS % 1000) / 100);
|
||||
v = v || iFPS > 9 && char(uv2 - vec2(1.5, 0.5), 0x30 + (iFPS % 100) / 10);
|
||||
v = v || char(uv2 - vec2(2.5, 0.5), 0x30 + (iFPS % 10));
|
||||
v = v || char(uv2 - vec2(4.0, 0.5), 0x66);
|
||||
v = v || char(uv2 - vec2(5.0, 0.5), 0x70);
|
||||
v = v || char(uv2 - vec2(6.0, 0.5), 0x73);
|
||||
|
||||
fragColor = vec3(v ? 1 : 0);
|
||||
}
|
||||
+1
-1
@@ -7,5 +7,5 @@ in vec2 vUV;
|
||||
layout(location = 5) out vec3 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = texture(frame3, vUV).xyz;
|
||||
fragColor = gauss2(frame3, vUV, 0.001); //texture(frame3, vUV).xyz;
|
||||
}
|
||||
Reference in New Issue
Block a user