提交 f802fc13 编写于 作者: W WestLangley

MeshStandardMaterial: remove reflectivity, reflectivityMap

上级 e7f881b2
......@@ -4,7 +4,6 @@
* parameters = {
* color: <hex>,
* roughness: <float>,
* reflectivity: <float>,
* metalness: <float>,
* emissive: <hex>,
......@@ -32,8 +31,6 @@
*
* roughnessMap: new THREE.Texture( <Image> ),
*
* reflectivityMap: new THREE.Texture( <Image> ),
*
* metalnessMap: new THREE.Texture( <Image> ),
*
* alphaMap: new THREE.Texture( <Image> ),
......@@ -69,7 +66,6 @@ THREE.MeshStandardMaterial = function ( parameters ) {
this.color = new THREE.Color( 0xffffff ); // diffuse
this.roughness = 0.5;
this.reflectivity = 1;
this.metalness = 0;
this.emissive = new THREE.Color( 0x000000 );
......@@ -96,8 +92,6 @@ THREE.MeshStandardMaterial = function ( parameters ) {
this.roughnessMap = null;
this.reflectivityMap = null;
this.metalnessMap = null;
this.alphaMap = null;
......@@ -135,7 +129,6 @@ THREE.MeshStandardMaterial.prototype.copy = function ( source ) {
this.color.copy( source.color );
this.roughness = source.roughness;
this.reflectivity = source.reflectivity;
this.metalness = source.metalness;
this.emissive.copy( source.emissive );
......@@ -162,8 +155,6 @@ THREE.MeshStandardMaterial.prototype.copy = function ( source ) {
this.roughnessMap = source.roughnessMap;
this.reflectivityMap = source.reflectivityMap;
this.metalnessMap = source.metalnessMap;
this.alphaMap = source.alphaMap;
......
......@@ -2042,7 +2042,6 @@ THREE.WebGLRenderer = function ( parameters ) {
function refreshUniformsStandard ( uniforms, material ) {
uniforms.roughness.value = material.roughness;
//uniforms.reflectivity.value = material.reflectivity; // part of uniforms common
uniforms.metalness.value = material.metalness;
if ( material.roughnessMap ) {
......@@ -2051,12 +2050,6 @@ THREE.WebGLRenderer = function ( parameters ) {
}
if ( material.reflectivityMap ) {
uniforms.reflectivityMap.value = material.reflectivityMap;
}
if ( material.metalnessMap ) {
uniforms.metalnessMap.value = material.metalnessMap;
......
PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
material.specularRoughness = roughnessFactor * 0.5 + 0.5; // disney's remapping of [ 0, 1 ] roughness to [ 0.5, 1 ]
material.specularColor = mix( vec3( 0.08 ) * reflectivity, diffuseColor.rgb, metalnessFactor );
material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_REFLECTIVITYMAP ) || defined( USE_METALNESSMAP )
#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )
varying vec2 vUv;
......
#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_REFLECTIVITYMAP ) || defined( USE_METALNESSMAP )
#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )
varying vec2 vUv;
uniform vec4 offsetRepeat;
......
#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_REFLECTIVITYMAP ) || defined( USE_METALNESSMAP )
#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )
vUv = uv * offsetRepeat.zw + offsetRepeat.xy;
......
......@@ -421,7 +421,6 @@ THREE.ShaderLib = {
THREE.UniformsLib[ "normalmap" ],
THREE.UniformsLib[ "displacementmap" ],
THREE.UniformsLib[ "roughnessmap" ],
THREE.UniformsLib[ "reflectivitymap" ],
THREE.UniformsLib[ "metalnessmap" ],
THREE.UniformsLib[ "fog" ],
THREE.UniformsLib[ "lights" ],
......@@ -535,7 +534,6 @@ THREE.ShaderLib = {
THREE.ShaderChunk[ "bumpmap_pars_fragment" ],
THREE.ShaderChunk[ "normalmap_pars_fragment" ],
THREE.ShaderChunk[ "roughnessmap_pars_fragment" ],
//THREE.ShaderChunk[ "reflectivitymap_pars_fragment" ],
THREE.ShaderChunk[ "metalnessmap_pars_fragment" ],
THREE.ShaderChunk[ "logdepthbuf_pars_fragment" ],
......@@ -552,7 +550,6 @@ THREE.ShaderLib = {
THREE.ShaderChunk[ "alphatest_fragment" ],
THREE.ShaderChunk[ "specularmap_fragment" ],
THREE.ShaderChunk[ "roughnessmap_fragment" ],
//THREE.ShaderChunk[ "reflectivitymap_fragment" ],
THREE.ShaderChunk[ "metalnessmap_fragment" ],
THREE.ShaderChunk[ "normal_fragment" ],
THREE.ShaderChunk[ "emissivemap_fragment" ],
......
......@@ -70,12 +70,6 @@ THREE.UniformsLib = {
},
reflectivitymap: {
"reflectivityMap" : { type: "t", value: null }
},
metalnessmap: {
"metalnessMap" : { type: "t", value: null }
......
......@@ -265,7 +265,6 @@ THREE.WebGLProgram = ( function () {
parameters.displacementMap && parameters.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '',
parameters.specularMap ? '#define USE_SPECULARMAP' : '',
parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
parameters.reflectivityMap ? '#define USE_REFLECTIVITYMAP' : '',
parameters.metalnessMap ? '#define USE_METALNESSMAP' : '',
parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
parameters.vertexColors ? '#define USE_COLOR' : '',
......@@ -384,7 +383,6 @@ THREE.WebGLProgram = ( function () {
parameters.normalMap ? '#define USE_NORMALMAP' : '',
parameters.specularMap ? '#define USE_SPECULARMAP' : '',
parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
parameters.reflectivityMap ? '#define USE_REFLECTIVITYMAP' : '',
parameters.metalnessMap ? '#define USE_METALNESSMAP' : '',
parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
parameters.vertexColors ? '#define USE_COLOR' : '',
......
......@@ -17,7 +17,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
var parameterNames = [
"precision", "supportsVertexTextures", "map", "envMap", "envMapMode",
"lightMap", "aoMap", "emissiveMap", "bumpMap", "normalMap", "displacementMap", "specularMap",
"roughnessMap", "reflectivityMap", "metalnessMap",
"roughnessMap", "metalnessMap",
"alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp",
"flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning",
"maxBones", "useVertexTexture", "morphTargets", "morphNormals",
......@@ -105,7 +105,6 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
normalMap: !! material.normalMap,
displacementMap: !! material.displacementMap,
roughnessMap: !! material.roughnessMap,
reflectivityMap: !! material.reflectivityMap,
metalnessMap: !! material.metalnessMap,
specularMap: !! material.specularMap,
alphaMap: !! material.alphaMap,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册