浏览代码

Merge pull request #7063 from gero3/DataTextureDefaults

change Data texture defaults
Mr.doob 10 年之前
父节点
当前提交
1f95ab2889

+ 0 - 2
examples/js/Ocean.js

@@ -248,8 +248,6 @@ THREE.Ocean.prototype.generateSeedPhaseTexture = function() {
 	}
 	}
 
 
 	this.pingPhaseTexture = new THREE.DataTexture( phaseArray, this.resolution, this.resolution, THREE.RGBAFormat );
 	this.pingPhaseTexture = new THREE.DataTexture( phaseArray, this.resolution, this.resolution, THREE.RGBAFormat );
-	this.pingPhaseTexture.minFilter = THREE.NearestFilter;
-	this.pingPhaseTexture.magFilter = THREE.NearestFilter;
 	this.pingPhaseTexture.wrapS = THREE.ClampToEdgeWrapping;
 	this.pingPhaseTexture.wrapS = THREE.ClampToEdgeWrapping;
 	this.pingPhaseTexture.wrapT = THREE.ClampToEdgeWrapping;
 	this.pingPhaseTexture.wrapT = THREE.ClampToEdgeWrapping;
 	this.pingPhaseTexture.type = THREE.FloatType;
 	this.pingPhaseTexture.type = THREE.FloatType;

+ 0 - 6
examples/js/SimulationRenderer.js

@@ -203,10 +203,7 @@ function SimulationRenderer( WIDTH, renderer ) {
 		}
 		}
 
 
 		var texture = new THREE.DataTexture( a, WIDTH, WIDTH, THREE.RGBAFormat, THREE.FloatType );
 		var texture = new THREE.DataTexture( a, WIDTH, WIDTH, THREE.RGBAFormat, THREE.FloatType );
-		texture.minFilter = THREE.NearestFilter;
-		texture.magFilter = THREE.NearestFilter;
 		texture.needsUpdate = true;
 		texture.needsUpdate = true;
-		texture.flipY = false;
 
 
 		return texture;
 		return texture;
 
 
@@ -229,10 +226,7 @@ function SimulationRenderer( WIDTH, renderer ) {
 		}
 		}
 
 
 		var texture = new THREE.DataTexture( a, WIDTH, WIDTH, THREE.RGBFormat, THREE.FloatType );
 		var texture = new THREE.DataTexture( a, WIDTH, WIDTH, THREE.RGBFormat, THREE.FloatType );
-		texture.minFilter = THREE.NearestFilter;
-		texture.magFilter = THREE.NearestFilter;
 		texture.needsUpdate = true;
 		texture.needsUpdate = true;
-		texture.flipY = false;
 
 
 		return texture;
 		return texture;
 
 

+ 0 - 3
examples/js/postprocessing/GlitchPass.js

@@ -110,10 +110,7 @@ THREE.GlitchPass.prototype = {
 		var texture = new THREE.DataTexture( data_arr, dt_size, dt_size, THREE.RGBFormat, THREE.FloatType );
 		var texture = new THREE.DataTexture( data_arr, dt_size, dt_size, THREE.RGBFormat, THREE.FloatType );
 		console.log( texture );
 		console.log( texture );
 		console.log( dt_size );
 		console.log( dt_size );
-		texture.minFilter = THREE.NearestFilter;
-		texture.magFilter = THREE.NearestFilter;
 		texture.needsUpdate = true;
 		texture.needsUpdate = true;
-		texture.flipY = false;
 		return texture;
 		return texture;
 
 
 	}
 	}

+ 0 - 4
src/objects/Skeleton.js

@@ -38,10 +38,6 @@ THREE.Skeleton = function ( bones, boneInverses, useVertexTexture ) {
 
 
 		this.boneMatrices = new Float32Array( this.boneTextureWidth * this.boneTextureHeight * 4 ); // 4 floats per RGBA pixel
 		this.boneMatrices = new Float32Array( this.boneTextureWidth * this.boneTextureHeight * 4 ); // 4 floats per RGBA pixel
 		this.boneTexture = new THREE.DataTexture( this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, THREE.RGBAFormat, THREE.FloatType );
 		this.boneTexture = new THREE.DataTexture( this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, THREE.RGBAFormat, THREE.FloatType );
-		this.boneTexture.minFilter = THREE.NearestFilter;
-		this.boneTexture.magFilter = THREE.NearestFilter;
-		this.boneTexture.generateMipmaps = false;
-		this.boneTexture.flipY = false;
 
 
 	} else {
 	} else {
 
 

+ 15 - 0
src/textures/DataTexture.js

@@ -3,10 +3,25 @@
  */
  */
 
 
 THREE.DataTexture = function ( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy ) {
 THREE.DataTexture = function ( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy ) {
+	
+	if ( magFilter === undefined ) {
+		
+		magFilter = THREE.NearestFilter;
+		
+	}
+	
+	if ( minFilter === undefined ) {
+		
+		minFilter = THREE.NearestFilter;
+		
+	}
 
 
 	THREE.Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
 	THREE.Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
 
 
 	this.image = { data: data, width: width, height: height };
 	this.image = { data: data, width: width, height: height };
+	
+	this.flipY = false;
+	this.generateMipmaps  = false;
 
 
 };
 };