Skip to content

Commit d014875

Browse files
committed
Set better defaults for DataTexture
1 parent 740b0ae commit d014875

5 files changed

Lines changed: 15 additions & 9 deletions

File tree

examples/js/Ocean.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,6 @@ THREE.Ocean.prototype.generateSeedPhaseTexture = function() {
248248
}
249249

250250
this.pingPhaseTexture = new THREE.DataTexture( phaseArray, this.resolution, this.resolution, THREE.RGBAFormat );
251-
this.pingPhaseTexture.minFilter = THREE.NearestFilter;
252-
this.pingPhaseTexture.magFilter = THREE.NearestFilter;
253251
this.pingPhaseTexture.wrapS = THREE.ClampToEdgeWrapping;
254252
this.pingPhaseTexture.wrapT = THREE.ClampToEdgeWrapping;
255253
this.pingPhaseTexture.type = THREE.FloatType;

examples/js/SimulationRenderer.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ function SimulationRenderer( WIDTH, renderer ) {
206206
texture.minFilter = THREE.NearestFilter;
207207
texture.magFilter = THREE.NearestFilter;
208208
texture.needsUpdate = true;
209-
texture.flipY = false;
210209

211210
return texture;
212211

@@ -232,7 +231,6 @@ function SimulationRenderer( WIDTH, renderer ) {
232231
texture.minFilter = THREE.NearestFilter;
233232
texture.magFilter = THREE.NearestFilter;
234233
texture.needsUpdate = true;
235-
texture.flipY = false;
236234

237235
return texture;
238236

examples/js/postprocessing/GlitchPass.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ THREE.GlitchPass.prototype = {
113113
texture.minFilter = THREE.NearestFilter;
114114
texture.magFilter = THREE.NearestFilter;
115115
texture.needsUpdate = true;
116-
texture.flipY = false;
117116
return texture;
118117

119118
}

src/objects/Skeleton.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ THREE.Skeleton = function ( bones, boneInverses, useVertexTexture ) {
3838

3939
this.boneMatrices = new Float32Array( this.boneTextureWidth * this.boneTextureHeight * 4 ); // 4 floats per RGBA pixel
4040
this.boneTexture = new THREE.DataTexture( this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, THREE.RGBAFormat, THREE.FloatType );
41-
this.boneTexture.minFilter = THREE.NearestFilter;
42-
this.boneTexture.magFilter = THREE.NearestFilter;
43-
this.boneTexture.generateMipmaps = false;
44-
this.boneTexture.flipY = false;
4541

4642
} else {
4743

src/textures/DataTexture.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,25 @@
33
*/
44

55
THREE.DataTexture = function ( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy ) {
6+
7+
if ( magFilter === undefined ) {
8+
9+
magFilter = THREE.NearestFilter;
10+
11+
}
12+
13+
if ( minFilter === undefined ) {
14+
15+
minFilter = THREE.NearestFilter;
16+
17+
}
618

719
THREE.Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
820

921
this.image = { data: data, width: width, height: height };
22+
23+
this.flipY = false;
24+
this.generateMipmaps = false;
1025

1126
};
1227

0 commit comments

Comments
 (0)