@@ -6764,7 +6764,6 @@ class Material extends EventDispatcher {
6764
6764
this.uuid = generateUUID();
6765
6765
this.name = '';
6766
6766
this.type = 'Material';
6767
- this.fog = true;
6768
6767
this.blending = NormalBlending;
6769
6768
this.side = FrontSide;
6770
6769
this.vertexColors = false;
@@ -7010,6 +7009,7 @@ class Material extends EventDispatcher {
7010
7009
if (this.flatShading === true) data.flatShading = this.flatShading;
7011
7010
if (this.visible === false) data.visible = false;
7012
7011
if (this.toneMapped === false) data.toneMapped = false;
7012
+ if (this.fog === false) data.fog = false;
7013
7013
if (JSON.stringify(this.userData) !== '{}') data.userData = this.userData; // TODO: Copied from Object3D.toJSON
7014
7014
7015
7015
function extractFromCache(cache) {
@@ -7040,7 +7040,6 @@ class Material extends EventDispatcher {
7040
7040
7041
7041
copy(source) {
7042
7042
this.name = source.name;
7043
- this.fog = source.fog;
7044
7043
this.blending = source.blending;
7045
7044
this.side = source.side;
7046
7045
this.vertexColors = source.vertexColors;
@@ -7136,6 +7135,7 @@ class MeshBasicMaterial extends Material {
7136
7135
this.wireframeLinewidth = 1;
7137
7136
this.wireframeLinecap = 'round';
7138
7137
this.wireframeLinejoin = 'round';
7138
+ this.fog = true;
7139
7139
this.setValues(parameters);
7140
7140
}
7141
7141
@@ -7157,6 +7157,7 @@ class MeshBasicMaterial extends Material {
7157
7157
this.wireframeLinewidth = source.wireframeLinewidth;
7158
7158
this.wireframeLinecap = source.wireframeLinecap;
7159
7159
this.wireframeLinejoin = source.wireframeLinejoin;
7160
+ this.fog = source.fog;
7160
7161
return this;
7161
7162
}
7162
7163
@@ -8861,6 +8862,7 @@ class ShaderMaterial extends Material {
8861
8862
this.defines = Object.assign({}, source.defines);
8862
8863
this.wireframe = source.wireframe;
8863
8864
this.wireframeLinewidth = source.wireframeLinewidth;
8865
+ this.fog = source.fog;
8864
8866
this.lights = source.lights;
8865
8867
this.clipping = source.clipping;
8866
8868
this.extensions = Object.assign({}, source.extensions);
@@ -14536,7 +14538,7 @@ function WebGLPrograms(renderer, cubemaps, cubeuvmaps, extensions, capabilities,
14536
14538
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,
14537
14539
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,
14538
14540
fog: !!fog,
14539
- useFog: material.fog,
14541
+ useFog: material.fog === true ,
14540
14542
fogExp2: fog && fog.isFogExp2,
14541
14543
flatShading: !!material.flatShading,
14542
14544
sizeAttenuation: material.sizeAttenuation,
@@ -15429,7 +15431,6 @@ class MeshDepthMaterial extends Material {
15429
15431
this.displacementBias = 0;
15430
15432
this.wireframe = false;
15431
15433
this.wireframeLinewidth = 1;
15432
- this.fog = false;
15433
15434
this.setValues(parameters);
15434
15435
}
15435
15436
@@ -15462,7 +15463,6 @@ class MeshDistanceMaterial extends Material {
15462
15463
this.displacementMap = null;
15463
15464
this.displacementScale = 1;
15464
15465
this.displacementBias = 0;
15465
- this.fog = false;
15466
15466
this.setValues(parameters);
15467
15467
}
15468
15468
@@ -20151,7 +20151,7 @@ function WebGLRenderer(parameters = {}) {
20151
20151
needsProgramChange = true;
20152
20152
} else if (materialProperties.envMap !== envMap) {
20153
20153
needsProgramChange = true;
20154
- } else if (material.fog && materialProperties.fog !== fog) {
20154
+ } else if (material.fog === true && materialProperties.fog !== fog) {
20155
20155
needsProgramChange = true;
20156
20156
} else if (materialProperties.numClippingPlanes !== undefined && (materialProperties.numClippingPlanes !== clipping.numPlanes || materialProperties.numIntersection !== clipping.numIntersection)) {
20157
20157
needsProgramChange = true;
@@ -20280,7 +20280,7 @@ function WebGLRenderer(parameters = {}) {
20280
20280
} // refresh uniforms common to several materials
20281
20281
20282
20282
20283
- if (fog && material.fog) {
20283
+ if (fog && material.fog === true ) {
20284
20284
materials.refreshFogUniforms(m_uniforms, fog);
20285
20285
}
20286
20286
@@ -21022,6 +21022,7 @@ class SpriteMaterial extends Material {
21022
21022
this.rotation = 0;
21023
21023
this.sizeAttenuation = true;
21024
21024
this.transparent = true;
21025
+ this.fog = true;
21025
21026
this.setValues(parameters);
21026
21027
}
21027
21028
@@ -21032,6 +21033,7 @@ class SpriteMaterial extends Material {
21032
21033
this.alphaMap = source.alphaMap;
21033
21034
this.rotation = source.rotation;
21034
21035
this.sizeAttenuation = source.sizeAttenuation;
21036
+ this.fog = source.fog;
21035
21037
return this;
21036
21038
}
21037
21039
@@ -21760,6 +21762,7 @@ class LineBasicMaterial extends Material {
21760
21762
this.linewidth = 1;
21761
21763
this.linecap = 'round';
21762
21764
this.linejoin = 'round';
21765
+ this.fog = true;
21763
21766
this.setValues(parameters);
21764
21767
}
21765
21768
@@ -21769,6 +21772,7 @@ class LineBasicMaterial extends Material {
21769
21772
this.linewidth = source.linewidth;
21770
21773
this.linecap = source.linecap;
21771
21774
this.linejoin = source.linejoin;
21775
+ this.fog = source.fog;
21772
21776
return this;
21773
21777
}
21774
21778
@@ -22019,6 +22023,7 @@ class PointsMaterial extends Material {
22019
22023
this.alphaMap = null;
22020
22024
this.size = 1;
22021
22025
this.sizeAttenuation = true;
22026
+ this.fog = true;
22022
22027
this.setValues(parameters);
22023
22028
}
22024
22029
@@ -22029,6 +22034,7 @@ class PointsMaterial extends Material {
22029
22034
this.alphaMap = source.alphaMap;
22030
22035
this.size = source.size;
22031
22036
this.sizeAttenuation = source.sizeAttenuation;
22037
+ this.fog = source.fog;
22032
22038
return this;
22033
22039
}
22034
22040
@@ -26260,12 +26266,14 @@ class ShadowMaterial extends Material {
26260
26266
this.type = 'ShadowMaterial';
26261
26267
this.color = new Color(0x000000);
26262
26268
this.transparent = true;
26269
+ this.fog = true;
26263
26270
this.setValues(parameters);
26264
26271
}
26265
26272
26266
26273
copy(source) {
26267
26274
super.copy(source);
26268
26275
this.color.copy(source.color);
26276
+ this.fog = source.fog;
26269
26277
return this;
26270
26278
}
26271
26279
@@ -26320,6 +26328,7 @@ class MeshStandardMaterial extends Material {
26320
26328
this.wireframeLinecap = 'round';
26321
26329
this.wireframeLinejoin = 'round';
26322
26330
this.flatShading = false;
26331
+ this.fog = true;
26323
26332
this.setValues(parameters);
26324
26333
}
26325
26334
@@ -26357,6 +26366,7 @@ class MeshStandardMaterial extends Material {
26357
26366
this.wireframeLinecap = source.wireframeLinecap;
26358
26367
this.wireframeLinejoin = source.wireframeLinejoin;
26359
26368
this.flatShading = source.flatShading;
26369
+ this.fog = source.fog;
26360
26370
return this;
26361
26371
}
26362
26372
@@ -26511,6 +26521,7 @@ class MeshPhongMaterial extends Material {
26511
26521
this.wireframeLinecap = 'round';
26512
26522
this.wireframeLinejoin = 'round';
26513
26523
this.flatShading = false;
26524
+ this.fog = true;
26514
26525
this.setValues(parameters);
26515
26526
}
26516
26527
@@ -26546,6 +26557,7 @@ class MeshPhongMaterial extends Material {
26546
26557
this.wireframeLinecap = source.wireframeLinecap;
26547
26558
this.wireframeLinejoin = source.wireframeLinejoin;
26548
26559
this.flatShading = source.flatShading;
26560
+ this.fog = source.fog;
26549
26561
return this;
26550
26562
}
26551
26563
@@ -26583,6 +26595,7 @@ class MeshToonMaterial extends Material {
26583
26595
this.wireframeLinewidth = 1;
26584
26596
this.wireframeLinecap = 'round';
26585
26597
this.wireframeLinejoin = 'round';
26598
+ this.fog = true;
26586
26599
this.setValues(parameters);
26587
26600
}
26588
26601
@@ -26611,6 +26624,7 @@ class MeshToonMaterial extends Material {
26611
26624
this.wireframeLinewidth = source.wireframeLinewidth;
26612
26625
this.wireframeLinecap = source.wireframeLinecap;
26613
26626
this.wireframeLinejoin = source.wireframeLinejoin;
26627
+ this.fog = source.fog;
26614
26628
return this;
26615
26629
}
26616
26630
@@ -26632,7 +26646,6 @@ class MeshNormalMaterial extends Material {
26632
26646
this.displacementBias = 0;
26633
26647
this.wireframe = false;
26634
26648
this.wireframeLinewidth = 1;
26635
- this.fog = false;
26636
26649
this.flatShading = false;
26637
26650
this.setValues(parameters);
26638
26651
}
@@ -26681,6 +26694,7 @@ class MeshLambertMaterial extends Material {
26681
26694
this.wireframeLinewidth = 1;
26682
26695
this.wireframeLinecap = 'round';
26683
26696
this.wireframeLinejoin = 'round';
26697
+ this.fog = true;
26684
26698
this.setValues(parameters);
26685
26699
}
26686
26700
@@ -26705,6 +26719,7 @@ class MeshLambertMaterial extends Material {
26705
26719
this.wireframeLinewidth = source.wireframeLinewidth;
26706
26720
this.wireframeLinecap = source.wireframeLinecap;
26707
26721
this.wireframeLinejoin = source.wireframeLinejoin;
26722
+ this.fog = source.fog;
26708
26723
return this;
26709
26724
}
26710
26725
@@ -26733,6 +26748,7 @@ class MeshMatcapMaterial extends Material {
26733
26748
this.displacementBias = 0;
26734
26749
this.alphaMap = null;
26735
26750
this.flatShading = false;
26751
+ this.fog = true;
26736
26752
this.setValues(parameters);
26737
26753
}
26738
26754
@@ -26754,6 +26770,7 @@ class MeshMatcapMaterial extends Material {
26754
26770
this.displacementBias = source.displacementBias;
26755
26771
this.alphaMap = source.alphaMap;
26756
26772
this.flatShading = source.flatShading;
26773
+ this.fog = source.fog;
26757
26774
return this;
26758
26775
}
26759
26776
0 commit comments