Properly initialize color hinted vec4 uniforms to 0,0,0,1 fixes #9354

This commit is contained in:
Juan Linietsky 2017-08-20 12:34:15 -03:00
parent f6c39830cb
commit 831e21e89b

View file

@ -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);
}
}
}