Change default light softness from 0 to 0.2.

PiperOrigin-RevId: 960218397
Change-Id: I58f211f5a275f8f19254424facd02c14eaa8c668
This commit is contained in:
Yuval Tassa
2026-08-06 04:27:35 -07:00
committed by Copybara-Service
parent ed13bf5647
commit 7fd2061f5c
7 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -3323,7 +3323,7 @@ Attributes may be applied or ignored depending on the lighting model being used.
.. _body-light-softness: .. _body-light-softness:
:at:`softness`: :at-val:`real, "0"` :at:`softness`: :at-val:`real, "0.2"`
Edge softness for spotlights, as a fraction of the :ref:`cutoff<body-light-cutoff>` angle in [0, 1], used by Edge softness for spotlights, as a fraction of the :ref:`cutoff<body-light-cutoff>` angle in [0, 1], used by
physically-based lighting models. The light delivers its full :ref:`intensity<body-light-intensity>` inside the physically-based lighting models. The light delivers its full :ref:`intensity<body-light-intensity>` inside the
cone, falling to zero over the outer softness fraction of the cone angle; the default corresponds to a sharp-edged cone, falling to zero over the outer softness fraction of the cone angle; the default corresponds to a sharp-edged
+1 -1
View File
@@ -75,7 +75,7 @@ Rendering
:class: attention :class: attention
- Added :ref:`light/softness<body-light-softness>`: edge softness for spotlights under physically-based lighting - Added :ref:`light/softness<body-light-softness>`: edge softness for spotlights under physically-based lighting
models, given as the fraction of the cone over which intensity falls to zero. The default of 0 is a sharp-edged models, given as the fraction of the cone over which intensity falls to zero. The default of 0.2 is a semi-soft
cone which delivers the full :ref:`intensity<body-light-intensity>` everywhere inside it, so that illuminance cone which delivers the full :ref:`intensity<body-light-intensity>` everywhere inside it, so that illuminance
follows :math:`E = I/d^2` independent of the :ref:`cutoff<body-light-cutoff>` angle. Previously the filament follows :math:`E = I/d^2` independent of the :ref:`cutoff<body-light-cutoff>` angle. Previously the filament
renderer treated the entire cone as penumbra, dimming spotlights well below their rated intensity, increasingly renderer treated the entire cone as penumbra, dimming spotlights well below their rated intensity, increasingly
+1
View File
@@ -204,6 +204,7 @@ void mjs_defaultLight(mjsLight* light) {
light->active = 1; light->active = 1;
light->attenuation[0] = 1; light->attenuation[0] = 1;
light->cutoff = 45; light->cutoff = 45;
light->softness = 0.2;
light->exponent = 10; light->exponent = 10;
light->diffuse[0] = light->diffuse[1] = light->diffuse[2] = 0.7; light->diffuse[0] = light->diffuse[1] = light->diffuse[2] = 0.7;
light->specular[0] = light->specular[1] = light->specular[2] = 0.3; light->specular[0] = light->specular[1] = light->specular[2] = 0.3;
+4 -4
View File
@@ -397,7 +397,7 @@
<attribute name="range" type="float" default="10"/> <attribute name="range" type="float" default="10"/>
<attribute name="attenuation" type="array" array_type="float" array_size="3" default="1 0 0"/> <attribute name="attenuation" type="array" array_type="float" array_size="3" default="1 0 0"/>
<attribute name="cutoff" type="float" default="45"/> <attribute name="cutoff" type="float" default="45"/>
<attribute name="softness" type="float" default="0"/> <attribute name="softness" type="float" default="0.2"/>
<attribute name="exponent" type="float" default="10"/> <attribute name="exponent" type="float" default="10"/>
<attribute name="ambient" type="array" array_type="float" array_size="3"/> <attribute name="ambient" type="array" array_type="float" array_size="3"/>
<attribute name="diffuse" type="array" array_type="float" array_size="3" default="0.7 0.7 0.7"/> <attribute name="diffuse" type="array" array_type="float" array_size="3" default="0.7 0.7 0.7"/>
@@ -793,7 +793,7 @@
<attribute name="range" type="float" default="10"/> <attribute name="range" type="float" default="10"/>
<attribute name="attenuation" type="array" array_type="float" array_size="3" default="1 0 0"/> <attribute name="attenuation" type="array" array_type="float" array_size="3" default="1 0 0"/>
<attribute name="cutoff" type="float" default="45"/> <attribute name="cutoff" type="float" default="45"/>
<attribute name="softness" type="float" default="0"/> <attribute name="softness" type="float" default="0.2"/>
<attribute name="exponent" type="float" default="10"/> <attribute name="exponent" type="float" default="10"/>
<attribute name="ambient" type="array" array_type="float" array_size="3"/> <attribute name="ambient" type="array" array_type="float" array_size="3"/>
<attribute name="diffuse" type="array" array_type="float" array_size="3" default="0.7 0.7 0.7"/> <attribute name="diffuse" type="array" array_type="float" array_size="3" default="0.7 0.7 0.7"/>
@@ -1378,7 +1378,7 @@
<attribute name="range" type="float" default="10"/> <attribute name="range" type="float" default="10"/>
<attribute name="attenuation" type="array" array_type="float" array_size="3" default="1 0 0"/> <attribute name="attenuation" type="array" array_type="float" array_size="3" default="1 0 0"/>
<attribute name="cutoff" type="float" default="45"/> <attribute name="cutoff" type="float" default="45"/>
<attribute name="softness" type="float" default="0"/> <attribute name="softness" type="float" default="0.2"/>
<attribute name="exponent" type="float" default="10"/> <attribute name="exponent" type="float" default="10"/>
<attribute name="ambient" type="array" array_type="float" array_size="3"/> <attribute name="ambient" type="array" array_type="float" array_size="3"/>
<attribute name="diffuse" type="array" array_type="float" array_size="3" default="0.7 0.7 0.7"/> <attribute name="diffuse" type="array" array_type="float" array_size="3" default="0.7 0.7 0.7"/>
@@ -1700,7 +1700,7 @@
<attribute name="range" type="float" default="10"/> <attribute name="range" type="float" default="10"/>
<attribute name="attenuation" type="array" array_type="float" array_size="3" default="1 0 0"/> <attribute name="attenuation" type="array" array_type="float" array_size="3" default="1 0 0"/>
<attribute name="cutoff" type="float" default="45"/> <attribute name="cutoff" type="float" default="45"/>
<attribute name="softness" type="float" default="0"/> <attribute name="softness" type="float" default="0.2"/>
<attribute name="exponent" type="float" default="10"/> <attribute name="exponent" type="float" default="10"/>
<attribute name="ambient" type="array" array_type="float" array_size="3"/> <attribute name="ambient" type="array" array_type="float" array_size="3"/>
<attribute name="diffuse" type="array" array_type="float" array_size="3" default="0.7 0.7 0.7"/> <attribute name="diffuse" type="array" array_type="float" array_size="3" default="0.7 0.7 0.7"/>
+2 -2
View File
@@ -1495,7 +1495,7 @@
<xs:attribute name="range" type="xs:float" default="10"/> <xs:attribute name="range" type="xs:float" default="10"/>
<xs:attribute name="attenuation" type="float3" default="1 0 0"/> <xs:attribute name="attenuation" type="float3" default="1 0 0"/>
<xs:attribute name="cutoff" type="xs:float" default="45"/> <xs:attribute name="cutoff" type="xs:float" default="45"/>
<xs:attribute name="softness" type="xs:float" default="0"/> <xs:attribute name="softness" type="xs:float" default="0.2"/>
<xs:attribute name="exponent" type="xs:float" default="10"/> <xs:attribute name="exponent" type="xs:float" default="10"/>
<xs:attribute name="ambient" type="float3"/> <xs:attribute name="ambient" type="float3"/>
<xs:attribute name="diffuse" type="float3" default="0.7 0.7 0.7"/> <xs:attribute name="diffuse" type="float3" default="0.7 0.7 0.7"/>
@@ -2274,7 +2274,7 @@
<xs:attribute name="range" type="xs:float" default="10"/> <xs:attribute name="range" type="xs:float" default="10"/>
<xs:attribute name="attenuation" type="float3" default="1 0 0"/> <xs:attribute name="attenuation" type="float3" default="1 0 0"/>
<xs:attribute name="cutoff" type="xs:float" default="45"/> <xs:attribute name="cutoff" type="xs:float" default="45"/>
<xs:attribute name="softness" type="xs:float" default="0"/> <xs:attribute name="softness" type="xs:float" default="0.2"/>
<xs:attribute name="exponent" type="xs:float" default="10"/> <xs:attribute name="exponent" type="xs:float" default="10"/>
<xs:attribute name="ambient" type="float3"/> <xs:attribute name="ambient" type="float3"/>
<xs:attribute name="diffuse" type="float3" default="0.7 0.7 0.7"/> <xs:attribute name="diffuse" type="float3" default="0.7 0.7 0.7"/>
+1 -1
View File
@@ -394,7 +394,7 @@ static const mjXDefaultEntry kDefaults_mjsLight[] = {
{"range", (int)offsetof(mjsLight, range), 1, 1, 1, 0, {10.0}}, {"range", (int)offsetof(mjsLight, range), 1, 1, 1, 0, {10.0}},
{"attenuation", (int)offsetof(mjsLight, attenuation), 1, 3, 3, 0, {1.0, 0.0, 0.0}}, {"attenuation", (int)offsetof(mjsLight, attenuation), 1, 3, 3, 0, {1.0, 0.0, 0.0}},
{"cutoff", (int)offsetof(mjsLight, cutoff), 1, 1, 1, 0, {45.0}}, {"cutoff", (int)offsetof(mjsLight, cutoff), 1, 1, 1, 0, {45.0}},
{"softness", (int)offsetof(mjsLight, softness), 1, 1, 1, 0, {0.0}}, {"softness", (int)offsetof(mjsLight, softness), 1, 1, 1, 0, {0.2}},
{"exponent", (int)offsetof(mjsLight, exponent), 1, 1, 1, 0, {10.0}}, {"exponent", (int)offsetof(mjsLight, exponent), 1, 1, 1, 0, {10.0}},
{"ambient", (int)offsetof(mjsLight, ambient), 1, 3, 0, 0, {0}}, {"ambient", (int)offsetof(mjsLight, ambient), 1, 3, 0, 0, {0}},
{"diffuse", (int)offsetof(mjsLight, diffuse), 1, 3, 3, 0, {0.7, 0.7, 0.7}}, {"diffuse", (int)offsetof(mjsLight, diffuse), 1, 3, 3, 0, {0.7, 0.7, 0.7}},
+1 -1
View File
@@ -1117,7 +1117,7 @@ element light : mjsLight {
range : float = 10 range : float = 10
attenuation : float[3] = {1, 0, 0} attenuation : float[3] = {1, 0, 0}
cutoff : float = 45 cutoff : float = 45
softness : float = 0 softness : float = 0.2
exponent : float = 10 exponent : float = 10
ambient : float[3] ambient : float[3]
diffuse : float[3] = {0.7, 0.7, 0.7} diffuse : float[3] = {0.7, 0.7, 0.7}