Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function render() {
gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
gl.enable(gl.DEPTH_TEST);
clear();
characterPos = [0, 0, 0];
shader.bind();
shader.uniforms.unitsPerEm = unitsPerEm;
shader.uniforms.model = mat4.identity(m4scratch);
shader.uniforms.projection = mat4.perspective(
m4scratch,
Math.PI/4,
gl.canvas.width/gl.canvas.height,
0.1,
1000.00
);
shader.uniforms.view = camera.view(m4scratch);
var now = Date.now();
letters.forEach(function(letter) {
letter.geometry.bind(shader);
shader.uniforms.characterPos = characterPos;
shader.uniforms.time = now - start;
letter.geometry.draw(gl.TRIANGLES);