Skip to content

Commit

Permalink
Docs: Add some missing options to MeshPhysicalMaterial demo. (mrdoo…
Browse files Browse the repository at this point in the history
…b#26753)

* Add some missing options to `MeshPhysicalMaterial` demo

 * Add GUI options for some missing properties including sheen, ior, iridescence, and others to the material browser embedded on the docs pages for materials

* Use real default `sheenColor in material browser

* Re-disable dirlights in `MeshPhysicalMaterial` material browser

* Update docs to correct the default `sheenColor`

 * Docs stated it was 0xfffff, but it's actually 0x000000
 * Fixes mrdoob#26757

* Add back deleted comment
  • Loading branch information
Ameobea authored Sep 15, 2023
1 parent 30164c9 commit 18ae441
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/api/ar/materials/MeshPhysicalMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h3>[property:Texture sheenRoughnessMap]</h3>
</p>

<h3>[property:Color sheenColor]</h3>
<p>لون اللمعان. الافتراضي هو `0xffffffأبيض.</p>
<p>لون اللمعان. الافتراضي هو `0x000000أسود.</p>

<h3>[property:Texture sheenColorMap]</h3>
<p>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/materials/MeshPhysicalMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ <h3>[property:Texture sheenRoughnessMap]</h3>
</p>

<h3>[property:Color sheenColor]</h3>
<p>The sheen tint. Default is `0xffffff`, white.</p>
<p>The sheen tint. Default is `0x000000`, black.</p>

<h3>[property:Texture sheenColorMap]</h3>
<p>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/fr/materials/MeshPhysicalMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h3>[property:Texture sheenRoughnessMap]</h3>

<h3>[property:Color sheenColor]</h3>
<p>
La teinte brillante. La valeur par défaut est `0xffffff`, white.
La teinte brillante. La valeur par défaut est `0x000000`, noire.
</p>

<h3>[property:Texture sheenColorMap]</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/it/materials/MeshPhysicalMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ <h3>[property:Texture sheenRoughnessMap]</h3>

<h3>[property:Color sheenColor]</h3>
<p>
La tinta brillante. Il valore predefinito è `0xffffff`, bianco.
La tinta brillante. Il valore predefinito è `0x000000`, nera.
</p>

<h3>[property:Texture sheenColorMap]</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/zh/materials/MeshPhysicalMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h3>[property:Texture sheenRoughnessMap]</h3>

<h3>[property:Color sheenColor]</h3>
<p>
光泽颜色,默认为*0xffffff*白色
光泽颜色,默认为*0x000000*黑色
</p>

<h3>[property:Texture sheenColorMap]</h3>
Expand Down
24 changes: 18 additions & 6 deletions docs/scenes/material-browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@
envMaps: envMapKeysPBR[ 0 ],
map: diffuseMapKeys[ 0 ],
roughnessMap: roughnessMapKeys[ 0 ],
alphaMap: alphaMapKeys[ 0 ]
alphaMap: alphaMapKeys[ 0 ],
metalnessMap: alphaMapKeys[ 0 ]
};

const folder = gui.addFolder( 'THREE.MeshStandardMaterial' );
Expand All @@ -548,8 +549,7 @@
folder.add( data, 'map', diffuseMapKeys ).onChange( updateTexture( material, 'map', diffuseMaps ) );
folder.add( data, 'roughnessMap', roughnessMapKeys ).onChange( updateTexture( material, 'roughnessMap', roughnessMaps ) );
folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );

// TODO metalnessMap
folder.add( data, 'metalnessMap', alphaMapKeys ).onChange( updateTexture( material, 'metalnessMap', alphaMaps ) );

}

Expand All @@ -561,7 +561,11 @@
envMaps: envMapKeys[ 0 ],
map: diffuseMapKeys[ 0 ],
roughnessMap: roughnessMapKeys[ 0 ],
alphaMap: alphaMapKeys[ 0 ]
alphaMap: alphaMapKeys[ 0 ],
metalnessMap: alphaMapKeys[ 0 ],
sheenColor: material.sheenColor.getHex(),
specularColor: material.specularColor.getHex(),
iridescenceMap: alphaMapKeys[ 0 ]
};

const folder = gui.addFolder( 'THREE.MeshPhysicalMaterial' );
Expand All @@ -571,9 +575,17 @@

folder.add( material, 'roughness', 0, 1 );
folder.add( material, 'metalness', 0, 1 );
folder.add( material, 'ior', 1, 2.333 );
folder.add( material, 'reflectivity', 0, 1 );
folder.add( material, 'iridescence', 0, 1 );
folder.add( material, 'iridescenceIOR', 1, 2.333 );
folder.add( material, 'sheen', 0, 1 );
folder.add( material, 'sheenRoughness', 0, 1 );
folder.addColor( data, 'sheenColor' ).onChange( handleColorChange( material.sheenColor ) );
folder.add( material, 'clearcoat', 0, 1 ).step( 0.01 );
folder.add( material, 'clearcoatRoughness', 0, 1 ).step( 0.01 );
folder.add( material, 'specularIntensity', 0, 1);
folder.addColor( data, 'specularColor' ).onChange( handleColorChange( material.specularColor ) );
folder.add( material, 'flatShading' ).onChange( needsUpdate( material, geometry ) );
folder.add( material, 'wireframe' );
folder.add( material, 'vertexColors' ).onChange( needsUpdate( material, geometry ) );
Expand All @@ -582,8 +594,8 @@
folder.add( data, 'map', diffuseMapKeys ).onChange( updateTexture( material, 'map', diffuseMaps ) );
folder.add( data, 'roughnessMap', roughnessMapKeys ).onChange( updateTexture( material, 'roughnessMap', roughnessMaps ) );
folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );

// TODO metalnessMap
folder.add( data, 'metalnessMap', alphaMapKeys ).onChange( updateTexture( material, 'metalnessMap', alphaMaps ) );
folder.add( data, 'iridescenceMap', alphaMapKeys ).onChange( updateTexture( material, 'iridescenceMap', alphaMaps ) );

}

Expand Down

0 comments on commit 18ae441

Please sign in to comment.