feat: working in src

This commit is contained in:
2026-11-08 23:20:26 +01:00
parent 3d86c9cf60
commit 2e3aa7925d
2 changed files with 22 additions and 12 deletions
+1
View File
@@ -135,6 +135,7 @@ glsl-glyphs-sentences: sentences.txt ## glsl-glyphs --sentences-only
--glyph-names sample/cp437_names.txt \ --glyph-names sample/cp437_names.txt \
--sentences-only \ --sentences-only \
--sentences-input ../../sentences.txt \ --sentences-input ../../sentences.txt \
--output ../../project/inc_cp437.glsl \
--sentences-output ../../project/inc_sentences.glsl --sentences-output ../../project/inc_sentences.glsl
.PHONY: glsl-glyphs-dungeon .PHONY: glsl-glyphs-dungeon
+21 -12
View File
@@ -3,6 +3,7 @@
#include inc_functions.glsl #include inc_functions.glsl
#include inc_cp437.glsl #include inc_cp437.glsl
#include inc_sentences.glsl #include inc_sentences.glsl
#include inc_dungeon.glsl
#ifndef INC_SRC #ifndef INC_SRC
#define INC_SRC #define INC_SRC
@@ -139,21 +140,29 @@ vec4 src_5(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2
// controls // controls
float zoom = magic(f1, b1, seed + 10.); float zoom = magic(f1, b1, seed + 10.) * 3. + 3.;
float voronoi_distort = magic(f2, b2, seed + 20.); float overthrow = magic(f2, b2, seed + 20.) * 30. + 3.;
float details = magic(f3, b3, seed + 30.); float quantize = (1. - magic(f3, b3, seed + 30.)) * 10. + 1.;
float noise_factor = magic(seed + 40.);
// logic // logic
vec2 uv2 = uv1; vec2 uv2 = uv1 * zoom + 1000;
uv2 *= zoom * 20. + 3.;
uv2.x += iBeats; uv2.x += iBeats;
vec4 data = voronoi(uv2, voronoi_distort, seed + 50, iBeats);
float f = data.x / (data.x + data.y); float f = 0;
f = sin(f * PI * (details * 20.)) * .5 + 1.; f += perlin(uv2 * 1., seed + 00) * .5;
int nf = int(noise_factor * 6.); f += perlin(uv2 * 2., seed + 10) * .25;
f *= mix(1., noise_f(uv2, nf - 1), step(.0, float(nf))); f += perlin(uv2 * 4., seed + 10) * .125;
f += perlin(uv2 * 8., seed + 10) * .0625;
f += perlin(uv2 * 16., seed + 10) * .03125;
f = (f - 0.5) * 2.;
f *= overthrow;
f = round(f * quantize) / quantize;
f = (f + 1.0) * 0.5;
return vec4(f); return vec4(f);
} }
@@ -286,7 +295,7 @@ vec4 src_9(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2
ivec2 uv2i = ivec2(uv2); ivec2 uv2i = ivec2(uv2);
int code = ((charset_ctrl.y < 1. || (uv2i.x % 2 ^ uv2i.y % 2) > 0) ? 1 : 0) * (start_char + int((rand(uv2i) + char_delta) * char_span) % char_span); int code = ((charset_ctrl.y < 1. || (uv2i.x % 2 ^ uv2i.y % 2) > 0) ? 1 : 0) * (start_char + int((rand(uv2i) + char_delta) * char_span) % char_span);
uv2 = mod(uv2, 1.); uv2 = mod(uv2, 1.);
float f = cp437(uv2, code) ? 1. : 0.; float f = dungeon(uv2, code) ? 1. : 0.;
return vec4(f); return vec4(f);
} }