From 1b54482c5e3e0a923a622fd4e696337615265cd5 Mon Sep 17 00:00:00 2001 From: Karim Naaji Date: Fri, 27 Jan 2023 17:11:30 -0800 Subject: [PATCH] Remove the need for split shader --- debug/satellites-custom-layer.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/debug/satellites-custom-layer.js b/debug/satellites-custom-layer.js index 3bf8f024e2e..9c5f20cff72 100644 --- a/debug/satellites-custom-layer.js +++ b/debug/satellites-custom-layer.js @@ -52,13 +52,11 @@ function createProgram(gl, vert, frag) { }; function updateVboAndActivateAttrib(gl, prog, vbo, data, attribName) { + gl.bindBuffer(gl.ARRAY_BUFFER, vbo); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.DYNAMIC_DRAW); const attribLoc = gl.getAttribLocation(prog, attribName); - if (attribLoc !== -1) { - gl.bindBuffer(gl.ARRAY_BUFFER, vbo); - gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.DYNAMIC_DRAW); - gl.vertexAttribPointer(attribLoc, 3, gl.FLOAT, false, 0, 0); - gl.enableVertexAttribArray(attribLoc); - } + gl.vertexAttribPointer(attribLoc, 3, gl.FLOAT, false, 0, 0); + gl.enableVertexAttribArray(attribLoc); } const satellitesLayer = {