diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-05-13 13:05:33 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-05-13 13:05:33 +0200 |
| commit | 0267b512527b85af6cd815bb9215bd659b75931e (patch) | |
| tree | 3f798f9e4b89f84d5e11ae820329e15f3c1e351d /shader | |
| parent | 5635d61927b2fc864d92f9f7b40cdb164eeab275 (diff) | |
| download | scop-0267b512527b85af6cd815bb9215bd659b75931e.tar.gz scop-0267b512527b85af6cd815bb9215bd659b75931e.tar.bz2 scop-0267b512527b85af6cd815bb9215bd659b75931e.zip | |
Added basic color
Diffstat (limited to 'shader')
| -rw-r--r-- | shader/fragment.glsl | 4 | ||||
| -rw-r--r-- | shader/vertex.glsl | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/shader/fragment.glsl b/shader/fragment.glsl index 7f5d052..bf1c286 100644 --- a/shader/fragment.glsl +++ b/shader/fragment.glsl @@ -1,8 +1,10 @@ #version 400 core +in vec4 v_color; + out vec4 out_color; void main() { - out_color = vec4(1.0, 0.5, 0.2, 1.0); + out_color = v_color; } diff --git a/shader/vertex.glsl b/shader/vertex.glsl index f2b0634..d46ecd5 100644 --- a/shader/vertex.glsl +++ b/shader/vertex.glsl @@ -1,12 +1,16 @@ #version 400 core -layout (location = 0) in vec4 v_position; +layout (location = 0) in vec4 in_position; +layout (location = 1) in vec4 in_color; uniform mat4 u_model; uniform mat4 u_view; uniform mat4 u_proj; +out vec4 v_color; + void main() { - gl_Position = u_proj * u_view * u_model * v_position; + v_color = in_color; + gl_Position = u_proj * u_view * u_model * in_position; } |
