diff options
Diffstat (limited to 'servers/rendering/shader_compiler.cpp')
-rw-r--r-- | servers/rendering/shader_compiler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/servers/rendering/shader_compiler.cpp b/servers/rendering/shader_compiler.cpp index 1e95cdde0c..880c13096e 100644 --- a/servers/rendering/shader_compiler.cpp +++ b/servers/rendering/shader_compiler.cpp @@ -1191,6 +1191,7 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene // we will add logic to automatically switch between // sampler2D and sampler2D array and vec2 UV and vec3 UV. bool multiview_uv_needed = false; + bool is_normal_roughness_texture = false; for (int i = 1; i < onode->arguments.size(); i++) { if (i > 1) { @@ -1259,7 +1260,6 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene // Need to map from texture to sampler in order to sample when using Vulkan GLSL. String sampler_name; bool is_depth_texture = false; - bool is_normal_roughness_texture = false; if (actions.custom_samplers.has(texture_uniform)) { sampler_name = actions.custom_samplers[texture_uniform]; @@ -1340,6 +1340,9 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene if (is_screen_texture && !texture_func_returns_data && actions.apply_luminance_multiplier) { code = "(" + code + " * vec4(vec3(sc_luminance_multiplier), 1.0))"; } + if (is_normal_roughness_texture) { + code = "normal_roughness_compatibility(" + code + ")"; + } } break; case SL::OP_INDEX: { code += _dump_node_code(onode->arguments[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); |