summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-06 18:34:35 +0100
committerGitHub <noreply@github.com>2022-01-06 18:34:35 +0100
commitbd1aa669cb6246046b1e150773241edb0594a992 (patch)
treefd86befa4afd9a7da30619ad18fcd290ccabaeb0 /scene
parent4ea309b405f09fb9c1425c688ea3eaeb24cce477 (diff)
parent901f376671aef8138063072a3b924f52af14701d (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.cpp12
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);