diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-06 18:34:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 18:34:35 +0100 |
commit | bd1aa669cb6246046b1e150773241edb0594a992 (patch) | |
tree | fd86befa4afd9a7da30619ad18fcd290ccabaeb0 /scene | |
parent | 4ea309b405f09fb9c1425c688ea3eaeb24cce477 (diff) | |
parent | 901f376671aef8138063072a3b924f52af14701d (diff) |
Merge pull request #56145 from V-Sekai/auto_rm_3
Move functionality automatically setting roughness/metallic on texture assignment to editor callback
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/material.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index b36204241a..f3e5ece1f9 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -1659,18 +1659,6 @@ bool BaseMaterial3D::get_feature(Feature p_feature) const { void BaseMaterial3D::set_texture(TextureParam p_param, const Ref<Texture2D> &p_texture) { ERR_FAIL_INDEX(p_param, TEXTURE_MAX); - if (get_texture(TEXTURE_ROUGHNESS).is_null() && p_texture.is_valid() && p_param == TEXTURE_ROUGHNESS) { - // If no roughness texture is currently set, automatically set the recommended value - // for roughness when using a roughness map. - set_roughness(1.0); - } - - if (get_texture(TEXTURE_METALLIC).is_null() && p_texture.is_valid() && p_param == TEXTURE_METALLIC) { - // If no metallic texture is currently set, automatically set the recommended value - // for metallic when using a metallic map. - set_metallic(1.0); - } - textures[p_param] = p_texture; RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); RS::get_singleton()->material_set_param(_get_material(), shader_names->texture_names[p_param], rid); |