diff --git a/Makefile.dev b/Makefile.dev index 1554f73..0e81d16 100644 --- a/Makefile.dev +++ b/Makefile.dev @@ -135,6 +135,7 @@ glsl-glyphs-sentences: sentences.txt ## glsl-glyphs --sentences-only --glyph-names sample/cp437_names.txt \ --sentences-only \ --sentences-input ../../sentences.txt \ + --output ../../project/inc_cp437.glsl \ --sentences-output ../../project/inc_sentences.glsl .PHONY: glsl-glyphs-dungeon diff --git a/project/inc_src.glsl b/project/inc_src.glsl index 890942d..b706ab0 100644 --- a/project/inc_src.glsl +++ b/project/inc_src.glsl @@ -3,6 +3,7 @@ #include inc_functions.glsl #include inc_cp437.glsl #include inc_sentences.glsl +#include inc_dungeon.glsl #ifndef 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 - float zoom = magic(f1, b1, seed + 10.); - float voronoi_distort = magic(f2, b2, seed + 20.); - float details = magic(f3, b3, seed + 30.); - float noise_factor = magic(seed + 40.); + float zoom = magic(f1, b1, seed + 10.) * 3. + 3.; + float overthrow = magic(f2, b2, seed + 20.) * 30. + 3.; + float quantize = (1. - magic(f3, b3, seed + 30.)) * 10. + 1.; // logic - vec2 uv2 = uv1; - uv2 *= zoom * 20. + 3.; + vec2 uv2 = uv1 * zoom + 1000; uv2.x += iBeats; - vec4 data = voronoi(uv2, voronoi_distort, seed + 50, iBeats); - float f = data.x / (data.x + data.y); - f = sin(f * PI * (details * 20.)) * .5 + 1.; - int nf = int(noise_factor * 6.); - f *= mix(1., noise_f(uv2, nf - 1), step(.0, float(nf))); + + float f = 0; + f += perlin(uv2 * 1., seed + 00) * .5; + f += perlin(uv2 * 2., seed + 10) * .25; + 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); } @@ -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); 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.); - float f = cp437(uv2, code) ? 1. : 0.; + float f = dungeon(uv2, code) ? 1. : 0.; return vec4(f); }