Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
[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();
});
_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);
}
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,
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