Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3980

Does pixi.js call gl.drawArrays for each sprite in the scene?

$
0
0

I am trying to learn how to render 2d sprites using webgl. I use this to render a single quad:

 

  let positions = [
    -1, 1,
    -1, -1,
    1, -1,
    -1, 1,
    1,-1,
    1, 1
  ];

  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);

 

 Now I want to render more sprites, do I have to setup positions like this for each sprite and call `gl.drawArrays`?


Viewing all articles
Browse latest Browse all 3980