Skip to content

Commit

Permalink
Remove the need for split shader
Browse files Browse the repository at this point in the history
  • Loading branch information
karimnaaji committed Jan 28, 2023
1 parent 7300421 commit 677fdec
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions debug/satellites-custom-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 677fdec

Please sign in to comment.