Spaces:
Running
Running
v1.33.29 — FOW 128 grid + model fog + flicker + damage + pathfinding + water fixes
Browse files484 unmodified lines485486487488489490491492493494495484 unmodified linesgl.disableVertexAttribArray(8); gl.vertexAttrib1f(8,1);gl.bindVertexArray(null);} else {gl.bindVertexArray(waterVAO);gl.bindBuffer(gl.ARRAY_BUFFER,waterVBO);gl.bufferData(gl.ARRAY_BUFFER,waterVerts,gl.DYNAMIC_DRAW);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,waterIBO);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint32Array(idx),gl.STATIC_DRAW);gl.bindVertexArray(null);}}484 unmodified lines485486487488489490491492493494495496497498499500501502503504505506507508509484 unmodified linesgl.disableVertexAttribArray(8); gl.vertexAttrib1f(8,1);gl.bindVertexArray(null);} else {/* REBUILD ATOMICALLY. A crater-flood rebuild changes both vertex and indexcounts; re-uploading into the live VAO let stale indices read the wrongvertex array — undefined behaviour that drew enormous stretched sheetsoff the map. Drop and recreate: all-or-nothing. */gl.deleteVertexArray(waterVAO); gl.deleteBuffer(waterVBO); gl.deleteBuffer(waterIBO);waterVAO=gl.createVertexArray(); gl.bindVertexArray(waterVAO);waterVBO=gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER,waterVBO);gl.bufferData(gl.ARRAY_BUFFER,waterVerts,gl.DYNAMIC_DRAW);gl.enableVertexAttribArray(0); gl.vertexAttribPointer(0,3,gl.FLOAT,false,VSTRIDE,0);gl.enableVertexAttribArray(1); gl.vertexAttribPointer(1,3,gl.FLOAT,false,VSTRIDE,12);gl.enableVertexAttribArray(2); gl.vertexAttribPointer(2,3,gl.FLOAT,false,VSTRIDE,24);gl.enableVertexAttribArray(3); gl.vertexAttribPointer(3,2,gl.FLOAT,false,VSTRIDE,36);gl.enableVertexAttribArray(4); gl.vertexAttribPointer(4,1,gl.FLOAT,false,VSTRIDE,44);waterIBO=gl.createBuffer(); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,waterIBO);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint32Array(idx),gl.STATIC_DRAW);gl.disableVertexAttribArray(5); gl.vertexAttrib4f(5,0,0,0,1);gl.disableVertexAttribArray(6); gl.vertexAttrib1f(6,0);gl.disableVertexAttribArray(7); gl.vertexAttrib4f(7,1,1,1,1);gl.disableVertexAttribArray(8); gl.vertexAttrib1f(8,1);gl.bindVertexArray(null);}}
src/engine/terrain.js+17-3