From 831e21e89ba0275b43b6a351e538256b8ce715a3 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 20 Aug 2017 12:34:15 -0300 Subject: Properly initialize color hinted vec4 uniforms to 0,0,0,1 fixes #9354 --- drivers/gles3/rasterizer_storage_gles3.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/gles3/rasterizer_storage_gles3.cpp') diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 11d5bcb207..dc9006a4e1 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -2497,7 +2497,13 @@ void RasterizerStorageGLES3::_update_material(Material *material) { //value=E->get().default_value; } else { //zero because it was not provided - _fill_std140_ubo_empty(E->get().type, data); + if (E->get().type == ShaderLanguage::TYPE_VEC4 && E->get().hint == ShaderLanguage::ShaderNode::Uniform::HINT_COLOR) { + //colors must be set as black, with alpha as 1.0 + _fill_std140_variant_ubo_value(E->get().type, Color(0, 0, 0, 1), data, material->shader->mode == VS::SHADER_SPATIAL); + } else { + //else just zero it out + _fill_std140_ubo_empty(E->get().type, data); + } } } -- cgit v1.2.3