1
0
Fork 0

Initial commit

This commit is contained in:
Henrik Hautakoski 2015-12-22 17:43:51 +01:00
commit edfc5298e1
252 changed files with 93965 additions and 0 deletions

BIN
assets/app.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

BIN
assets/fonts/Consolas.ttf Normal file

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 not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,11 @@
#version 330 core
uniform sampler2D u_tex0;
in vec4 vColor; // Vertex color.
in vec2 vTexCoord; // Texture coordinate.
out vec4 fragColor;
void main() {
fragColor = vColor * texture2D(u_tex0, vTexCoord);
}

View file

@ -0,0 +1,21 @@
#version 330 core
uniform mat4 u_MVP;
layout(location = 0) in vec3 in_pos;
layout(location = 3) in vec3 in_color;
layout(location = 8) in vec2 in_texcoord;
out vec4 vColor;
out vec2 vTexCoord;
void main(void) {
gl_Position = u_MVP * vec4(in_pos, 1.0);
vColor = vec4(in_color, 1.0);
// in_texcoord is defined with (0,0) at top-left (same as in_pos)
// however, sampling in OpenGL expects bottom-left. So we must flip Y.
vTexCoord = vec2(in_texcoord.x, 1.0 - in_texcoord.y);
}

View file

@ -0,0 +1,13 @@
#version 330 core
uniform sampler2D u_tex0;
in vec2 vTexCoords; // Texture coordinates (normalized)
in vec4 vColor; // Vertex color
out vec4 fragColor; // Output frag color.
void main() {
// Sample texture red component as alpha value.
vec4 sampled = vec4(1.0f, 1.0, 1.0, texture(u_tex0, vTexCoords).r);
fragColor = vColor * sampled;
}

View file

@ -0,0 +1,21 @@
#version 330 core
uniform mat4 u_MVP;
uniform sampler2D u_tex0;
layout (location = 0) in vec2 in_pos;
layout (location = 3) in vec3 in_color;
layout (location = 8) in vec2 in_texCoords;
out vec2 vTexCoords;
out vec4 vColor;
void main() {
gl_Position = u_MVP * vec4(in_pos, 0.0f, 1.0f);
// Texture coordinates are in pixels.
// Need to convert into UV space before passing to fragment shader.
vTexCoords = in_texCoords / textureSize(u_tex0, 0);
vColor = vec4(in_color, 1.0);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
assets/textures/debug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/textures/debug_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 KiB