Fix global shader uniform texture loading
This commit is contained in:
parent
c495eb5102
commit
41def3740a
@ -1957,14 +1957,16 @@ void MaterialStorage::global_shader_parameters_load_settings(bool p_load_texture
|
|||||||
if (gvtype >= RS::GLOBAL_VAR_TYPE_SAMPLER2D) {
|
if (gvtype >= RS::GLOBAL_VAR_TYPE_SAMPLER2D) {
|
||||||
//textire
|
//textire
|
||||||
if (!p_load_textures) {
|
if (!p_load_textures) {
|
||||||
value = RID();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
String path = value;
|
String path = value;
|
||||||
Ref<Resource> resource = ResourceLoader::load(path);
|
if (path.is_empty()) {
|
||||||
ERR_CONTINUE(resource.is_null());
|
value = RID();
|
||||||
value = resource;
|
} else {
|
||||||
|
Ref<Resource> resource = ResourceLoader::load(path);
|
||||||
|
value = resource;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global_shader_uniforms.variables.has(name)) {
|
if (global_shader_uniforms.variables.has(name)) {
|
||||||
|
@ -1821,14 +1821,16 @@ void MaterialStorage::global_shader_parameters_load_settings(bool p_load_texture
|
|||||||
if (gvtype >= RS::GLOBAL_VAR_TYPE_SAMPLER2D) {
|
if (gvtype >= RS::GLOBAL_VAR_TYPE_SAMPLER2D) {
|
||||||
//textire
|
//textire
|
||||||
if (!p_load_textures) {
|
if (!p_load_textures) {
|
||||||
value = RID();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
String path = value;
|
String path = value;
|
||||||
Ref<Resource> resource = ResourceLoader::load(path);
|
if (path.is_empty()) {
|
||||||
ERR_CONTINUE(resource.is_null());
|
value = RID();
|
||||||
value = resource;
|
} else {
|
||||||
|
Ref<Resource> resource = ResourceLoader::load(path);
|
||||||
|
value = resource;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global_shader_uniforms.variables.has(name)) {
|
if (global_shader_uniforms.variables.has(name)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user