Add game framework and whitebox level
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#version 330 core
|
||||
in vec4 v_color;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
void main() {
|
||||
FragColor = v_color;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#version 330 core
|
||||
layout (location = 0) in vec2 a_position;
|
||||
layout (location = 1) in vec2 a_texCoord;
|
||||
layout (location = 2) in vec4 a_color;
|
||||
|
||||
uniform mat4 u_view;
|
||||
uniform mat4 u_projection;
|
||||
|
||||
out vec4 v_color;
|
||||
|
||||
void main() {
|
||||
v_color = a_color;
|
||||
gl_Position = u_projection * u_view * vec4(a_position, 0.0, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"shaders": {
|
||||
"sprite": {
|
||||
"vertex": "sprite.vert",
|
||||
"fragment": "sprite.frag"
|
||||
},
|
||||
"colored_quad": {
|
||||
"vertex": "colored_quad.vert",
|
||||
"fragment": "colored_quad.frag"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#version 330 core
|
||||
in vec2 v_texCoord;
|
||||
in vec4 v_color;
|
||||
|
||||
uniform sampler2D u_texture;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
void main() {
|
||||
FragColor = texture(u_texture, v_texCoord) * v_color;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#version 330 core
|
||||
layout (location = 0) in vec2 a_position;
|
||||
layout (location = 1) in vec2 a_texCoord;
|
||||
layout (location = 2) in vec4 a_color;
|
||||
|
||||
uniform mat4 u_view;
|
||||
uniform mat4 u_projection;
|
||||
|
||||
out vec2 v_texCoord;
|
||||
out vec4 v_color;
|
||||
|
||||
void main() {
|
||||
v_texCoord = a_texCoord;
|
||||
v_color = a_color;
|
||||
gl_Position = u_projection * u_view * vec4(a_position, 0.0, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user