From 76788d7dd8f444371e9a8b436d017224e3f1f495 Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 7 Jan 2018 15:44:57 +0800 Subject: [PATCH] Fix GLES --- data/shaders/combine_diffuse_color.frag | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/shaders/combine_diffuse_color.frag b/data/shaders/combine_diffuse_color.frag index f2dee049c..df7f34e86 100644 --- a/data/shaders/combine_diffuse_color.frag +++ b/data/shaders/combine_diffuse_color.frag @@ -23,7 +23,8 @@ void main() vec3 DiffuseComponent = texture(diffuse_map, tc).xyz; vec3 SpecularComponent = texture(specular_map, tc).xyz; - vec3 metallicMatColor = mix(vec3(0.04), diffuseMatColor.xyz * 4, metallicMapValue); + vec3 diffuse_color_for_mix = diffuseMatColor.xyz * 4.0; + vec3 metallicMatColor = mix(vec3(0.04), diffuse_color_for_mix, metallicMapValue); vec3 tmp = DiffuseComponent * mix(diffuseMatColor.xyz, vec3(0.0), metallicMapValue) + (metallicMatColor * SpecularComponent); vec3 emitCol = diffuseMatColor.xyz * diffuseMatColor.xyz * diffuseMatColor.xyz * 15.;