How to use the CustomBlending function from three

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

960
961
962
963
964
965
966
967
968
969
} // Blending depends on output, only want a THREE.CustomBlending when showing SAO


if ( this.params.output === 0 ) {

	outputMaterial.blending = THREE.CustomBlending;

} else {

	outputMaterial.blending = THREE.NoBlending;
fork icon3
star icon7
watch icon0

+ 33 other calls in file

822
823
824
825
826
827
828
829
830
831
	blending: THREE.NoBlending
} );
this.materialCopy.transparent = true;
this.materialCopy.depthTest = false;
this.materialCopy.depthWrite = false;
this.materialCopy.blending = THREE.CustomBlending;
this.materialCopy.blendSrc = THREE.DstColorFactor;
this.materialCopy.blendDst = THREE.ZeroFactor;
this.materialCopy.blendEquation = THREE.AddEquation;
this.materialCopy.blendSrcAlpha = THREE.DstAlphaFactor;
fork icon3
star icon7
watch icon0

+ 35 other calls in file

68
69
70
71
72
73
74
75
76
77
        NoBlending: THREE.NoBlending,
        NormalBlending: THREE.NormalBlending,
        AdditiveBlending: THREE.AdditiveBlending,
        SubtractiveBlending: THREE.SubtractiveBlending,
        MultiplyBlending: THREE.MultiplyBlending,
        CustomBlending: THREE.CustomBlending
};

var _color = new THREE.Color();
var _textureLoader = new THREE.TextureLoader();
fork icon3
star icon7
watch icon8

+ 7 other calls in file

162
163
164
165
166
167
168
169
170
171
case SSAOPass.OUTPUT.Default:
    this.copyMaterial.uniforms['tDiffuse'].value = this.beautyRenderTarget.texture;
    this.copyMaterial.blending = three_1.NoBlending;
    this.renderPass(renderer, this.copyMaterial, this.renderToScreen ? null : writeBuffer);
    this.copyMaterial.uniforms['tDiffuse'].value = this.blurRenderTarget.texture;
    this.copyMaterial.blending = three_1.CustomBlending;
    this.renderPass(renderer, this.copyMaterial, this.renderToScreen ? null : writeBuffer);
    break;
default:
    console.warn('THREE.SSAOPass: Unknown output type.');
fork icon1
star icon3
watch icon0

+ 5 other calls in file

431
432
433
434
435
436
437
438
439
440
const planeMat = new THREE.MeshBasicMaterial({
  color: 0x111213,
  transparent: true,
  opacity: 0.1
});
planeMat.blending = THREE.CustomBlending;
planeMat.blendSrc = THREE.OneFactor;
planeMat.blendDst = THREE.OneFactor;
planeMat.blendEquation = THREE.ReverseSubtractEquation;
const fadePlane = new THREE.Mesh(planeGeo, planeMat);
fork icon0
star icon8
watch icon0

150
151
152
153
154
155
156
157
158
159
  camera.top * 8
);
const fadeMaterial = new THREE.MeshBasicMaterial({
  color: fadeColor,
});
fadeMaterial.blending = THREE.CustomBlending;
fadeMaterial.blendSrc = THREE.OneFactor;
fadeMaterial.blendDst = THREE.OneFactor;
fadeMaterial.blendEquation = THREE.ReverseSubtractEquation;
const fadePlane = new THREE.Mesh(fadeGeometry, fadeMaterial);
fork icon0
star icon8
watch icon0

735
736
737
738
739
740
741
742
743
744
params.emissive = new three_1.Color().fromArray(material.ambient);
params.transparent = params.opacity !== 1.0;
//
params.fog = true;
// blend
params.blending = three_1.CustomBlending;
params.blendSrc = three_1.SrcAlphaFactor;
params.blendDst = three_1.OneMinusSrcAlphaFactor;
params.blendSrcAlpha = three_1.SrcAlphaFactor;
params.blendDstAlpha = three_1.DstAlphaFactor;
fork icon1
star icon3
watch icon0

+ 4 other calls in file

117
118
119
120
121
122
123
124
125
126
    blending: three_1.NoBlending,
});
this.materialCopy.transparent = true;
this.materialCopy.depthTest = false;
this.materialCopy.depthWrite = false;
this.materialCopy.blending = three_1.CustomBlending;
this.materialCopy.blendSrc = three_1.DstColorFactor;
this.materialCopy.blendDst = three_1.ZeroFactor;
this.materialCopy.blendEquation = three_1.AddEquation;
this.materialCopy.blendSrcAlpha = three_1.DstAlphaFactor;
fork icon1
star icon3
watch icon0

+ 3 other calls in file

562
563
564
565
566
567
568
569
570
571
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
mat.blendSrc = THREE.OneFactor
mat.blendDst = THREE.OneMinusSrcAlphaFactor

materials.push(mat)
fork icon0
star icon2
watch icon0

Other functions in three

Sorted by popularity

function icon

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