Add perspective view

This commit is contained in:
2020-03-23 17:26:32 +01:00
parent 4a7e0ac82a
commit 8238e94eea
12 changed files with 203 additions and 61 deletions

View File

@@ -1,8 +1,13 @@
#version 330 core
out vec4 fragmentColor;
in vec2 textureCoord;
uniform vec4 base_color;
uniform sampler2D uni_texture;
void main()
{
fragmentColor = vec4(1.0, 0.0, 0.0, 0.0);
vec4 temp_color = texture(uni_texture, textureCoord);
fragmentColor = temp_color * (1 - base_color.a) + base_color * base_color.a;
//fragmentColor = vec4(1.0, 0.0, 0.0, 0.0);
}

View File

@@ -1,10 +1,15 @@
#version 330 core
layout (location = 0) in vec2 inputVertex;
layout (location = 1) in vec2 textureInputVertex;
out vec2 textureCoord;
uniform mat4 model_matrix;
uniform mat4 projection_view_matrix;
void main()
{
textureCoord = textureInputVertex;
gl_Position = projection_view_matrix * model_matrix * vec4(inputVertex.x , inputVertex.y, 0.0, 1.0);
}