From 11815a23dca57e79e82d3f944fe563ee8ca824d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Sun, 28 Oct 2018 02:37:34 +0100 Subject: Fix GLES2 automatic texture lookup in canvas After this change the color will only be fetched if the shader code doesn't use it explicitly, to match the GLES3 behaviour. Fixes #23179. --- drivers/gles2/shaders/canvas.glsl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index b990384949..79d4eb2243 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -148,7 +148,10 @@ void main() { vec4 color = color_interp; +#if !defined(COLOR_USED) + //default behavior, texture by color color *= texture2D(color_texture, uv_interp); +#endif #ifdef SCREEN_UV_USED vec2 screen_uv = gl_FragCoord.xy * screen_pixel_size; -- cgit v1.2.3