Added parallax background, ship, and firing. Collision is WIP

This commit is contained in:
Gnarwhal 2024-08-07 05:04:16 +00:00
parent 79787f6525
commit 0605e4d91b
Signed by: Gnarwhal
GPG key ID: 0989A73D8C421174
28 changed files with 588 additions and 150 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

19
res/shaders/s2b/frag.gls Normal file
View file

@ -0,0 +1,19 @@
#version 330 core
uniform sampler2D layer0;
uniform sampler2D layer1;
uniform float offset0 = 1;
uniform float offset1 = 1;
in vec2 texCoords;
out vec4 color;
void main() {
vec4 color0 = texture(layer0, texCoords + vec2(0, offset0));
vec4 color1 = texture(layer1, texCoords + vec2(0, offset1));
color = mix(color0, color1, 1 - color0.a);
if (color.a == 0)
discard;
}

13
res/shaders/s2b/vert.gls Normal file
View file

@ -0,0 +1,13 @@
#version 330 core
uniform mat4 mvp;
layout (location = 0) in vec3 vertices;
layout (location = 1) in vec2 itexCoords;
out vec2 texCoords;
void main() {
texCoords = itexCoords;
gl_Position = mvp * vec4(vertices, 1);
}

View file

@ -2,20 +2,12 @@
uniform sampler2D sampler;
uniform vec4 iColor = vec4(1, 1, 1, 1);
uniform float alpha = 1;
uniform float amount = 1;
in vec2 texCoords;
out vec4 color;
void main() {
vec4 texColor = texture(sampler, texCoords);
if(texColor.a == 0)
discard;
else {
color = mix(iColor, texColor, amount);
color.a = color.a * alpha;
}
color = texture(sampler, texCoords);
if (color.a == 0)
discard;
}