summaryrefslogtreecommitdiff
path: root/drivers/gles3/rasterizer_storage_gles3.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-08-20 12:34:15 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-08-20 12:35:43 -0300
commit831e21e89ba0275b43b6a351e538256b8ce715a3 (patch)
tree88259535631f711bfe660a4e449158584181a024 /drivers/gles3/rasterizer_storage_gles3.cpp
parentf6c39830cb7cf0d664bdfa25642b333a1249b96f (diff)
Properly initialize color hinted vec4 uniforms to 0,0,0,1 fixes #9354
Diffstat (limited to 'drivers/gles3/rasterizer_storage_gles3.cpp')
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp8
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);
+ }
}
}