diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-05-13 17:14:08 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-05-13 17:14:08 +0200 |
| commit | 46f56c104218f675daf2feb1366f53f4d84a1886 (patch) | |
| tree | 6b3a324e160bc601ff724d59dca5ed7d9f6a2766 /shader | |
| parent | 0267b512527b85af6cd815bb9215bd659b75931e (diff) | |
| download | scop-46f56c104218f675daf2feb1366f53f4d84a1886.tar.gz scop-46f56c104218f675daf2feb1366f53f4d84a1886.tar.bz2 scop-46f56c104218f675daf2feb1366f53f4d84a1886.zip | |
Very ugly and not working texture
Diffstat (limited to 'shader')
| -rw-r--r-- | shader/fragment.glsl | 5 | ||||
| -rw-r--r-- | shader/vertex.glsl | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/shader/fragment.glsl b/shader/fragment.glsl index bf1c286..6c3e1b1 100644 --- a/shader/fragment.glsl +++ b/shader/fragment.glsl @@ -1,10 +1,13 @@ #version 400 core in vec4 v_color; +in vec2 v_texture_coord; out vec4 out_color; +uniform sampler2D u_texture; + void main() { - out_color = v_color; + out_color = v_color + texture(u_texture, v_texture_coord); } diff --git a/shader/vertex.glsl b/shader/vertex.glsl index d46ecd5..b26899e 100644 --- a/shader/vertex.glsl +++ b/shader/vertex.glsl @@ -2,15 +2,18 @@ layout (location = 0) in vec4 in_position; layout (location = 1) in vec4 in_color; +layout (location = 2) in vec2 in_texture_coord; uniform mat4 u_model; uniform mat4 u_view; uniform mat4 u_proj; out vec4 v_color; +out vec2 v_texture_coord; void main() { v_color = in_color; + v_texture_coord = in_texture_coord; gl_Position = u_proj * u_view * u_model * in_position; } |
