Check out this script for creating triangles
Here's what happens with this script on every frame:
- Retrieve the slider value
- If the slider value changes, dynamically adjust the sizes of Float32Array arrays for vertices and colors
- Iterate through a loop to add new triangles to the arrays, each with random X, Y, RGB, and alpha values
- Utilize gl.drawArrays to render the arrays onto the screen
I'm facing an issue where the framerate drops significantly when I exceed 800 triangles. Is there any way to optimize the performance?