javascript - WebGL indices array size -


for 1 of webgl projects need generate lots of objects indices. examples, cones. when javascript generates not many works fine, adding cones scene rendering becomes glitchy.

works fine small number of cones

glitchy lots of them

i pretty sure problem in defining index buffer:

*var ibuffer = gl.createbuffer(); gl.bindbuffer(gl.element_array_buffer, ibuffer); gl.bufferdata(gl.element_array_buffer, new uint8array(glindices), gl.static_draw);* 

to more specific unit8array or transition shader.

can me that?

if use uint8 indices limiting maximum of 256 unique vertices per drawcall, if batch draw it's exceeding max value of uint8 , integer truncation means end effectvely random vertex connectivity across models.

increase uint16 indices let have 65536 unique vertices per draw.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -