Browse Source

Merge pull request #78839 from lewiji/normal_roughness_mobile_fix

Fix invalid shader compilation when using `hint_normal_roughness_texture` in mobile backend
Rémi Verschelde 2 years ago
parent
commit
46cd84b362
1 changed files with 2 additions and 2 deletions
  1. 2 2
      servers/rendering/shader_language.cpp

+ 2 - 2
servers/rendering/shader_language.cpp

@@ -8807,8 +8807,8 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f
 									new_hint = ShaderNode::Uniform::HINT_NORMAL_ROUGHNESS_TEXTURE;
 									new_hint = ShaderNode::Uniform::HINT_NORMAL_ROUGHNESS_TEXTURE;
 									--texture_uniforms;
 									--texture_uniforms;
 									--texture_binding;
 									--texture_binding;
-									if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
-										_set_error(RTR("'hint_normal_roughness_texture' is not supported in gl_compatibility shaders."));
+									if (OS::get_singleton()->get_current_rendering_method() != "forward_plus") {
+										_set_error(RTR("'hint_normal_roughness_texture' is only available when using the Forward+ backend."));
 										return ERR_PARSE_ERROR;
 										return ERR_PARSE_ERROR;
 									}
 									}
 									if (String(shader_type_identifier) != "spatial") {
 									if (String(shader_type_identifier) != "spatial") {