How to use the NearestFilter function from three

Find comprehensive JavaScript three.NearestFilter code examples handpicked from public code repositorys.

144
145
146
147
148
149
150
151
152
153
    positions[i4 + 1] = r * Math.sin(phi);
    positions[i4 + 2] = r * Math.sin(theta) * Math.cos(phi);
    positions[i4 + 3] = 0.002 + Math.random() * 0.998;
}
var texture = new THREE.DataTexture( positions, TEXTURE_WIDTH, TEXTURE_HEIGHT, THREE.RGBAFormat, THREE.FloatType );
texture.minFilter = THREE.NearestFilter;
texture.magFilter = THREE.NearestFilter;
texture.needsUpdate = true;
texture.generateMipmaps = false;
texture.flipY = false;
fork icon34
star icon217
watch icon8

+ 27 other calls in file

53
54
55
56
57
58
59
60
61
62
    THREE.FloatType, 
    THREE.UVMapping,
    THREE.ClampToEdgeWrapping,
    THREE.ClampToEdgeWrapping,
    THREE.NearestFilter,
    THREE.NearestFilter
);
_initPosTexture.needsUpdate = true;

// // image is not deep copied, ? will it get flushed?
fork icon5
star icon23
watch icon3

+ 19 other calls in file

733
734
735
736
737
738
739
740
741
this.saoRenderTarget = new THREE.WebGLRenderTarget( this.resolution.x, this.resolution.y );
this.blurIntermediateRenderTarget = this.saoRenderTarget.clone();
this.beautyRenderTarget = this.saoRenderTarget.clone();
this.normalRenderTarget = new THREE.WebGLRenderTarget( this.resolution.x, this.resolution.y, {
	minFilter: THREE.NearestFilter,
	magFilter: THREE.NearestFilter
} );
this.depthRenderTarget = this.normalRenderTarget.clone();
let depthTexture;
fork icon3
star icon7
watch icon0

+ 35 other calls in file

76
77
78
79
80
81
82
83
84
85
  this.analyser = createAnalyser(this.audio.node, this.audio.context, {
    stereo: false
  })

  this.textureData = new THREE.DataTexture(this.data, size, size, THREE.RGBFormat, THREE.FloatType);
  this.textureData.minFilter = this.textureData.magFilter = THREE.NearestFilter;
}
addObjects(width,height) {
  this.sceneRt = new THREE.Scene();
  this.cameraRt = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
fork icon3
star icon6
watch icon1

80
81
82
83
84
85
86
87
88
89
  this.dataPos, width, height, THREE.RGBAFormat, THREE.FloatType);

this.textureDataInfos = new THREE.DataTexture(
  this.datatInfos, width, height, THREE.RGBAFormat, THREE.FloatType);

this.textureDataPos.minFilter = THREE.NearestFilter;
this.textureDataPos.magFilter = THREE.NearestFilter;
this.textureDataPos.needsUpdate = true;

this.textureDataInfos.minFilter = THREE.NearestFilter;
fork icon2
star icon0
watch icon1

+ 7 other calls in file

67
68
69
70
71
72
73
74
75
this.textureDataPos.needsUpdate = true;

this.textureDataVel = new THREE.DataTexture(
  this.dataVel, width, height, THREE.RGBAFormat, THREE.FloatType);

this.textureDataVel.minFilter = THREE.NearestFilter;
this.textureDataVel.magFilter = THREE.NearestFilter;
this.textureDataVel.needsUpdate = true;

fork icon0
star icon4
watch icon0

+ 7 other calls in file

24
25
26
27
28
29
30
31
32
33
}
getDefaultTexture() {
    if (this.defaultTexture === null) {
        const texture = new three_1.Texture();
        texture.minFilter = three_1.NearestFilter;
        texture.magFilter = three_1.NearestFilter;
        this._uploadTexture(texture);
        this.defaultTexture = this.getTextureGPU(texture);
    }
    return this.defaultTexture;
fork icon1
star icon3
watch icon0

+ 23 other calls in file

558
559
560
561
562
563
564
565
566
567
var texture = loader.load(image)

// sharp pixels and smooth edges
texture.anisotropy = 0
texture.magFilter = THREE.NearestFilter
texture.minFilter = THREE.NearestFilter

// map texture to material, keep transparency and fix transparent z-fighting
var mat = new THREE.MeshLambertMaterial({map: texture, transparent: true, alphaTest: 0.5})
mat.blending = THREE.CustomBlending
fork icon0
star icon2
watch icon0

+ 3 other calls in file

250
251
252
253
254
255
256
257
258
geometry.addAttribute("uv", new THREE.BufferAttribute(
  new Float32Array(textureCoords), 2 ));
geometry.computeBoundingSphere();

var videoTexture = new THREE.VideoTexture(video);
videoTexture.minFilter = THREE.NearestFilter;
videoTexture.magFilter = THREE.NearestFilter;
videoTexture.format = THREE.RGBFormat;
videoTexture.flipY = false;
fork icon0
star icon2
watch icon0

510
511
512
513
514
515
516
517
518

XYZRenderer.prototype.resize = function(width, height) {
	this.off = new THREE.WebGLRenderTarget(width/this.downBy, height/this.downBy, { 
		stencilBuffer: false,
		magFilter: THREE.NearestFilter,
		minFilter: THREE.NearestFilter
	});

	this.off.generateMipmaps = false;
fork icon0
star icon1
watch icon0

+ 2 other calls in file

8
9
10
11
12
13
14
15
16
17
    [ 255, 255, 255, 255
    , 255, 255, 255, 255
    , 255, 255, 255, 255
    , 255, 255, 255, 255])
this.texture = new THREE.DataTexture(this.denseData, 4, 4, THREE.LuminanceFormat, THREE.UnsignedByteType)
this.texture.magFilter = THREE.NearestFilter;
this.texture.needsUpdate = true;

this.composer = new EffectComposer(renderer);
this.shaderPass = new EffectComposer.ShaderPass({
fork icon0
star icon1
watch icon0

83
84
85
86
87
88
89
90
91
92
    }
}

this.geometryRT = new THREE.DataTexture( this.data, this.sizeW, this.sizeH, THREE.RGBAFormat, THREE.FloatType);
this.geometryRT.minFilter = THREE.NearestFilter;
this.geometryRT.magFilter = THREE.NearestFilter;
this.geometryRT.needsUpdate = true;


this.index2D            = new THREE.BufferAttribute( new Float32Array( this.total * 2 ), 2 );
fork icon0
star icon1
watch icon6

+ 3 other calls in file

102
103
104
105
106
107
108
109
110
mask.format = THREE.RedFormat;
mask.type = THREE.UnsignedByteType;

mask.generateMipmaps = false;
mask.minFilter = THREE.NearestFilter;
mask.magFilter = THREE.NearestFilter;
mask.wrapS = THREE.ClampToEdgeWrapping;
mask.wrapT = THREE.ClampToEdgeWrapping;
mask.needsUpdate = true;
fork icon115
star icon803
watch icon0

+ 7 other calls in file

798
799
800
801
802
803
804
805
806
807
    }
    const texture = new three.Texture(image);
    texture.generateMipmaps = false;
    texture.format = three.RGBAFormat;
    texture.magFilter = three.NearestFilter;
    texture.minFilter = three.NearestFilter;
    texture.needsUpdate = true;
    this.material.userData.heightMap.value = texture;
}
catch (e) {
fork icon75
star icon468
watch icon0

+ 7 other calls in file

901
902
903
904
905
906
907
908
909
910
// but Three.js gradient map is Axis-X oriented.
// So here replaces the toon texture image with the rotated one.
if (params.isToonTexture === true) {
    t.image = scope._getRotatedImage(t.image);
    t.magFilter = three_1.NearestFilter;
    t.minFilter = three_1.NearestFilter;
}
t.flipY = false;
t.wrapS = three_1.RepeatWrapping;
t.wrapT = three_1.RepeatWrapping;
fork icon1
star icon3
watch icon0

+ 9 other calls in file

68
69
70
71
72
73
74
75
76
this.height = viewerDiv.clientHeight;
this.positionBuffer = null;
this._nextThreejsLayer = 1;
this.fullSizeRenderTarget = new THREE.WebGLRenderTarget(this.width, this.height);
this.fullSizeRenderTarget.texture.minFilter = THREE.LinearFilter;
this.fullSizeRenderTarget.texture.magFilter = THREE.NearestFilter;
this.fullSizeRenderTarget.depthBuffer = true;
this.fullSizeRenderTarget.depthTexture = new THREE.DepthTexture();
this.fullSizeRenderTarget.depthTexture.type = THREE.UnsignedShortType;
fork icon0
star icon1
watch icon0

52
53
54
55
56
57
58
59
60
61
var texLoader = new THREE.TextureLoader(loadingManager);
var objLoader = new THREE.OBJLoader(loadingManager);

letterProperties.forEach(function(letterProp, i) {
	texLoader.load(letterProp.tex, function(tex) {
		tex.magFilter = THREE.NearestFilter;
		tex.minFilter = THREE.NearestFilter;
		var name = tex.image.getAttribute('src');
		letterMaterials[name] = new THREE.MeshBasicMaterial({map: tex, transparent: true});
	});
fork icon0
star icon0
watch icon0

19
20
21
22
23
24
25
26
27

// textures

var tempMap = new THREE.DataTexture(new Uint8Array(16 * 16 * 3), 16, 16, THREE.RGBFormat);
tempMap.minFilter = THREE.NearestFilter;
tempMap.magFilter = THREE.NearestFilter;
tempMap.wrapS = THREE.ClampToEdgeWrapping;
tempMap.wrapT = THREE.ClampToEdgeWrapping;
tempMap.needsUpdate = true;
fork icon0
star icon0
watch icon0

+ 3 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)