How to use the UniformsLib function from three
Find comprehensive JavaScript three.UniformsLib code examples handpicked from public code repositorys.
24 25 26 27 28 29 30 31 32
}; lineShaders = { uniforms: THREE.UniformsUtils.merge( [ THREE.UniformsLib.common, THREE.UniformsLib.fog, lineUniforms ] ),
+ 23 other calls in file
GitHub: edankwan/The-Spirit
![edankwan profile picture](/edankwan.png?size=40)
54 55 56 57 58 59 60 61 62 63
var geometry = new THREE.BufferGeometry(); geometry.addAttribute( 'position', new THREE.BufferAttribute( position, 3 )); var material = new THREE.ShaderMaterial({ uniforms: THREE.UniformsUtils.merge([ THREE.UniformsLib.shadowmap, { texturePosition: { type: 't', value: undef }, color1: { type: 'c', value: undef }, color2: { type: 'c', value: undef }
+ 3 other calls in file
GitHub: K3D-tools/K3D-jupyter
135 136 137 138 139 140 141 142 143 144
}; const material = new THREE.ShaderMaterial({ uniforms: _.merge( uniforms, THREE.UniformsLib.lights, ), defines: { USE_SPECULAR: 1, USE_MASK: (maskEnabled ? 1 : 0),
84 85 86 87 88 89 90 91 92 93
} const material = new THREE.ShaderMaterial({ uniforms: THREE.UniformsUtils.merge([ THREE.UniformsLib.lights, THREE.UniformsLib.points, uniforms, ]), defines: { USE_SPECULAR: (shader === '3dSpecular' ? 1 : 0),
+ 3 other calls in file
491 492 493 494 495 496 497 498 499 500
class MeshLineMaterial extends THREE.ShaderMaterial { constructor(parameters) { super({ uniforms: Object.assign({}, THREE.UniformsLib.fog, { lineWidth: { value: 1 }, map: { value: null }, useMap: { value: 0 }, alphaMap: { value: null },
230 231 232 233 234 235 236 237 238 239
if (this._simulation.isUsingLightSources()) { // TODO(ian): Follow recommendation for defining ShaderMaterials here: // https://discourse.threejs.org/t/cant-get-a-sampler2d-uniform-to-work-from-datatexture/6366/14?u=ianw var uniforms = THREE.UniformsUtils.merge([ // TODO(ian): These failed due to type check. Remove? // THREE.UniformsLib.ambient, THREE.UniformsLib.lights, // THREE.UniformsLib.shadowmap, { ringTexture: { value: null },
+ 38 other calls in file
three.Vector3 is the most popular function in three (22341 examples)