Skip to content

Commit 0de1454

Browse files
committed
Renamed MeshPhysicalMaterial back to MeshStandardMaterial.
1 parent dd7d07e commit 0de1454

19 files changed

Lines changed: 50 additions & 50 deletions

editor/js/Sidebar.Material.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Sidebar.Material = function ( editor ) {
6363
'MeshNormalMaterial': 'MeshNormalMaterial',
6464
'MeshLambertMaterial': 'MeshLambertMaterial',
6565
'MeshPhongMaterial': 'MeshPhongMaterial',
66-
'MeshPhysicalMaterial': 'MeshPhysicalMaterial',
66+
'MeshStandardMaterial': 'MeshStandardMaterial',
6767
'ShaderMaterial': 'ShaderMaterial',
6868
'SpriteMaterial': 'SpriteMaterial'
6969

examples/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1>
318318
"webgl_materials_variations_basic",
319319
"webgl_materials_variations_lambert",
320320
"webgl_materials_variations_phong",
321-
"webgl_materials_variations_physical",
322-
"webgl_materials_variations_physical2",
321+
"webgl_materials_variations_standard",
322+
"webgl_materials_variations_standard2",
323323
"webgl_materials_video",
324324
"webgl_materials_wireframe",
325325
"webgl_mirror",

examples/webgl_loader_ctm_materials.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214

215215
if ( m.name.indexOf( "Body" ) !== -1 ) {
216216

217-
var mm = new THREE.MeshPhysicalMaterial();
217+
var mm = new THREE.MeshStandardMaterial();
218218

219219
mm.color.setHex( 0x000000 );
220220
mm.lightMap = m.map;
@@ -226,7 +226,7 @@
226226

227227
} else if ( m.name.indexOf( "mirror" ) !== -1 ) {
228228

229-
var mm = new THREE.MeshPhysicalMaterial();
229+
var mm = new THREE.MeshStandardMaterial();
230230

231231
mm.color.setHex( 0x808080 );
232232
mm.lightMap = m.map;
@@ -238,7 +238,7 @@
238238

239239
} else if ( m.name.indexOf( "glass" ) !== -1 ) {
240240

241-
var mm = new THREE.MeshPhysicalMaterial();
241+
var mm = new THREE.MeshStandardMaterial();
242242

243243
mm.color.copy( m.color );
244244
// mm.lightMap = m.map;

examples/webgl_materials_variations_physical.html renamed to examples/webgl_materials_variations_standard.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<body>
2727

2828
<div id="container"></div>
29-
<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - Physical Material Variantions by <a href="http://clara.io/" target="_blank">Ben Houston</a>.</div>
29+
<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - Standard Material Variantions by <a href="http://clara.io/" target="_blank">Ben Houston</a>.</div>
3030

3131
<script src="../build/three.min.js"></script>
3232
<script src="js/controls/OrbitControls.js"></script>
@@ -89,7 +89,7 @@
8989
var geometry = new THREE.SphereBufferGeometry( sphereRadius, 32, 16 );
9090

9191
var localReflectionCube;
92-
92+
9393
for( var alpha = 0, alphaIndex = 0; alpha <= 1.0; alpha += stepSize, alphaIndex ++ ) {
9494

9595
var roughness = 1.0 - alpha;
@@ -110,7 +110,7 @@
110110
// basic monochromatic energy preservation
111111
var diffuseColor = new THREE.Color( gamma, 0, 0 ).multiplyScalar( 1 - 0.08 );
112112

113-
var material = new THREE.MeshPhysicalMaterial( { map: imgTexture, bumpMap: imgTexture, bumpScale: bumpScale, color: diffuseColor, metalness: metalness, roughness: roughness, shading: THREE.SmoothShading, envMap: localReflectionCube } )
113+
var material = new THREE.MeshStandardMaterial( { map: imgTexture, bumpMap: imgTexture, bumpScale: bumpScale, color: diffuseColor, metalness: metalness, roughness: roughness, shading: THREE.SmoothShading, envMap: localReflectionCube } )
114114

115115
var mesh = new THREE.Mesh( geometry, material );
116116

@@ -124,7 +124,7 @@
124124
}
125125
}
126126
}
127-
127+
128128
function addLabel( name, location ) {
129129
var textGeo = new THREE.TextGeometry( name, {
130130

examples/webgl_materials_variations_physical2.html renamed to examples/webgl_materials_variations_standard2.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<body>
2727

2828
<div id="container"></div>
29-
<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - Physical Material Variantions v2 by <a href="http://clara.io/" target="_blank">Ben Houston</a>.</div>
29+
<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - Standard Material Variantions v2 by <a href="http://clara.io/" target="_blank">Ben Houston</a>.</div>
3030

3131
<script src="../build/three.min.js"></script>
3232
<script src="js/controls/OrbitControls.js"></script>
@@ -89,7 +89,7 @@
8989
var geometry = new THREE.SphereBufferGeometry( sphereRadius, 32, 16 );
9090

9191
var localReflectionCube;
92-
92+
9393
for( var alpha = 0, alphaIndex = 0; alpha <= 1.0; alpha += stepSize, alphaIndex ++ ) {
9494

9595
var roughness = 1.0 - alpha;
@@ -110,7 +110,7 @@
110110
// basic monochromatic energy preservation
111111
var diffuseColor = new THREE.Color( gamma, 0, 0 ).multiplyScalar( 1 - 0.08 );
112112

113-
var material = new THREE.MeshPhysicalMaterial( { map: imgTexture, bumpMap: imgTexture, bumpScale: bumpScale, color: diffuseColor, reflectivity: reflectivity, roughness: roughness, shading: THREE.SmoothShading, envMap: localReflectionCube } )
113+
var material = new THREE.MeshStandardMaterial( { map: imgTexture, bumpMap: imgTexture, bumpScale: bumpScale, color: diffuseColor, reflectivity: reflectivity, roughness: roughness, shading: THREE.SmoothShading, envMap: localReflectionCube } )
114114

115115
var mesh = new THREE.Mesh( geometry, material );
116116

@@ -124,7 +124,7 @@
124124
}
125125
}
126126
}
127-
127+
128128
function addLabel( name, location ) {
129129
var textGeo = new THREE.TextGeometry( name, {
130130

src/Three.Legacy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,11 @@ Object.defineProperties( THREE, {
351351
Object.defineProperties( THREE.MeshPhongMaterial.prototype, {
352352
metal: {
353353
get: function () {
354-
console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshPhysicalMaterial instead.' );
354+
console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' );
355355
return false;
356356
},
357357
set: function ( value ) {
358-
console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshPhysicalMaterial instead' );
358+
console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead' );
359359
}
360360
}
361361
} );
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@
5959
* }
6060
*/
6161

62-
THREE.MeshPhysicalMaterial = function ( parameters ) {
62+
THREE.MeshStandardMaterial = function ( parameters ) {
6363

6464
THREE.Material.call( this );
6565

66-
this.type = 'MeshPhysicalMaterial';
66+
this.type = 'MeshStandardMaterial';
6767

6868
this.color = new THREE.Color( 0xffffff ); // diffuse
6969
this.roughness = 0.5;
@@ -124,10 +124,10 @@ THREE.MeshPhysicalMaterial = function ( parameters ) {
124124

125125
};
126126

127-
THREE.MeshPhysicalMaterial.prototype = Object.create( THREE.Material.prototype );
128-
THREE.MeshPhysicalMaterial.prototype.constructor = THREE.MeshPhysicalMaterial;
127+
THREE.MeshStandardMaterial.prototype = Object.create( THREE.Material.prototype );
128+
THREE.MeshStandardMaterial.prototype.constructor = THREE.MeshStandardMaterial;
129129

130-
THREE.MeshPhysicalMaterial.prototype.copy = function ( source ) {
130+
THREE.MeshStandardMaterial.prototype.copy = function ( source ) {
131131

132132
THREE.Material.prototype.copy.call( this, source );
133133

src/renderers/WebGLRenderer.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ THREE.WebGLRenderer = function ( parameters ) {
636636

637637
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.normal );
638638

639-
if ( material.type !== 'MeshPhongMaterial' && material.type !== 'MeshPhysicalMaterial' && material.shading === THREE.FlatShading ) {
639+
if ( material.type !== 'MeshPhongMaterial' && material.type !== 'MeshStandardMaterial' && material.shading === THREE.FlatShading ) {
640640

641641
for ( var i = 0, l = object.count * 3; i < l; i += 9 ) {
642642

@@ -1506,7 +1506,7 @@ THREE.WebGLRenderer = function ( parameters ) {
15061506

15071507
if ( material instanceof THREE.MeshPhongMaterial ||
15081508
material instanceof THREE.MeshLambertMaterial ||
1509-
material instanceof THREE.MeshPhysicalMaterial ||
1509+
material instanceof THREE.MeshStandardMaterial ||
15101510
material.lights ) {
15111511

15121512
// store the light setup it was created for
@@ -1636,7 +1636,7 @@ THREE.WebGLRenderer = function ( parameters ) {
16361636

16371637
if ( material instanceof THREE.ShaderMaterial ||
16381638
material instanceof THREE.MeshPhongMaterial ||
1639-
material instanceof THREE.MeshPhysicalMaterial ||
1639+
material instanceof THREE.MeshStandardMaterial ||
16401640
material.envMap ) {
16411641

16421642
if ( p_uniforms.cameraPosition !== undefined ) {
@@ -1651,7 +1651,7 @@ THREE.WebGLRenderer = function ( parameters ) {
16511651
if ( material instanceof THREE.MeshPhongMaterial ||
16521652
material instanceof THREE.MeshLambertMaterial ||
16531653
material instanceof THREE.MeshBasicMaterial ||
1654-
material instanceof THREE.MeshPhysicalMaterial ||
1654+
material instanceof THREE.MeshStandardMaterial ||
16551655
material instanceof THREE.ShaderMaterial ||
16561656
material.skinning ) {
16571657

@@ -1722,7 +1722,7 @@ THREE.WebGLRenderer = function ( parameters ) {
17221722

17231723
if ( material instanceof THREE.MeshPhongMaterial ||
17241724
material instanceof THREE.MeshLambertMaterial ||
1725-
material instanceof THREE.MeshPhysicalMaterial ||
1725+
material instanceof THREE.MeshStandardMaterial ||
17261726
material.lights ) {
17271727

17281728
// the current material requires lighting info
@@ -1749,7 +1749,7 @@ THREE.WebGLRenderer = function ( parameters ) {
17491749
if ( material instanceof THREE.MeshBasicMaterial ||
17501750
material instanceof THREE.MeshLambertMaterial ||
17511751
material instanceof THREE.MeshPhongMaterial ||
1752-
material instanceof THREE.MeshPhysicalMaterial ) {
1752+
material instanceof THREE.MeshStandardMaterial ) {
17531753

17541754
refreshUniformsCommon( m_uniforms, material );
17551755

@@ -1774,9 +1774,9 @@ THREE.WebGLRenderer = function ( parameters ) {
17741774

17751775
refreshUniformsPhong( m_uniforms, material );
17761776

1777-
} else if ( material instanceof THREE.MeshPhysicalMaterial ) {
1777+
} else if ( material instanceof THREE.MeshStandardMaterial ) {
17781778

1779-
refreshUniformsPhysical( m_uniforms, material );
1779+
refreshUniformsStandard( m_uniforms, material );
17801780

17811781
} else if ( material instanceof THREE.MeshDepthMaterial ) {
17821782

@@ -1995,7 +1995,7 @@ THREE.WebGLRenderer = function ( parameters ) {
19951995

19961996
}
19971997

1998-
function refreshUniformsPhysical ( uniforms, material ) {
1998+
function refreshUniformsStandard ( uniforms, material ) {
19991999

20002000
uniforms.roughness.value = material.roughness;
20012001
//uniforms.reflectivity.value = material.reflectivity; // part of uniforms common

src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if defined( USE_ENVMAP ) || defined( PHYSICAL )
1+
#if defined( USE_ENVMAP ) || defined( STANDARD )
22
uniform float reflectivity;
33
#endif
44

@@ -10,7 +10,7 @@
1010
#endif
1111
uniform float flipEnvMap;
1212

13-
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )
13+
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )
1414

1515
uniform float refractionRatio;
1616

src/renderers/shaders/ShaderChunk/envmap_pars_vertex.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( PHYSICAL )
1+
#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )
22

33
varying vec3 vReflect;
44

0 commit comments

Comments
 (0)