twgl.js - Use instancing and drawArray together TWGL -


i want use instancing draw call , noninstancing draw call when set attribute of instanced object , after set attribute of simple draw simple draw not work correctly. seems it's using attributes of instanced object! should do? doing wrong?

gl.useprogram(obj1.programinfo.program); twgl.setbuffersandattributes(gl, obj1.programinfo , obj1.bufferinfo); twgl.setuniforms(obj1.programinfo, uniforms); gl.drawarraysinstanced(obj1.type, 0, 4, obj1count);  gl.useprogram(obj2.programinfo.program); twgl.setbuffersandattributes(gl, obj2.programinfo , obj2.bufferinfo); twgl.setuniforms(obj2.programinfo, uniforms); gl.drawarrays(obj2.type, 0, obj2count); 


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -