How to use the OneFactor function from three

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

433
434
435
436
437
438
439
440
441
  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);
scene.add(fadePlane);
fork icon0
star icon8
watch icon0

152
153
154
155
156
157
158
159
160
161
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);
scene.add(fadePlane);
this.fadePlane = fadePlane;
fork icon0
star icon8
watch icon0

563
564
565
566
567
568
569
570
571
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

1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
  materialParams.blendSrc = WEBGL_BLEND_FUNCS[blendFuncSeparate[0]];
  materialParams.blendDst = WEBGL_BLEND_FUNCS[blendFuncSeparate[1]];
  materialParams.blendSrcAlpha = WEBGL_BLEND_FUNCS[blendFuncSeparate[2]];
  materialParams.blendDstAlpha = WEBGL_BLEND_FUNCS[blendFuncSeparate[3]];
} else {
  materialParams.blendSrc = THREE.OneFactor;
  materialParams.blendDst = THREE.ZeroFactor;
  materialParams.blendSrcAlpha = THREE.OneFactor;
  materialParams.blendDstAlpha = THREE.ZeroFactor;
}
fork icon0
star icon1
watch icon0

+ 19 other calls in file

Other functions in three

Sorted by popularity

function icon

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