summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJuan Linietsky <juan@okamstudio.com>2015-01-20 23:58:47 -0300
committerJuan Linietsky <juan@okamstudio.com>2015-01-20 23:58:47 -0300
commit14ade5500f091cd3d4e3668631fac49b1a4c546d (patch)
tree3fc2a60c845e939194ec29ca5698e5422167f910 /drivers
parentda0d4e4dea021c1fc10549cd5374d1baca2e4006 (diff)
Fixed bug in 3D material
textures that failed to load should now load again properly
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index 43bd45ae80..2993fcfb58 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -4962,15 +4962,19 @@ _FORCE_INLINE_ void RasterizerGLES2::_update_material_shader_params(Material *p_
bool has_old = OLD;
bool old_inuse=has_old && old_mparams[E->key()].inuse;
- if (!has_old || !old_inuse)
+ ud.istexture=(E->get().type==ShaderLanguage::TYPE_TEXTURE || E->get().type==ShaderLanguage::TYPE_CUBEMAP);
+
+ if (!has_old || !old_inuse) {
keep=false;
+ }
else if (OLD->get().value.get_type()!=E->value().default_value.get_type()) {
if (OLD->get().value.get_type()==Variant::INT && E->get().type==ShaderLanguage::TYPE_FLOAT) {
//handle common mistake using shaders (feeding ints instead of float)
OLD->get().value=float(OLD->get().value);
keep=true;
- } else if (E->value().default_value.get_type()!=Variant::NIL) {
+ } else if (!ud.istexture && E->value().default_value.get_type()!=Variant::NIL) {
+
keep=false;
}
//type changed between old and new
@@ -4984,7 +4988,6 @@ _FORCE_INLINE_ void RasterizerGLES2::_update_material_shader_params(Material *p_
;
}
- ud.istexture=(E->get().type==ShaderLanguage::TYPE_TEXTURE || E->get().type==ShaderLanguage::TYPE_CUBEMAP);
if (keep) {
ud.value=old_mparams[E->key()].value;