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

WIP: Extra stage #384

Draft
wants to merge 74 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
34353a6
WIP Yumemi
Akaricchi Mar 16, 2020
5092587
WIP Yumemi survival spell
Akaricchi Apr 8, 2020
60ad233
wip extra glitch effect
Akaricchi Apr 24, 2020
8db277d
Yumemi slaves/familiars concept
Akaricchi Apr 25, 2020
d7b5957
attempt to tweak extra background
Akaricchi Apr 28, 2020
a31990f
Reorganize extra stage code into multiple files
Akaricchi Apr 28, 2020
e5be332
Yumemi opening non-spell prototype
Akaricchi Apr 30, 2020
4c80380
fix Yumemi slave faders
Akaricchi May 1, 2020
748610a
sketch up another Yumemi spell
Akaricchi May 2, 2020
9948241
sierpinski tweaks
Akaricchi May 2, 2020
c9793c9
Basic spell practice for extra stage
Akaricchi May 2, 2020
d9ecb5c
another sierpinski variation
Akaricchi May 2, 2020
1795945
stagex: boss setup cleanup
Akaricchi May 3, 2020
79d738b
Add a spell bg for Yumemi
Akaricchi May 3, 2020
0a7f8f2
stagex: set up pre- and post- dialogue
Akaricchi May 4, 2020
79293bb
fix yumemi spell bg transition
Akaricchi May 4, 2020
7f6c21a
render procedural yumemi spell bg mask in lower resolution
Akaricchi May 6, 2020
960ab9d
reduce crazy amount of particles in infinity net
Akaricchi May 6, 2020
7f00368
EX Boss Dialogue (#222)
StarWitch May 7, 2020
007d07e
New expressions used in Stage 1-6 dialogue (#223)
StarWitch May 6, 2020
28d1e44
prototype next 2 yumemi nons
Akaricchi May 8, 2020
7ae455a
sierpinski wip
laochailan May 9, 2020
fec5dfd
sierpinski laser stuff
Akaricchi May 9, 2020
ff6f7bd
fix warnings
Akaricchi May 16, 2020
b8769df
add missing comma, fix building for EX stage
StarWitch May 23, 2020
afd9078
stagex: move Yumemi's nons into separate file and extend them (WIP)
Akaricchi Jul 2, 2020
1085c88
s/stageex/stagex; misc fixes
Akaricchi Jul 11, 2020
77c001b
Implement a bombshield for Yumemi
Akaricchi Jul 11, 2020
020fd0a
stagex: three fairy sketches
laochailan Dec 25, 2020
78a620e
scuttle non sketch
laochailan Dec 26, 2020
923b345
rest of the attack
laochailan Dec 26, 2020
48fec36
implemented suggestions from akari
laochailan Dec 27, 2020
984d09d
convert trap representation to a spell and fix mess ups
laochailan Dec 27, 2020
868a76a
scuttle second spell
laochailan Dec 28, 2020
9e18b4a
yumemi memcpy spell
laochailan Dec 30, 2020
0f5cf17
wip yumemi spell
laochailan Jan 1, 2021
8c367dc
add the pipes to pipe dream (no animation yet)
laochailan Jan 3, 2021
d91e506
attempt to rebase Yumemi branch - several things don't work, but the …
StarWitch Jun 16, 2021
585cddd
fix stage EX crash
StarWitch Jun 21, 2021
284fbfe
stagex: fix deprecations
Akaricchi Jun 22, 2021
042904c
stagex: fix yumemi nons
Akaricchi Jun 22, 2021
acde593
progress: reserve a BGMID for stagex
Akaricchi Jun 22, 2021
5540788
stagex: add lao's yumemi spells to timelime for testing
Akaricchi Jun 22, 2021
1d0bdab
wip extra bg revamp
Akaricchi Jun 24, 2021
09c4f5c
stagex: more background work; music sync experiments
Akaricchi Jul 24, 2021
3e115f7
stagex: make it compile
Akaricchi Nov 27, 2023
1f82165
stagex: make it not crash
Akaricchi Nov 27, 2023
122a622
stagex: fix the background, more or less
Akaricchi Nov 28, 2023
a7b57ee
stagex: fix deprecation warnings
Akaricchi Dec 6, 2023
444eda5
stagex: yumemi: adjust slave laser sweep attack, move to common procs
Akaricchi Mar 14, 2024
852355d
menu: add extra stage music to musicroom
Akaricchi Mar 18, 2024
47ef101
stages: expose extra stage spell cards for practice
Akaricchi Mar 18, 2024
1544b03
stagex: basic sierpinski redesign
Akaricchi Mar 22, 2024
16e71aa
stagex: various tweaks to the memcopy spell
Akaricchi Mar 25, 2024
37cac59
stagex: majorly revamp infnet
Akaricchi Apr 4, 2024
0b9252b
stagex: draft new yumemi spell (alignment)
Akaricchi Apr 6, 2024
210e082
stagex: fix warning in alignment spell
Akaricchi Apr 14, 2024
09c6d41
stagex: shut up GCC warning
Akaricchi Apr 24, 2024
d824050
stagex: add yumemi spell loosely based on protection rings
Akaricchi Apr 24, 2024
0c8d4af
resources/shader/extra_glitch: fix gles30 compat and clean up
Akaricchi Apr 30, 2024
737aaaf
stagex: experimental enemy laser pattern
Akaricchi May 9, 2024
fde58e1
stagex: background dissolve effect tweaks
Akaricchi May 11, 2024
2879bf5
stagex: enable all boss spells available so far
Akaricchi May 11, 2024
ecf6f15
stagex: fix post-rebase fallout
Akaricchi May 15, 2024
6ae8ec4
resources: add stagex music by jneen
Akaricchi May 16, 2024
4319dcd
stagex: fix more post-rebase fallout
Akaricchi May 18, 2024
bfae313
stageutils: make camera3d_project() account for translation
Akaricchi May 22, 2024
7b3b444
enemy_classes: ecls_anyenemy_fake3dmovein(): reproject 3d pos every f…
Akaricchi May 22, 2024
299a287
stagex: WIP background tweaks
Akaricchi May 22, 2024
c7bf67c
stagex: ecls_anyenemy_fake3dmovein test
Akaricchi May 22, 2024
e3eb7f0
stagex: add some sfx to infnet
Akaricchi Jun 14, 2024
219f7a6
stagex: add some sfx to alignment spell
Akaricchi Jun 14, 2024
5643a97
stagex: infinity_net: use sort_r() instead of qsort_r()
Akaricchi Jun 16, 2024
66605a4
stagex: post-rebase fixups
Akaricchi Oct 15, 2024
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 @@ -43,6 +43,7 @@ atlases = [
['common_ui', ['--width=1024', '--height=1024']],
['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.
Binary file added resources/00-taisei.pkgdir/bgm/stagex.opus
Binary file not shown.
Binary file added resources/00-taisei.pkgdir/bgm/stagexboss.opus
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
2 changes: 2 additions & 0 deletions resources/00-taisei.pkgdir/gfx/stagex/bg_binary.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

format = r8
2 changes: 2 additions & 0 deletions resources/00-taisei.pkgdir/gfx/stagex/hex_tiles.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

format = rg8
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

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

UNIFORM(1) sampler2D shell_tex;
UNIFORM(2) sampler2D grid_tex;
UNIFORM(3) vec2 grid_aspect;
UNIFORM(4) sampler2D code_tex;
UNIFORM(5) vec2 code_aspect;

UNIFORM(6) float time;
UNIFORM(7) float alpha;

vec2 edts(vec2 p) {
vec2 uv = p * p;
vec2 s = 2.0 + uv - uv.yx;
vec2 t = (2.0 * sqrt(2.0)) * p;
vec2 t1 = s + t;
vec2 t2 = s - t;
// t1 = abs(t1); t2 = abs(t2);
return 0.5 * (sqrt(t1) - sqrt(t2));
}

void main(void) {
vec2 uv = texCoord;
float f = distance(uv, vec2(0.5));

if(f > 0.5) {
discard;
}

f = 1.0 - 2.0 * f;
float t = time;
vec2 warped_uv = edts((2.0 - pow(f, 1.0/3.0)) * (uv - 0.5)) + 0.5;

vec2 grid = texture(grid_tex, grid_aspect * (warped_uv + vec2(t * 2.0, 0.0))).rg;

vec3 c0 = vec3(0.85 * (warped_uv.y), 0.5, 1.0 - 0.5 * warped_uv.y);
c0 = pow(texture(shell_tex, warped_uv + vec2(t * 1.3, t * 0.73)).rgb, 1.0 - c0);

vec3 c1 = texture(code_tex, code_aspect * (warped_uv + vec2(t * 2.1, t * -0.42))).rrr;
c1 *= vec3(0.2, 0.7, 1.0);

float ring = clamp(smoothstep(0.0, 0.03, f) * (1.0 - f), 0.0, 1.0);
float bg = smoothstep(0.0, 0.1, f);
float h = smoothmax(bg * grid.r, ring, grid.r * (10 - 8 * ((1 - f * f) * alpha)) + ring);

float alpha2 = alpha * alpha;

c0 *= h;
c1 *= grid.g * alpha2;

fragColor = vec4((c0 + c1) * alpha2, 0.6 * bg * alpha);
}
2 changes: 2 additions & 0 deletions resources/00-taisei.pkgdir/shader/bombshield.prog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

objects = standardnotex.vert bombshield.frag
21 changes: 19 additions & 2 deletions 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 @@ -53,10 +55,25 @@ vec4 sample_background(
code_uv.y += t * 0.2;

vec4 background = texture(sampler_bg, bg_uv);
vec4 background_binary = texture(sampler_bg_binary, bg_binary_uv);
float background_binary = texture(sampler_bg_binary, bg_binary_uv).r;
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
95 changes: 95 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,95 @@
#version 330 core

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

UNIFORM(1) vec3 times;
UNIFORM(2) sampler2D mask;

const vec3 cutoffs = vec3(0.53, 0.56, 0.51);
const vec2 grid = vec2(8.0, 16.0);
const vec3 waverectfactors = vec3(7.0);

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;
}

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;
}

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
18 changes: 15 additions & 3 deletions resources/00-taisei.pkgdir/shader/extra_tower_apply_mask.frag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ UNIFORM(3) sampler2D background_tex;
UNIFORM(4) sampler2D background_binary_tex;
UNIFORM(5) sampler2D code_tex;
UNIFORM(6) vec4 code_tex_params; // (aspect_x, aspect_y, num_segs, 1/num_segs)
UNIFORM(7) vec2 dissolve; // (dissolve, dissolve^2)
UNIFORM(7) float global_dissolve;
UNIFORM(8) float time;

vec4 sample_background(vec2 uv, float r, float t) {
Expand All @@ -31,7 +31,11 @@ void main(void) {
float depthval = texture(depth_tex, texCoord).r;
vec4 masks = texture(mask_tex, texCoord);

float global_dissolve_phase = smoothstep(dissolve.y, dissolve.x, masks.a);
float q = 1 - smoothstep(0.8, 1, depthval);
q = 1 - sqrt(q);
float d = 1 - clamp(global_dissolve - 3.5 * q, 0, 1);

float global_dissolve_phase = smoothstep(d*d, 1.5 * d, masks.a);
masks.rg = mix(masks.rg, vec2(1, 0), global_dissolve_phase);

if(masks.g == 1) {
Expand All @@ -41,14 +45,22 @@ void main(void) {
}

float maskval = masks.r;
vec4 background = sample_background(texCoord, maskval, time);

maskval = 0.5 + 0.5 * sin(pi * (maskval + 1.42 * smoothstep(0.5, 1.0, depthval) * masks.b));
vec4 background = sample_background(texCoord,
mix(0.2 + maskval*0.8, 1, max(global_dissolve_phase, smoothstep(0.95, 1, depthval))),
time + 0.5 * (masks.r - 1) + d - masks.g
);
maskval = smoothstep(0, 1, maskval + 0.5);
maskval = smoothstep(0.75, 1.0, maskval);
maskval = mix(maskval, 1, masks.g);

maskval = mix(maskval, 0, global_dissolve_phase);

if(depthval < 1) {
maskval *= smoothstep(1, 0.995, masks.r) * masks.g;
}

vec4 result = background;
result = alphaCompose(result, tower * maskval);
depthval = mix(depthval, 0, global_dissolve_phase);
Expand Down
32 changes: 19 additions & 13 deletions resources/00-taisei.pkgdir/shader/extra_tower_mask.frag.glsl
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
#version 330 core

#include "interface/tower_light.glslh"
#include "lib/render_context.glslh"
#include "interface/extra_tower_mask.glslh"
#include "lib/util.glslh"

UNIFORM(24) float time;
UNIFORM(25) sampler2D tex2;
UNIFORM(26) float dissolve;

void main(void) {
vec4 texel2 = texture(tex2, texCoord);
vec4 texel = texture(tex, texCoord);
// Unfortunately this produces severe artifacts if computed in the vertex shader
vec2 uv;
uv.y = distance(worldPos.xyz, vec3(0, 0, worldPos.z)) / 10 + worldPos.z / 120;
uv.x = atan(worldPos.x, worldPos.y) + worldPos.z * 0.04;
uv.x = 0.5 + 0.5 * sin(uv.x);

vec4 s_mask = texture(tex_mask, uv);
vec4 s_noise = texture(tex_noise, uv);
vec4 s_mod = texture(tex_mod, texCoord);

s_noise.r = fract(s_noise.r + s_mod.r);

float m = texel.r;
m = 0.5 + 0.5 * sin(pi*m + time);
m = 0.5 + 0.5 * sin(2*pi*m + time);
float m = s_noise.r;
m = 0.5 + 0.5 * sin( pi*m + time + s_mod.r);
m = 0.5 + 0.5 * sin(2*pi*m + time - s_mod.r);

float dissolve_phase = smoothstep(dissolve * dissolve, dissolve, texel.r);
float d = mix(1.0 - texel2.r, 1.0, dissolve_phase);
float dissolve_phase = smoothstep(dissolve * dissolve, dissolve, s_noise.r);
float d = mix(1.0 - s_mask.r, 1.0, dissolve_phase);

fragColor = vec4(m, d, texel2.g, texel.r);
fragColor = vec4(m, d, s_mask.g, s_noise.r);
}
16 changes: 11 additions & 5 deletions resources/00-taisei.pkgdir/shader/extra_tower_mask.vert.glsl
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#version 330 core

#include "lib/render_context.glslh"
#include "interface/tower_light.glslh"
#include "lib/util.glslh"
#include "interface/extra_tower_mask.glslh"

void main(void) {
gl_Position = r_projectionMatrix * r_modelViewMatrix * vec4(position, 1.0);
texCoord = (r_textureMatrix * vec4(texCoordRawIn, 0.0, 1.0)).xy;
normal = normalIn;
l = lightvec - (r_modelViewMatrix*vec4(position,1.0)).xyz;
vec4 pos4 = vec4(position, 1.0);
vec4 camPos4 = r_modelViewMatrix * pos4;
camPos = camPos4.xyz;
worldPos = (world_from_model * pos4).xyz;

gl_Position = r_projectionMatrix * camPos4;
texCoord = texCoordRawIn;

modelPos = position;
}
Loading
Loading