How to use the luma.gl.setParameters function in luma

To help you get started, we’ve selected a few luma examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber / luma.gl / test / webgl / context-state.spec.js View on Github external
[GL.STENCIL_VALUE_MASK]: 0xBBBBBBBB,
    [GL.STENCIL_BACK_FUNC]: GL.LEQUAL,
    [GL.STENCIL_BACK_REF]: 0.5,
    [GL.STENCIL_BACK_VALUE_MASK]: 0xBBBBBBBB,
    // stencilOp
    [GL.STENCIL_FAIL]: GL.REPLACE,
    [GL.STENCIL_PASS_DEPTH_FAIL]: GL.INCR,
    [GL.STENCIL_PASS_DEPTH_PASS]: GL.DECR,
    [GL.STENCIL_BACK_FAIL]: GL.REPLACE,
    [GL.STENCIL_BACK_PASS_DEPTH_FAIL]: GL.INCR,
    [GL.STENCIL_BACK_PASS_DEPTH_PASS]: GL.DECR
  };

  resetParameters(gl);

  setParameters(gl, parameters);

  for (const key in expectedValues) {
    const value = getParameter(gl, key);
    t.deepEqual(value, expectedValues[key],
      `got expected value ${stringifyTypedArray(value)} for key: ${getKey(GL, key)}`);
  }
  t.end();
});
github uber / deck.gl / src / react / webgl-renderer.js View on Github external
_renderFrame() {
    const {width, height, useDevicePixelRatio} = this.props;
    const {gl} = this;

    // Check for reasons not to draw
    if (!gl || !(width > 0) || !(height > 0)) {
      return;
    }

    this._resizeDrawingBuffer(gl.canvas, {useDevicePixelRatio});

    // Updates WebGL viewport to latest props
    setParameters(gl, {
      viewport: [0, 0, gl.canvas.width, gl.canvas.height]
    });

    // Call render callback
    this.props.onRenderFrame({gl});

    this.props.onAfterRender(this.refs.overlay);

  }
github uber / deck.gl / showcases / wind / src / layers / particle-layer / particle-layer.js View on Github external
bounds1: [dataBounds[1].min, dataBounds[1].max],
      bounds2: [dataBounds[2].min, dataBounds[2].max],
      color0: [83, 185, 148].map(d => d / 255),
      color1: [255, 255, 174].map(d => d / 255),
      color2: [241, 85, 46].map(d => d / 255),
      dataFrom: textureFrom,
      dataTo: textureTo,
      elevationTexture,
      elevationBounds: ELEVATION_DATA_BOUNDS,
      elevationRange: ELEVATION_RANGE,
      zScale: props.zScale,
      delta,
      pixelRatio: window.devicePixelRatio || 1
    };

    setParameters(gl, {
      blend: true,
      blendFunc: [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA],
      depthTest: true,
      depthFunc: gl.LEQUAL
    });
    const pixelStoreParameters = {
      [GL.UNPACK_FLIP_Y_WEBGL]: true
    };

    textureFrom.setImageData({
      pixels: textureArray[timeInterval],
      width,
      height,
      format: gl.RGBA32F,
      type: gl.FLOAT,
      dataFormat: gl.RGBA,
github rolyatmax / sketches / sketches / 2019.02.06-10.39.57.js View on Github external
setup = function setup () {
    luma.setParameters(gl, {
      clearColor: [1, 1, 1, 1],
      clearDepth: 1,
      depthTest: true,
      depthFunc: gl.LEQUAL
    })

    rand = random.createRandom(settings.seed)
    noiseSpring = createSpring(settings.dampening, settings.stiffness, 0)
    hueSpreadSpring = createSpring(settings.dampening, settings.stiffness, 0)
    hueStartSpring = createSpring(settings.dampening, settings.stiffness, 0)
    sizeSpring = createSpring(settings.dampening, settings.stiffness, 1)
    const offset1 = rand.insideSphere(500)
    const points = new Array(settings.pointCount).fill(null).map(() => {
      const position = rand.insideSphere()
      const [x, y, z] = position
      const phi = (rand.noise3D(x, y, z, settings.freq) + 1) * Math.PI

luma

A library for creating unified, beautiful shadows.

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis