From f6de2b1453930267015ab9323d5f83daa25667ba Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 14 May 2020 19:09:39 +0200 Subject: Added ugly Cylindric UV mapping, texture/color transition --- shader/fragment.glsl | 4 +++- shader/vertex.glsl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'shader') 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; } -- cgit