diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-05-14 19:09:39 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-05-14 19:09:39 +0200 |
| commit | f6de2b1453930267015ab9323d5f83daa25667ba (patch) | |
| tree | 5ff586948f7ffe257f8f46919f01bd99c1ffb82a /shader | |
| parent | 23ba151d95e4284ddb2d5f1c9810741061c293fd (diff) | |
| download | scop-f6de2b1453930267015ab9323d5f83daa25667ba.tar.gz scop-f6de2b1453930267015ab9323d5f83daa25667ba.tar.bz2 scop-f6de2b1453930267015ab9323d5f83daa25667ba.zip | |
Added ugly Cylindric UV mapping, texture/color transition
Diffstat (limited to 'shader')
| -rw-r--r-- | shader/fragment.glsl | 4 | ||||
| -rw-r--r-- | shader/vertex.glsl | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/shader/fragment.glsl b/shader/fragment.glsl index 4ada539..710cfbe 100644 --- a/shader/fragment.glsl +++ b/shader/fragment.glsl @@ -6,8 +6,10 @@ in vec2 v_texture_coord; out vec4 out_color; uniform sampler2D u_texture; +uniform float u_color_ratio; void main() { - out_color = texture(u_texture, v_texture_coord); + out_color = v_color * u_color_ratio + + texture(u_texture, v_texture_coord) * (1.0 - u_color_ratio); } diff --git a/shader/vertex.glsl b/shader/vertex.glsl index b26899e..e61ec34 100644 --- a/shader/vertex.glsl +++ b/shader/vertex.glsl @@ -13,7 +13,7 @@ out vec2 v_texture_coord; void main() { + gl_Position = u_proj * u_view * u_model * in_position; v_color = in_color; v_texture_coord = in_texture_coord; - gl_Position = u_proj * u_view * u_model * in_position; } |
