diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-08-20 12:34:15 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-08-20 12:35:43 -0300 |
commit | 831e21e89ba0275b43b6a351e538256b8ce715a3 (patch) | |
tree | 88259535631f711bfe660a4e449158584181a024 /drivers | |
parent | f6c39830cb7cf0d664bdfa25642b333a1249b96f (diff) |
Properly initialize color hinted vec4 uniforms to 0,0,0,1 fixes #9354
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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); + } } } |