Browse Source

Materials: Promoted fog.

Mr.doob 9 years ago
parent
commit
7992d5c41a

+ 0 - 5
src/materials/LineBasicMaterial.js

@@ -11,8 +11,6 @@
  *  linejoin: "round",
  *
  *  vertexColors: <bool>
- *
- *  fog: <bool>
  * }
  */
 
@@ -30,7 +28,6 @@ THREE.LineBasicMaterial = function ( parameters ) {
 
 	this.vertexColors = THREE.NoColors;
 
-	this.fog = true;
 
 	this.setValues( parameters );
 
@@ -51,8 +48,6 @@ THREE.LineBasicMaterial.prototype.copy = function ( source ) {
 
 	this.vertexColors = source.vertexColors;
 
-	this.fog = source.fog;
-
 	return this;
 
 };

+ 0 - 6
src/materials/LineDashedMaterial.js

@@ -12,8 +12,6 @@
  *  gapSize: <float>,
  *
  *  vertexColors: THREE.NoColors / THREE.FaceColors / THREE.VertexColors
- *
- *  fog: <bool>
  * }
  */
 
@@ -33,8 +31,6 @@ THREE.LineDashedMaterial = function ( parameters ) {
 
 	this.vertexColors = THREE.NoColors;
 
-	this.fog = true;
-
 	this.setValues( parameters );
 
 };
@@ -56,8 +52,6 @@ THREE.LineDashedMaterial.prototype.copy = function ( source ) {
 
 	this.vertexColors = source.vertexColors;
 
-	this.fog = source.fog;
-
 	return this;
 
 };

+ 2 - 0
src/materials/Material.js

@@ -12,6 +12,7 @@ THREE.Material = function () {
 	this.name = '';
 	this.type = 'Material';
 
+	this.fog = true;
 	this.side = THREE.FrontSide;
 
 	this.opacity = 1;
@@ -246,6 +247,7 @@ THREE.Material.prototype = {
 
 		this.name = source.name;
 
+		this.fog = source.fog;
 		this.side = source.side;
 
 		this.opacity = source.opacity;

+ 1 - 7
src/materials/MeshBasicMaterial.js

@@ -29,9 +29,7 @@
  *  vertexColors: THREE.NoColors / THREE.VertexColors / THREE.FaceColors,
  *
  *  skinning: <bool>,
- *  morphTargets: <bool>,
- *
- *  fog: <bool>
+ *  morphTargets: <bool>
  * }
  */
 
@@ -57,8 +55,6 @@ THREE.MeshBasicMaterial = function ( parameters ) {
 	this.reflectivity = 1;
 	this.refractionRatio = 0.98;
 
-	this.fog = true;
-
 	this.shading = THREE.SmoothShading;
 
 	this.wireframe = false;
@@ -98,8 +94,6 @@ THREE.MeshBasicMaterial.prototype.copy = function ( source ) {
 	this.reflectivity = source.reflectivity;
 	this.refractionRatio = source.refractionRatio;
 
-	this.fog = source.fog;
-
 	this.shading = source.shading;
 
 	this.wireframe = source.wireframe;

+ 2 - 0
src/materials/MeshDepthMaterial.js

@@ -43,6 +43,8 @@ THREE.MeshDepthMaterial = function ( parameters ) {
 	this.wireframe = false;
 	this.wireframeLinewidth = 1;
 
+	this.fog = false;
+
 	this.setValues( parameters );
 
 };

+ 1 - 7
src/materials/MeshLambertMaterial.js

@@ -34,9 +34,7 @@
  *
  *  skinning: <bool>,
  *  morphTargets: <bool>,
- *  morphNormals: <bool>,
- *
- *	fog: <bool>
+ *  morphNormals: <bool>
  * }
  */
 
@@ -69,8 +67,6 @@ THREE.MeshLambertMaterial = function ( parameters ) {
 	this.reflectivity = 1;
 	this.refractionRatio = 0.98;
 
-	this.fog = true;
-
 	this.wireframe = false;
 	this.wireframeLinewidth = 1;
 	this.wireframeLinecap = 'round';
@@ -116,8 +112,6 @@ THREE.MeshLambertMaterial.prototype.copy = function ( source ) {
 	this.reflectivity = source.reflectivity;
 	this.refractionRatio = source.refractionRatio;
 
-	this.fog = source.fog;
-
 	this.wireframe = source.wireframe;
 	this.wireframeLinewidth = source.wireframeLinewidth;
 	this.wireframeLinecap = source.wireframeLinecap;

+ 1 - 0
src/materials/MeshNormalMaterial.js

@@ -18,6 +18,7 @@ THREE.MeshNormalMaterial = function ( parameters ) {
 	this.wireframe = false;
 	this.wireframeLinewidth = 1;
 
+	this.fog = false;
 	this.morphTargets = false;
 
 	this.setValues( parameters );

+ 1 - 7
src/materials/MeshPhongMaterial.js

@@ -48,9 +48,7 @@
  *
  *  skinning: <bool>,
  *  morphTargets: <bool>,
- *  morphNormals: <bool>,
- *
- *	fog: <bool>
+ *  morphNormals: <bool>
  * }
  */
 
@@ -95,8 +93,6 @@ THREE.MeshPhongMaterial = function ( parameters ) {
 	this.reflectivity = 1;
 	this.refractionRatio = 0.98;
 
-	this.fog = true;
-
 	this.shading = THREE.SmoothShading;
 
 	this.wireframe = false;
@@ -156,8 +152,6 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) {
 	this.reflectivity = source.reflectivity;
 	this.refractionRatio = source.refractionRatio;
 
-	this.fog = source.fog;
-
 	this.shading = source.shading;
 
 	this.wireframe = source.wireframe;

+ 1 - 7
src/materials/MeshStandardMaterial.js

@@ -49,9 +49,7 @@
  *
  *  skinning: <bool>,
  *  morphTargets: <bool>,
- *  morphNormals: <bool>,
- *
- *	fog: <bool>
+ *  morphNormals: <bool>
  * }
  */
 
@@ -100,8 +98,6 @@ THREE.MeshStandardMaterial = function ( parameters ) {
 
 	this.refractionRatio = 0.98;
 
-	this.fog = true;
-
 	this.shading = THREE.SmoothShading;
 
 	this.wireframe = false;
@@ -165,8 +161,6 @@ THREE.MeshStandardMaterial.prototype.copy = function ( source ) {
 
 	this.refractionRatio = source.refractionRatio;
 
-	this.fog = source.fog;
-
 	this.shading = source.shading;
 
 	this.wireframe = source.wireframe;

+ 1 - 7
src/materials/PointsMaterial.js

@@ -10,9 +10,7 @@
  *  size: <float>,
  *  sizeAttenuation: <bool>,
  *
- *  vertexColors: <bool>,
- *
- *  fog: <bool>
+ *  vertexColors: <bool>
  * }
  */
 
@@ -31,8 +29,6 @@ THREE.PointsMaterial = function ( parameters ) {
 
 	this.vertexColors = THREE.NoColors;
 
-	this.fog = true;
-
 	this.setValues( parameters );
 
 };
@@ -53,8 +49,6 @@ THREE.PointsMaterial.prototype.copy = function ( source ) {
 
 	this.vertexColors = source.vertexColors;
 
-	this.fog = source.fog;
-
 	return this;
 
 };

+ 1 - 6
src/materials/ShaderMaterial.js

@@ -19,9 +19,7 @@
  *
  *  skinning: <bool>,
  *  morphTargets: <bool>,
- *  morphNormals: <bool>,
- *
- *	fog: <bool>
+ *  morphNormals: <bool>
  * }
  */
 
@@ -45,7 +43,6 @@ THREE.ShaderMaterial = function ( parameters ) {
 	this.wireframeLinewidth = 1;
 
 	this.fog = false; // set to use scene fog
-
 	this.lights = false; // set to use scene lights
 	this.clipping = false; // set to use user-defined clipping planes
 
@@ -106,8 +103,6 @@ THREE.ShaderMaterial.prototype.copy = function ( source ) {
 	this.wireframe = source.wireframe;
 	this.wireframeLinewidth = source.wireframeLinewidth;
 
-	this.fog = source.fog;
-
 	this.lights = source.lights;
 	this.clipping = source.clipping;
 

+ 1 - 7
src/materials/SpriteMaterial.js

@@ -7,9 +7,7 @@
  *  map: new THREE.Texture( <Image> ),
  *
  *	uvOffset: new THREE.Vector2(),
- *	uvScale: new THREE.Vector2(),
- *
- *  fog: <bool>
+ *	uvScale: new THREE.Vector2()
  * }
  */
 
@@ -26,8 +24,6 @@ THREE.SpriteMaterial = function ( parameters ) {
 
 	this.fog = false;
 
-	// set parameters
-
 	this.setValues( parameters );
 
 };
@@ -44,8 +40,6 @@ THREE.SpriteMaterial.prototype.copy = function ( source ) {
 
 	this.rotation = source.rotation;
 
-	this.fog = source.fog;
-
 	return this;
 
 };