From dd18dd202448be934d206feaa87d8839f6d8a541 Mon Sep 17 00:00:00 2001 From: Google DeepMind Date: Thu, 5 Jun 2025 03:02:18 -0700 Subject: [PATCH] Apply metallic and roughness scaling factors. PiperOrigin-RevId: 767518801 Change-Id: I7eff7b7a56cfbb9c6e46ac22011559eabf401c07 --- doc/XMLreference.rst | 12 ++++++++---- src/user/user_init.c | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/XMLreference.rst b/doc/XMLreference.rst index 588235ab..71963d33 100644 --- a/doc/XMLreference.rst +++ b/doc/XMLreference.rst @@ -1776,15 +1776,19 @@ properties are grouped together. .. _asset-material-metallic: -:at:`metallic`: :at-val:`real, "0"` +:at:`metallic`: :at-val:`real, "-1"` This attribute corresponds to uniform metallicity coefficient applied to the entire material. This attribute has no - effect in MuJoCo's native renderer, but it can be useful when rendering scenes with an external renderer. + effect in MuJoCo's native renderer, but it can be useful when rendering scenes with a physically-based renderer. In + this case, if a non-negative value is specified, this metallic value should be multiplied by the metallic texture + sampled value to obtain the final metallicity of the material. .. _asset-material-roughness: -:at:`roughness`: :at-val:`real, "1"` +:at:`roughness`: :at-val:`real, "-1"` This attribute corresponds to uniform roughness coefficient applied to the entire material. This attribute has no - effect in MuJoCo's native renderer, but it can be useful when rendering scenes with an external renderer. + effect in MuJoCo's native renderer, but it can be useful when rendering scenes with a physically-based renderer. In + this case, if a non-negative value is specified, this roughness value should be multiplied by the roughness texture + sampled value to obtain the final roughness of the material. .. _asset-material-rgba: diff --git a/src/user/user_init.c b/src/user/user_init.c index 34199812..575f15d6 100644 --- a/src/user/user_init.c +++ b/src/user/user_init.c @@ -291,8 +291,8 @@ void mjs_defaultMaterial(mjsMaterial* material) { material->texrepeat[0] = material->texrepeat[1] = 1; material->specular = 0.5; material->shininess = 0.5; - material->metallic = 0.0; - material->roughness = 1.0; + material->metallic = -1.0; + material->roughness = -1.0; material->rgba[0] = material->rgba[1] = material->rgba[2] = material->rgba[3] = 1; }