This commit is contained in:
Rakarake 2026-03-12 12:26:32 +01:00
parent 666b6f6d56
commit d4a5fea127
3 changed files with 12 additions and 2 deletions

View file

@ -24,9 +24,15 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord) {
lines_uv.y += sin(lines_timescale * 0.2 + lines_uv.x * 5.0) * 0.2; lines_uv.y += sin(lines_timescale * 0.2 + lines_uv.x * 5.0) * 0.2;
lines_uv.x += sin(lines_timescale + lines_uv.y * 30.0) * 0.2;// * sin(lines_timescale); lines_uv.x += sin(lines_timescale + lines_uv.y * 30.0) * 0.2;// * sin(lines_timescale);
float hor_lines = sin(lines_uv.x * 10.0)/2.0 + 0.5; float hor_lines = sin(lines_uv.x * 10.0)/2.0 + 0.5;
hor_lines = sign(hor_lines -0.5); float extra_hor_lines = hor_lines;
// clipped with AA
hor_lines = extra_hor_lines; //sign(hor_lines -0.5);
//hor_lines = sin(iTime * 3.0 +hor_lines * 2.0 + uv.y / 50.0); //hor_lines = sin(iTime * 3.0 +hor_lines * 2.0 + uv.y / 50.0);
//fragColor = vec4(uv.x, uv.y, 1.0, 1.0); //fragColor = vec4(uv.x, uv.y, 1.0, 1.0);
fragColor = vec4(hor_lines * 0.7, inverse_distance * 0.55, inverse_distance * 0.75, 1.0); float frac = 0.50;
fragColor = vec4(hor_lines * frac, hor_lines * frac, hor_lines * frac + 0.4, 1.0);
} }

View file

@ -22,6 +22,8 @@
]; ];
buildInputs = with pkgs; [ buildInputs = with pkgs; [
libGL libGL
libpng
libjpeg
]; ];
makeFlags = [ "PREFIX=$(out)" ]; makeFlags = [ "PREFIX=$(out)" ];
}; };

View file

@ -3,8 +3,10 @@
#include <string.h> #include <string.h>
#include <GL/gl.h> #include <GL/gl.h>
#include <stdlib.h> #include <stdlib.h>
#include <libpng16/png.h>
#include "renderer.h" #include "renderer.h"
/// returns 0 if failed. /// returns 0 if failed.
GLuint compile_shader(GLuint type, const char *src) { GLuint compile_shader(GLuint type, const char *src) {
GLuint id = glCreateShader(type); GLuint id = glCreateShader(type);