How to use the Uniform function from three

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

46
47
48
49
50
51
52
53
54
55

function createGlassMaterial() {
  return new THREE.ShaderMaterial({
    uniforms: {
      iTime: { value: 0.0 },
      iResolution: new THREE.Uniform(new THREE.Vector2(100, 100)),
    },

    fragmentShader: glassFragmentShader,
    vertexShader: generalVertexShader,
fork icon9
star icon77
watch icon5

+ 17 other calls in file

31
32
33
34
35
36
37
38
39
40
vertexShader: glslify('./vert.glsl'),
fragmentShader: glslify('./cloud.frag.glsl'),
uniforms: {
  uResolution: new THREE.Uniform(new THREE.Vector2(app.engine.deviceWidth, app.engine.deviceHeight)),
  uTime: { type: "f", value: 0 },
  uMouse: new THREE.Uniform(new THREE.Vector2(0, 0)),
  uScale: { type: "f", value: 1.0 },
  uTextureOffset: new THREE.Uniform(new THREE.Vector2(0, 0)),
  uMorphAmount: { type: "f", value: 0.0 },
  // uRandomSeed: { type: "f", value: randomSeed },
fork icon1
star icon1
watch icon1

+ 377 other calls in file

56
57
58
59
60
61
62
63
64
65
uGrabCenter: new THREE.Uniform(new THREE.Vector3(0, 0, 0)),
uTarget: new THREE.Uniform(new THREE.Vector3(0, 0, 0)),
// uMousePosition: new THREE.Uniform(new THREE.Vector2(0, 0)),
uTime: { type: 'f', value: 0 },
uGrabStart: new THREE.Uniform(0.0),
uReleaseStart: new THREE.Uniform(0.0),
// uResolution: new THREE.Uniform(new THREE.Vector2(
//   app.renderer.domElement.clientWidth,
//   app.renderer.domElement.clientHeight
// )),
fork icon1
star icon1
watch icon0

+ 15 other calls in file

Other functions in three

Sorted by popularity

function icon

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