Skip to content

Commit bccaa60

Browse files
committed
MeshPhongMaterial: Removed metal property. Now that we have MeshPhysicalMaterial...
1 parent 6517447 commit bccaa60

6 files changed

Lines changed: 15 additions & 24 deletions

File tree

docs/api/materials/MeshPhongMaterial.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,6 @@ <h3>[property:Color specular]</h3>
7070
<h3>[property:Float shininess]</h3>
7171
<div>How shiny the specular highlight is; a higher value gives a sharper highlight. Default is *30*.</div>
7272

73-
<h3>[property:boolean metal]</h3>
74-
<div>
75-
If set to true the shader multiplies the specular highlight by the underlying color of the object, making
76-
it appear to be more metal-like and darker. If set to false the specular highlight is added ontop of the
77-
underlying colors.
78-
</div>
79-
8073
<h3>[property:Texture map]</h3>
8174
<div>Set color texture map. Default is null. The texture map color is modulated by the diffuse color.</div>
8275

src/Three.Legacy.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,22 @@ Object.defineProperties( THREE, {
348348
}
349349
} );
350350

351+
Object.defineProperties( THREE.MeshPhongMaterial.prototype, {
352+
metal: {
353+
get: function () {
354+
console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshPhysicalMaterial instead.' );
355+
return false;
356+
},
357+
set: function ( value ) {
358+
console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshPhysicalMaterial instead' );
359+
}
360+
}
361+
} );
362+
351363
Object.defineProperties( THREE.ShaderMaterial.prototype, {
352364
derivatives: {
353365
get: function () {
354-
console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
366+
console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );
355367
return this.extensions.derivatives;
356368
},
357369
set: function ( value ) {

src/materials/MeshPhongMaterial.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ THREE.MeshPhongMaterial = function ( parameters ) {
6767
this.specular = new THREE.Color( 0x111111 );
6868
this.shininess = 30;
6969

70-
this.metal = false;
71-
7270
this.map = null;
7371

7472
this.lightMap = null;
@@ -129,8 +127,6 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) {
129127
this.specular.copy( source.specular );
130128
this.shininess = source.shininess;
131129

132-
this.metal = source.metal;
133-
134130
this.map = source.map;
135131

136132
this.lightMap = source.lightMap;

src/renderers/shaders/ShaderLib.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -395,15 +395,7 @@ THREE.ShaderLib = {
395395
"reflectedLight.directDiffuse *= shadowMask;",
396396
"reflectedLight.directSpecular *= shadowMask;",
397397

398-
"#ifdef METAL",
399-
400-
" vec3 outgoingLight = ( reflectedLight.directDiffuse + reflectedLight.indirectDiffuse ) * specular + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;",
401-
402-
"#else",
403-
404-
" vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;",
405-
406-
"#endif",
398+
"vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;",
407399

408400
THREE.ShaderChunk[ "envmap_fragment" ],
409401
THREE.ShaderChunk[ "linear_to_gamma_fragment" ],

src/renderers/webgl/WebGLProgram.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ THREE.WebGLProgram = ( function () {
391391

392392
parameters.flatShading ? '#define FLAT_SHADED' : '',
393393

394-
parameters.metal ? '#define METAL' : '',
395394
parameters.doubleSided ? '#define DOUBLE_SIDED' : '',
396395
parameters.flipSided ? '#define FLIP_SIDED' : '',
397396

src/renderers/webgl/WebGLPrograms.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
2323
"maxBones", "useVertexTexture", "morphTargets", "morphNormals",
2424
"maxMorphTargets", "maxMorphNormals", "maxDirLights", "maxPointLights",
2525
"maxSpotLights", "maxHemiLights", "maxShadows", "shadowMapEnabled", "pointLightShadows",
26-
"shadowMapType", "shadowMapDebug", "alphaTest", "metal", "doubleSided",
26+
"shadowMapType", "shadowMapDebug", "alphaTest", "doubleSided",
2727
"flipSided"
2828
];
2929

@@ -144,7 +144,6 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
144144
shadowMapDebug: renderer.shadowMap.debug,
145145

146146
alphaTest: material.alphaTest,
147-
metal: material.metal,
148147
doubleSided: material.side === THREE.DoubleSide,
149148
flipSided: material.side === THREE.BackSide
150149

0 commit comments

Comments
 (0)