Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spoilers] New expressions used in Stage 1-6 dialogue #223

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a00279c
WIP Yumemi
Akaricchi Mar 16, 2020
505a074
WIP Yumemi survival spell
Akaricchi Apr 8, 2020
b3cbbbd
wip extra glitch effect
Akaricchi Apr 24, 2020
ca11292
Yumemi slaves/familiars concept
Akaricchi Apr 25, 2020
00fba2e
attempt to tweak extra background
Akaricchi Apr 28, 2020
9236082
Reorganize extra stage code into multiple files
Akaricchi Apr 28, 2020
a2e8c9c
Yumemi opening non-spell prototype
Akaricchi Apr 30, 2020
aa9c65f
fix Yumemi slave faders
Akaricchi May 1, 2020
2a9dc35
sketch up another Yumemi spell
Akaricchi May 2, 2020
2384aee
sierpinski tweaks
Akaricchi May 2, 2020
7094ae6
Basic spell practice for extra stage
Akaricchi May 2, 2020
feb5861
another sierpinski variation
Akaricchi May 2, 2020
854cc1b
stagex: boss setup cleanup
Akaricchi May 3, 2020
fc40976
Add a spell bg for Yumemi
Akaricchi May 3, 2020
c1b0532
stagex: set up pre- and post- dialogue
Akaricchi May 4, 2020
0a19bb7
fix yumemi spell bg transition
Akaricchi May 4, 2020
3de1496
render procedural yumemi spell bg mask in lower resolution
Akaricchi May 6, 2020
51ff8c3
reduce crazy amount of particles in infinity net
Akaricchi May 6, 2020
272e1bd
add (and rename) missing shader
Akaricchi May 7, 2020
05649c2
draft commit of full EX boss dialogue
StarWitch May 3, 2020
d16c905
fix smartquotes(???) and change some dialogue
StarWitch May 3, 2020
840675e
add Elly dialogue in EX stage
StarWitch May 6, 2020
b6afd1c
rebalance some of the expressions in the dialogue, add the news one t…
StarWitch May 6, 2020
baff6e9
expression spelling mistake in atlas, 'embarrased' vs 'embarrassed'. …
StarWitch May 6, 2020
40ba360
minor wording change
StarWitch May 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions atlas/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ atlases = [
['gray16', [preset_png]],
['huge', []],
['portraits', ['--width=4096', '--height=4096']],
['temp_stagex', []],
]

atlas_profiles = [
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions resources/00-taisei.pkgdir/gfx/atlas_temp_stagex_0.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Autogenerated by the atlas packer, do not modify

source = res/gfx/atlas_temp_stagex_0.webp

# -- Pasted from the global override file --

anisotropy = 1
Binary file not shown.
3 changes: 3 additions & 0 deletions resources/00-taisei.pkgdir/gfx/boss/yumemi.ani
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@sprite_count = 1

main = d1 0
4 changes: 4 additions & 0 deletions resources/00-taisei.pkgdir/gfx/boss/yumemi.frame0000.spr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
texture = boss/yumemi_placeholder

w = 79.5
h = 110
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Autogenerated by the atlas packer, do not modify

texture = atlas_temp_stagex_0
region_x = 0.00177304964539007
region_y = 0.01063829787234043
region_w = 0.16312056737588654
region_h = 0.97872340425531912
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Autogenerated by the atlas packer, do not modify

texture = atlas_temp_stagex_0
region_x = 0.16843971631205673
region_y = 0.01063829787234043
region_w = 0.16312056737588654
region_h = 0.97872340425531912
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Autogenerated by the atlas packer, do not modify

texture = atlas_temp_stagex_0
region_x = 0.33510638297872342
region_y = 0.01063829787234043
region_w = 0.16312056737588654
region_h = 0.97872340425531912
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Autogenerated by the atlas packer, do not modify

texture = atlas_temp_stagex_0
region_x = 0.50177304964539005
region_y = 0.01063829787234043
region_w = 0.16312056737588654
region_h = 0.97872340425531912
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Autogenerated by the atlas packer, do not modify

texture = atlas_temp_stagex_0
region_x = 0.66843971631205679
region_y = 0.01063829787234043
region_w = 0.16312056737588654
region_h = 0.97872340425531912
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Autogenerated by the atlas packer, do not modify

texture = atlas_temp_stagex_0
region_x = 0.83510638297872342
region_y = 0.01063829787234043
region_w = 0.16312056737588654
region_h = 0.97872340425531912
19 changes: 18 additions & 1 deletion resources/00-taisei.pkgdir/shader/extra_bg.glslh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#include "lib/util.glslh"

vec2 code_transform_uv(float num_segs, float inv_num_segs, vec2 uv) {
uv *= inv_num_segs;
float cur_segment = floor(mod(uv.y, num_segs)) * inv_num_segs;
Expand Down Expand Up @@ -56,7 +58,22 @@ vec4 sample_background(
vec4 background_binary = texture(sampler_bg_binary, bg_binary_uv);
vec4 code = sample_code(sampler_code, code_tex_params, code_uv) * r;

background = background * background_binary + code;
background = background * background_binary;

vec3 hsv = rgb2hsv(background.rgb);
hsv.y *= 0.5 + 0.5 * uv.y;
hsv.z *= 0.6 + 0.4 * uv.y;
background.rgb = hsv2rgb(hsv);

hsv = rgb2hsv(code.rgb);
float xf = 1.0 - 4.0 * (uv.x - uv.x * uv.x);
float yf = 1.0 - 4.0 * (uv.y - uv.y * uv.y);
hsv.x += 0.1 * yf - 0.1 * (xf * xf * xf * xf) * (1.0 - yf * yf);
hsv.y *= 0.5 + 0.5 * (1 - pow(1 - uv.y, 2.0));
code.rgb = hsv2rgb(hsv);
code.rgb *= (1.0 - yf * yf);

background += code;
background.rgb = pow(background.rgb, mix(1 - vec3(1.0, 0.5, 0.3), vec3(1), r));

return background;
Expand Down
128 changes: 128 additions & 0 deletions resources/00-taisei.pkgdir/shader/extra_glitch.frag.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#version 330 core

#include "lib/render_context.glslh"
#include "interface/standard.glslh"

// UNIFORM(1) vec3 time_offsets = vec3(0.143133, 0.53434, 0.25332);
// UNIFORM(2) vec3 time_scales = vec3(1.0);

UNIFORM(1) vec3 times;
UNIFORM(2) vec3 cutoffs = vec3(0.53, 0.56, 0.51);
UNIFORM(3) vec2 grid = vec2(8.0, 16.0);
UNIFORM(4) vec3 waverectfactors = vec3(7.0);
UNIFORM(5) sampler2D mask;

float hash(vec2 co) {
float a = 12.9898;
float b = 78.233;
float c = 43758.5453;
float dt = dot(co, vec2(a, b));
float sn = mod(dt, 3.14);
return fract(sin(sn) * c);
}

float wave(float x) {
float y = sin(x) + cos(3.0*x) + sin(5.0*x) + cos(7.0*x);
float m = 3.0;
return clamp((m + y) / (2.0 * m), 0.0, 1.0);
}

vec3 wave(vec3 v) {
return vec3(
wave(v.x),
wave(v.y),
wave(v.z)
);
}

float rect(float x, float g) {
return round(g * x) / g;
}

vec2 rect(vec2 v, vec2 g) {
return vec2(
rect(v.x, g.x),
rect(v.y, g.y)
);
}

vec3 rect(vec3 v, vec3 g) {
return vec3(
rect(v.x, g.x),
rect(v.y, g.y),
rect(v.z, g.z)
);
}

vec3 glitch(vec2 uv, vec3 time, vec2 grid, vec3 cutoffs, vec3 waverectfactors) {
uv = rect(uv, grid);
vec3 t = time;
vec3 v = wave(t);
vec3 mstatic = step(cutoffs, v);
vec3 mchaotic = step(cutoffs, v * v);
v = rect(v, waverectfactors);
vec3 mask = vec3(
hash(uv + t.r * mchaotic.r),
hash(uv + t.g * mchaotic.g),
hash(uv + t.b * mchaotic.b)
);
mask = step(mstatic * v, mask);
mask = (1.0 - mask);
// mask *= v;
return mask;
}
#if 0
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord/iResolution.xy;

vec2 grid = vec2(8.0, 16.0);
vec3 cutoffs = vec3(0.53, 0.56, 0.51) * 2.0 * iMouse.x/iResolution.x;
vec3 timeofs = vec3(0.143133, 0.53434, 0.25332) * 0.1;
vec3 waverectfactors = vec3(7.0);
vec3 k = glitch(uv, iTime, grid, cutoffs, timeofs, waverectfactors);

vec4 tex = texture(iChannel1, uv);
vec4 tex_ofs = vec4(1);// = texture(iChannel1, uv - 1.0 / grid);

vec3 o = sin(3.14*2.0*k);

tex_ofs.r = texture(iChannel1, uv - o.r / grid).r;
tex_ofs.g = texture(iChannel1, uv - o.g / grid).g;
tex_ofs.b = texture(iChannel1, uv - o.b / grid).b;

tex.rgb = mix(tex.rgb, tex_ofs.rgb, k);
// tex.rgb = k;


// tex.r = A;

fragColor = tex;
}
#endif
void main(void) {
vec2 uv = texCoord;

vec4 texNormal = texture(tex, uv);
vec3 m = texture(mask, uv).rgb;
float a = m.r + m.g + m.b;

if(a == 0) {
fragColor = texNormal;
return;
} else {
// fragColor = vec4(a,0,0,1);
// return;
}

// vec3 t = float(frames) / 60.0 * time_scales + time_offsets;
vec3 k = glitch(uv, times, grid, cutoffs, waverectfactors);
vec3 o = k * a * 0.25;

vec3 texGlitched;
texGlitched.r = texture(tex, uv - o.r / grid).r;
texGlitched.g = texture(tex, uv - o.g / grid).g;
texGlitched.b = texture(tex, uv - o.b / grid).b;

fragColor.rgb = mix(texNormal.rgb, texGlitched, k);
fragColor.a = texNormal.a;
}
2 changes: 2 additions & 0 deletions resources/00-taisei.pkgdir/shader/extra_glitch.prog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

objects = extra_glitch.frag standard.vert
5 changes: 5 additions & 0 deletions resources/00-taisei.pkgdir/shader/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ glsl_files = files(
'circle_distort.frag.glsl',
'copy_depth.frag.glsl',
'extra_bg.frag.glsl',
'extra_glitch.frag.glsl',
'extra_tower_apply_mask.frag.glsl',
'extra_tower_mask.frag.glsl',
'extra_tower_mask.vert.glsl',
Expand Down Expand Up @@ -63,6 +64,8 @@ glsl_files = files(
'sprite_silhouette.vert.glsl',
'sprite_yinyang.frag.glsl',
'sprite_youmu_myon_shot.frag.glsl',
'sprite_yumemi_overlay.frag.glsl',
'sprite_yumemi_overlay.vert.glsl',
'stage1_water.frag.glsl',
'stage6_sky.frag.glsl',
'stage6_sky.vert.glsl',
Expand All @@ -86,6 +89,8 @@ glsl_files = files(
'tunnel.frag.glsl',
'youmu_bomb_bg.frag.glsl',
'youmua_bomb.frag.glsl',
'yumemi_spellbg_voronoi.frag.glsl',
'yumemi_spellbg_voronoi_compose.frag.glsl',
'zbuf_fog.frag.glsl',
# @end glsl
)
Expand Down
2 changes: 2 additions & 0 deletions resources/00-taisei.pkgdir/shader/multiply2.prog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

objects = standard.vert multiply2.frag
41 changes: 41 additions & 0 deletions resources/00-taisei.pkgdir/shader/sprite_yumemi_overlay.frag.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#version 330 core

#include "interface/sprite.glslh"
#include "lib/util.glslh"
#include "lib/sprite_main.frag.glslh"
#include "extra_bg.glslh"

void spriteMain(out vec4 fragColor) {
float time = customParams.x;
vec2 code_aspect = customParams.yz;
float num_segs = customParams.w;
float inv_num_segs = 1.0 / num_segs;

vec4 mask = texture(tex, texCoord);
vec2 codeUV = texCoordRaw + mask.rb * (1 - mask.g) * 0.1;

vec4 code_params = vec4(code_aspect * vec2(1.5, 1), num_segs, inv_num_segs);
vec4 code = sample_code(tex_aux[0], code_params, codeUV + vec2(0.03, -0.05) * time);

float m = 0.5 + 0.5 * sin(time * 3.21 + codeUV.y * 96.31);
float ca = (1 - smoothstep(0.01, 0.2, mix(mask.b, mask.r, m)));
ca = sin(4 * pi * ca + 32.311 * codeUV.x - 1.31 * time);
ca = smoothstep(-0.5, 1.0, ca);

code.rgb = 1 - pow(mask.rgb, code.rgb);
code.g *= 1 - 2 * (mask.b + mask.r);
code.rgb *= ca * 0.5;

fragColor = vec4(code.rgb + mask.rgb * code.a * 2, 0);

code = sample_code(tex_aux[0], code_params, codeUV + vec2(-0.0359, -0.04837) * time);
fragColor.rgb += vec3(mask.rgb * code.a * 2);

fragColor *= color * mask.a;

// fragColor = color * vec4(mask.ggg, mask.a);

// fragColor = vec4(vec3(ca, code.a, 0), 1);
// fragColor = smoothstep(0.05, 0.1, mask);
// fragColor = vec4(codeUV.x, codeUV.y, 0, 1.0);
}
2 changes: 2 additions & 0 deletions resources/00-taisei.pkgdir/shader/sprite_yumemi_overlay.prog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

objects = sprite_yumemi_overlay.frag sprite_yumemi_overlay.vert
17 changes: 17 additions & 0 deletions resources/00-taisei.pkgdir/shader/sprite_yumemi_overlay.vert.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#version 330 core

#include "interface/sprite.glslh"
#include "lib/util.glslh"
#include "lib/render_context.glslh"

void main(void) {
gl_Position = r_projectionMatrix * spriteVMTransform * vec4(vertPos, 0.0, 1.0);

color = spriteRGBA;
texCoordRaw = vertTexCoord;
texCoord = uv_to_region(spriteTexRegion, vertTexCoord);
// texCoordOverlay = (spriteTexTransform * vec4(vertTexCoord, 0.0, 1.0)).xy;
// texRegion = spriteTexRegion;
// dimensions = spriteDimensions;
customParams = spriteCustomParams;
}
61 changes: 61 additions & 0 deletions resources/00-taisei.pkgdir/shader/yumemi_spellbg_voronoi.frag.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#version 330 core

#include "interface/standard.glslh"
#include "lib/util.glslh"

/*
* Based on https://www.shadertoy.com/view/MtlyR8
*/

#define rnd(p) fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453)
#define srnd(p) (2.0 * rnd(p) - 1.0)

#define N 3

UNIFORM(1) float time;
UNIFORM(2) vec4 color;

void main(void) {
vec2 uv = 12.0 * texCoordRaw;
float m = 1e9, m2, c = 1e2, v, w;

// visit 3x3 neighbor tiles
for(int k = 0; k < N * N; ++k) {
// tile center
vec2 iU = floor(uv) + 0.5;

// neighbor cell
vec2 g = iU + vec2(k % N, k / N) - 1.0;

float jitter = srnd(g);

// vector to jittered cell node
vec2 p = g + 0.1 * jitter - uv;
p += 0.1 * sin(time + vec2(1.6, 0.0) + pi * jitter);

// --- choose distance kind ------------------

// L2 distance
// v = length(p);

// L1 distance
v = abs(p.x) + abs(p.y);

// Linfinity distance ( = Manhattan = taxicab distance)
// p = abs(p); v = max(p.x, p.y);

if(v < m) {
// keep 1st and 2nd min distances to node
m2 = m;
m = v;
} else if(v < m2) {
m2 = v;
}
}

float f = 0.5 + 0.5 * sin(time - uv.y + 2.0 * m);
f = smoothstep(m2 - m, m2 * m, f);
v = mix(m2 * m, m2 - m, f);

fragColor = color / v;
}
2 changes: 2 additions & 0 deletions resources/00-taisei.pkgdir/shader/yumemi_spellbg_voronoi.prog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

objects = standard.vert yumemi_spellbg_voronoi.frag
Loading