|
@@ -6764,7 +6764,6 @@ class Material extends EventDispatcher {
|
|
|
this.uuid = generateUUID();
|
|
|
this.name = '';
|
|
|
this.type = 'Material';
|
|
|
- this.fog = true;
|
|
|
this.blending = NormalBlending;
|
|
|
this.side = FrontSide;
|
|
|
this.vertexColors = false;
|
|
@@ -7010,6 +7009,7 @@ class Material extends EventDispatcher {
|
|
|
if (this.flatShading === true) data.flatShading = this.flatShading;
|
|
|
if (this.visible === false) data.visible = false;
|
|
|
if (this.toneMapped === false) data.toneMapped = false;
|
|
|
+ if (this.fog === false) data.fog = false;
|
|
|
if (JSON.stringify(this.userData) !== '{}') data.userData = this.userData; // TODO: Copied from Object3D.toJSON
|
|
|
|
|
|
function extractFromCache(cache) {
|
|
@@ -7040,7 +7040,6 @@ class Material extends EventDispatcher {
|
|
|
|
|
|
copy(source) {
|
|
|
this.name = source.name;
|
|
|
- this.fog = source.fog;
|
|
|
this.blending = source.blending;
|
|
|
this.side = source.side;
|
|
|
this.vertexColors = source.vertexColors;
|
|
@@ -7136,6 +7135,7 @@ class MeshBasicMaterial extends Material {
|
|
|
this.wireframeLinewidth = 1;
|
|
|
this.wireframeLinecap = 'round';
|
|
|
this.wireframeLinejoin = 'round';
|
|
|
+ this.fog = true;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -7157,6 +7157,7 @@ class MeshBasicMaterial extends Material {
|
|
|
this.wireframeLinewidth = source.wireframeLinewidth;
|
|
|
this.wireframeLinecap = source.wireframeLinecap;
|
|
|
this.wireframeLinejoin = source.wireframeLinejoin;
|
|
|
+ this.fog = source.fog;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -8861,6 +8862,7 @@ class ShaderMaterial extends Material {
|
|
|
this.defines = Object.assign({}, source.defines);
|
|
|
this.wireframe = source.wireframe;
|
|
|
this.wireframeLinewidth = source.wireframeLinewidth;
|
|
|
+ this.fog = source.fog;
|
|
|
this.lights = source.lights;
|
|
|
this.clipping = source.clipping;
|
|
|
this.extensions = Object.assign({}, source.extensions);
|
|
@@ -14536,7 +14538,7 @@ function WebGLPrograms(renderer, cubemaps, cubeuvmaps, extensions, capabilities,
|
|
|
vertexUvs: !!material.map || !!material.bumpMap || !!material.normalMap || !!material.specularMap || !!material.alphaMap || !!material.emissiveMap || !!material.roughnessMap || !!material.metalnessMap || !!material.clearcoatMap || !!material.clearcoatRoughnessMap || !!material.clearcoatNormalMap || !!material.displacementMap || !!material.transmissionMap || !!material.thicknessMap || !!material.specularIntensityMap || !!material.specularColorMap || !!material.sheenColorMap || !!material.sheenRoughnessMap,
|
|
|
uvsVertexOnly: !(!!material.map || !!material.bumpMap || !!material.normalMap || !!material.specularMap || !!material.alphaMap || !!material.emissiveMap || !!material.roughnessMap || !!material.metalnessMap || !!material.clearcoatNormalMap || material.transmission > 0 || !!material.transmissionMap || !!material.thicknessMap || !!material.specularIntensityMap || !!material.specularColorMap || material.sheen > 0 || !!material.sheenColorMap || !!material.sheenRoughnessMap) && !!material.displacementMap,
|
|
|
fog: !!fog,
|
|
|
- useFog: material.fog,
|
|
|
+ useFog: material.fog === true,
|
|
|
fogExp2: fog && fog.isFogExp2,
|
|
|
flatShading: !!material.flatShading,
|
|
|
sizeAttenuation: material.sizeAttenuation,
|
|
@@ -15429,7 +15431,6 @@ class MeshDepthMaterial extends Material {
|
|
|
this.displacementBias = 0;
|
|
|
this.wireframe = false;
|
|
|
this.wireframeLinewidth = 1;
|
|
|
- this.fog = false;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -15462,7 +15463,6 @@ class MeshDistanceMaterial extends Material {
|
|
|
this.displacementMap = null;
|
|
|
this.displacementScale = 1;
|
|
|
this.displacementBias = 0;
|
|
|
- this.fog = false;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -20151,7 +20151,7 @@ function WebGLRenderer(parameters = {}) {
|
|
|
needsProgramChange = true;
|
|
|
} else if (materialProperties.envMap !== envMap) {
|
|
|
needsProgramChange = true;
|
|
|
- } else if (material.fog && materialProperties.fog !== fog) {
|
|
|
+ } else if (material.fog === true && materialProperties.fog !== fog) {
|
|
|
needsProgramChange = true;
|
|
|
} else if (materialProperties.numClippingPlanes !== undefined && (materialProperties.numClippingPlanes !== clipping.numPlanes || materialProperties.numIntersection !== clipping.numIntersection)) {
|
|
|
needsProgramChange = true;
|
|
@@ -20280,7 +20280,7 @@ function WebGLRenderer(parameters = {}) {
|
|
|
} // refresh uniforms common to several materials
|
|
|
|
|
|
|
|
|
- if (fog && material.fog) {
|
|
|
+ if (fog && material.fog === true) {
|
|
|
materials.refreshFogUniforms(m_uniforms, fog);
|
|
|
}
|
|
|
|
|
@@ -21022,6 +21022,7 @@ class SpriteMaterial extends Material {
|
|
|
this.rotation = 0;
|
|
|
this.sizeAttenuation = true;
|
|
|
this.transparent = true;
|
|
|
+ this.fog = true;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -21032,6 +21033,7 @@ class SpriteMaterial extends Material {
|
|
|
this.alphaMap = source.alphaMap;
|
|
|
this.rotation = source.rotation;
|
|
|
this.sizeAttenuation = source.sizeAttenuation;
|
|
|
+ this.fog = source.fog;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -21760,6 +21762,7 @@ class LineBasicMaterial extends Material {
|
|
|
this.linewidth = 1;
|
|
|
this.linecap = 'round';
|
|
|
this.linejoin = 'round';
|
|
|
+ this.fog = true;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -21769,6 +21772,7 @@ class LineBasicMaterial extends Material {
|
|
|
this.linewidth = source.linewidth;
|
|
|
this.linecap = source.linecap;
|
|
|
this.linejoin = source.linejoin;
|
|
|
+ this.fog = source.fog;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -22019,6 +22023,7 @@ class PointsMaterial extends Material {
|
|
|
this.alphaMap = null;
|
|
|
this.size = 1;
|
|
|
this.sizeAttenuation = true;
|
|
|
+ this.fog = true;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -22029,6 +22034,7 @@ class PointsMaterial extends Material {
|
|
|
this.alphaMap = source.alphaMap;
|
|
|
this.size = source.size;
|
|
|
this.sizeAttenuation = source.sizeAttenuation;
|
|
|
+ this.fog = source.fog;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -26260,12 +26266,14 @@ class ShadowMaterial extends Material {
|
|
|
this.type = 'ShadowMaterial';
|
|
|
this.color = new Color(0x000000);
|
|
|
this.transparent = true;
|
|
|
+ this.fog = true;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
|
copy(source) {
|
|
|
super.copy(source);
|
|
|
this.color.copy(source.color);
|
|
|
+ this.fog = source.fog;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -26320,6 +26328,7 @@ class MeshStandardMaterial extends Material {
|
|
|
this.wireframeLinecap = 'round';
|
|
|
this.wireframeLinejoin = 'round';
|
|
|
this.flatShading = false;
|
|
|
+ this.fog = true;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -26357,6 +26366,7 @@ class MeshStandardMaterial extends Material {
|
|
|
this.wireframeLinecap = source.wireframeLinecap;
|
|
|
this.wireframeLinejoin = source.wireframeLinejoin;
|
|
|
this.flatShading = source.flatShading;
|
|
|
+ this.fog = source.fog;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -26511,6 +26521,7 @@ class MeshPhongMaterial extends Material {
|
|
|
this.wireframeLinecap = 'round';
|
|
|
this.wireframeLinejoin = 'round';
|
|
|
this.flatShading = false;
|
|
|
+ this.fog = true;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -26546,6 +26557,7 @@ class MeshPhongMaterial extends Material {
|
|
|
this.wireframeLinecap = source.wireframeLinecap;
|
|
|
this.wireframeLinejoin = source.wireframeLinejoin;
|
|
|
this.flatShading = source.flatShading;
|
|
|
+ this.fog = source.fog;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -26583,6 +26595,7 @@ class MeshToonMaterial extends Material {
|
|
|
this.wireframeLinewidth = 1;
|
|
|
this.wireframeLinecap = 'round';
|
|
|
this.wireframeLinejoin = 'round';
|
|
|
+ this.fog = true;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -26611,6 +26624,7 @@ class MeshToonMaterial extends Material {
|
|
|
this.wireframeLinewidth = source.wireframeLinewidth;
|
|
|
this.wireframeLinecap = source.wireframeLinecap;
|
|
|
this.wireframeLinejoin = source.wireframeLinejoin;
|
|
|
+ this.fog = source.fog;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -26632,7 +26646,6 @@ class MeshNormalMaterial extends Material {
|
|
|
this.displacementBias = 0;
|
|
|
this.wireframe = false;
|
|
|
this.wireframeLinewidth = 1;
|
|
|
- this.fog = false;
|
|
|
this.flatShading = false;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
@@ -26681,6 +26694,7 @@ class MeshLambertMaterial extends Material {
|
|
|
this.wireframeLinewidth = 1;
|
|
|
this.wireframeLinecap = 'round';
|
|
|
this.wireframeLinejoin = 'round';
|
|
|
+ this.fog = true;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -26705,6 +26719,7 @@ class MeshLambertMaterial extends Material {
|
|
|
this.wireframeLinewidth = source.wireframeLinewidth;
|
|
|
this.wireframeLinecap = source.wireframeLinecap;
|
|
|
this.wireframeLinejoin = source.wireframeLinejoin;
|
|
|
+ this.fog = source.fog;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -26733,6 +26748,7 @@ class MeshMatcapMaterial extends Material {
|
|
|
this.displacementBias = 0;
|
|
|
this.alphaMap = null;
|
|
|
this.flatShading = false;
|
|
|
+ this.fog = true;
|
|
|
this.setValues(parameters);
|
|
|
}
|
|
|
|
|
@@ -26754,6 +26770,7 @@ class MeshMatcapMaterial extends Material {
|
|
|
this.displacementBias = source.displacementBias;
|
|
|
this.alphaMap = source.alphaMap;
|
|
|
this.flatShading = source.flatShading;
|
|
|
+ this.fog = source.fog;
|
|
|
return this;
|
|
|
}
|
|
|
|