How to use the NoBlending function from three
Find comprehensive JavaScript three.NoBlending code examples handpicked from public code repositorys.
three.NoBlending is a constant value in the Three.js library that represents a blending operation that disables blending altogether.
14 15 16 17 18 19 20 21 22 23
morphTargets: true, depthTest: true, depthWrite: true, depthPacking: THREE.RGBADepthPacking, side: THREE.FrontSide, blending: THREE.NoBlending }); this.depthMaterial = new THREE.MeshDepthMaterial( { depthTest: true,
+ 3 other calls in file
749 750 751 752 753 754 755 756 757 758
} this.depthMaterial = new THREE.MeshDepthMaterial(); this.depthMaterial.depthPacking = THREE.RGBADepthPacking; this.depthMaterial.blending = THREE.NoBlending; this.normalMaterial = new THREE.MeshNormalMaterial(); this.normalMaterial.blending = THREE.NoBlending; if ( THREE.SAOShader === undefined ) {
+ 161 other calls in file
How does three.NoBlending work?
three.NoBlending is a constant that represents a special blending mode in the Three.js library which disables blending. In detail, blending in Three.js refers to the way transparent objects are rendered by combining the colors of overlapping pixels. The NoBlending mode is used when an object is fully opaque and its color should not be blended with the background or other objects behind it. This can be useful in cases where performance is a concern or when the desired effect is to completely replace the color of a specific part of the scene.
61 62 63 64 65 66 67 68 69 70
this.ssaoMaterial.uniforms['resolution'].value.set(this.width, this.height); this.ssaoMaterial.uniforms['cameraProjectionMatrix'].value.copy(this.camera.projectionMatrix); this.ssaoMaterial.uniforms['cameraInverseProjectionMatrix'].value.copy(this.camera.projectionMatrixInverse); // normal material this.normalMaterial = new three_1.MeshNormalMaterial(); this.normalMaterial.blending = three_1.NoBlending; // blur material this.blurMaterial = new three_1.ShaderMaterial({ defines: Object.assign({}, SSAOShader_2.SSAOBlurShader.defines), uniforms: three_1.UniformsUtils.clone(SSAOShader_2.SSAOBlurShader.uniforms),
+ 35 other calls in file
50 51 52 53 54 55 56 57 58 59
this.beautyRenderTarget.depthTexture = depthTexture; this.beautyRenderTarget.depthBuffer = true; } this.depthMaterial = new three_1.MeshDepthMaterial(); this.depthMaterial.depthPacking = three_1.RGBADepthPacking; this.depthMaterial.blending = three_1.NoBlending; this.normalMaterial = new three_1.MeshNormalMaterial(); this.normalMaterial.blending = three_1.NoBlending; if (SAOShader_1.SAOShader === undefined) { console.error('THREE.SAOPass relies on SAOShader');
+ 13 other calls in file
Ai Example
1 2 3 4 5 6 7 8 9 10
const material = new THREE.MeshBasicMaterial({ color: 0xffffff, opacity: 1, blending: THREE.NoBlending, // set blending to NoBlending }); const geometry = new THREE.BoxGeometry(1, 1, 1); const mesh = new THREE.Mesh(geometry, material); scene.add(mesh);
In this example, a new MeshBasicMaterial is created with a white color, an opacity of 1, and the blending property set to THREE.NoBlending. A BoxGeometry is also created, and a Mesh is constructed from the geometry and material. Finally, the mesh is added to the scene. This will render the mesh with no blending with the background, as the blending mode is set to NoBlending.
three.Vector3 is the most popular function in three (22341 examples)