Added parallax background, ship, and firing. Collision is WIP
BIN
res/img/background/background-layer-0.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
res/img/background/background-layer-1.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
res/img/bullets/bullet-0/bullet-0.png
Normal file
After Width: | Height: | Size: 177 B |
BIN
res/img/bullets/bullet-0/bullet-1.png
Normal file
After Width: | Height: | Size: 166 B |
BIN
res/img/bullets/bullet-0/bullet-2.png
Normal file
After Width: | Height: | Size: 176 B |
BIN
res/img/bullets/bullet-0/bullet-3.png
Normal file
After Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 553 B |
BIN
res/img/player-ship/player-ship-0.png
Normal file
After Width: | Height: | Size: 544 B |
BIN
res/img/player-ship/player-ship-1.png
Normal file
After Width: | Height: | Size: 543 B |
BIN
res/img/player-ship/player-ship-2.png
Normal file
After Width: | Height: | Size: 537 B |
BIN
res/img/player-ship/player-ship-3.png
Normal file
After Width: | Height: | Size: 543 B |
19
res/shaders/s2b/frag.gls
Normal 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
|
@ -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);
|
||||
}
|
|
@ -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;
|
||||
}
|