started marisa b bomb
This commit is contained in:
parent
cb0a1f3eb1
commit
be785e963c
3 changed files with 41 additions and 1 deletions
29
resources/shader/maristar_bombbg.sha
Normal file
29
resources/shader/maristar_bombbg.sha
Normal file
|
@ -0,0 +1,29 @@
|
|||
#version 110
|
||||
|
||||
varying vec4 texc;
|
||||
|
||||
void main(void) {
|
||||
gl_Position = ftransform();
|
||||
gl_FrontColor = gl_Color;
|
||||
|
||||
texc = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
}
|
||||
|
||||
%% -- FRAG
|
||||
#version 110
|
||||
|
||||
uniform float t;
|
||||
|
||||
uniform sampler2D tex;
|
||||
uniform vec2 plrpos;
|
||||
varying vec4 texc;
|
||||
|
||||
void main(void) {
|
||||
vec2 r = texc.xy-plrpos;
|
||||
r = vec2(atan(r.y,r.x)/3.1415*4.,length(r)-2.*t*(1.+t));
|
||||
r.x+=(1.+r.y)*t*5.;
|
||||
vec4 texel = texture2D(tex, r);
|
||||
texel.a = 0.7*t*(1.-t)*4.;
|
||||
|
||||
gl_FragColor = texel;
|
||||
}
|
|
@ -463,6 +463,7 @@ static void marisa_laser_preload(void) {
|
|||
|
||||
preload_resources(RES_SHADER, flags,
|
||||
"marisa_laser",
|
||||
"masterspark",
|
||||
NULL);
|
||||
|
||||
preload_resources(RES_SFX, flags | RESF_OPTIONAL,
|
||||
|
|
|
@ -166,9 +166,14 @@ static void marisa_star_bombbg(Player *plr) {
|
|||
if(t > BOMB_RECOVERY/4*3)
|
||||
fade = 1-t/BOMB_RECOVERY*4 + 3;
|
||||
|
||||
Shader *s = get_shader("maristar_bombbg");
|
||||
glUseProgram(s->prog);
|
||||
glUniform1f(uniloc(s,"t"), t/BOMB_RECOVERY);
|
||||
glUniform2f(uniloc(s,"plrpos"), creal(global.plr.pos)/VIEWPORT_W,cimag(global.plr.pos)/VIEWPORT_H);
|
||||
glColor4f(1,1,1,0.6*fade);
|
||||
fill_screen(0,-t*0.01,1,"marisa_bombbg");
|
||||
fill_screen(0,0,1,"marisa_bombbg");
|
||||
glColor4f(1,1,1,1);
|
||||
glUseProgram(0);
|
||||
}
|
||||
|
||||
static void marisa_star_respawn_slaves(Player *plr, short npow) {
|
||||
|
@ -225,6 +230,11 @@ static void marisa_star_preload(void) {
|
|||
"proj/marisa",
|
||||
"proj/maristar",
|
||||
"part/maristar_orbit",
|
||||
"marisa_bombbg",
|
||||
NULL);
|
||||
|
||||
preload_resources(RES_SHADER, flags,
|
||||
"maristar_bombbg",
|
||||
NULL);
|
||||
|
||||
preload_resources(RES_SFX, flags | RESF_OPTIONAL,
|
||||
|
|
Loading…
Reference in a new issue