How to use the NearestFilter function from three
Find comprehensive JavaScript three.NearestFilter code examples handpicked from public code repositorys.
GitHub: edankwan/hyper-mix
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;
34
217
8
+ 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?
5
23
3
+ 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;
3
7
0
+ 35 other calls in file
GitHub: JordanMachado/fluctus
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 );
3
6
1
GitHub: piscis/xmas2016
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;
2
0
1
+ 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;
0
4
0
+ 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;
1
3
0
+ 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
0
2
0
+ 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;
0
2
0
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;
0
1
0
+ 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({
0
1
0
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 );
0
1
6
+ 3 other calls in file
GitHub: K3D-tools/K3D-jupyter
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;
115
803
0
+ 7 other calls in file
GitHub: tentone/geo-three
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) {
75
468
0
+ 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;
1
3
0
+ 9 other calls in file
GitHub: VeinKowal/veins
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;
0
1
0
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}); });
0
0
0
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;
0
0
0
+ 3 other calls in file
three.Vector3 is the most popular function in three (22341 examples)