OpenGL GLKit : rendering different size vertices objects together. ios opengl draw call exceeded array buffer bounds -


i doubt can me on hey ho.

i have 3d framework have been working on things in world cubes (36 vertices).

i followed great tutorial bringing blender objects in opengl : http://www.raywenderlich.com/48293/how-to-export-blender-models-to-opengl-es-part-1

i brought cube in , good, tried bring sphere in, cube, cylinder etc , blows ios opengl draw call exceeded array buffer bounds

i know objects fine work demo app renders 1 object , has no binding of arrays , vertex's etc

anyway

i sure code junk have tried everything

- (void)setupsphere; {      glgenvertexarraysoes(1, &_vertexarray);     glbindvertexarrayoes(_vertexarray); //////     glgenbuffers(1, &_vertexbuffer);     glbindbuffer(gl_array_buffer, _vertexbuffer);     glbufferdata(gl_array_buffer, sizeof(&spherevertices), &spherevertices, gl_static_draw); ////     glgenbuffers(1, &_position);     glbindbuffer(gl_array_buffer, _position);     glbufferdata(gl_array_buffer, sizeof(spherepositions),spherepositions, gl_static_draw); ////     glgenbuffers(1, &_texture);     glbindbuffer(gl_array_buffer, _texture);     glbufferdata(gl_array_buffer, sizeof(spheretexels),spheretexels, gl_static_draw); ////     glgenbuffers(1, &_normal);     glbindbuffer(gl_array_buffer, _normal);     glbufferdata(gl_array_buffer, sizeof(spherenormals),spherenormals, gl_static_draw); ////// //    glbindvertexarrayoes(0);      // positions     //glbindbuffer(gl_array_buffer, _position);     glenablevertexattribarray(glkvertexattribposition);     glvertexattribpointer(glkvertexattribposition, 3, gl_float, gl_false, 0, spherepositions);      // texels     //glbindbuffer(gl_array_buffer, _texture);     glenablevertexattribarray(glkvertexattribtexcoord0);     glvertexattribpointer(glkvertexattribtexcoord0, 2, gl_float, gl_false, 0, spheretexels);      // normals     //glbindbuffer(gl_array_buffer, _normal);     glenablevertexattribarray(glkvertexattribnormal);     glvertexattribpointer(glkvertexattribnormal, 3, gl_float, gl_false, 0, spherenormals);      //glbindvertexarrayoes(_vertexarray);      glbindvertexarrayoes(0); }  - (void)drawsphere:(float)eyeoffset {     // calculate per-eye model view matrix:     glkmatrix4 temp = glkmatrix4maketranslation(eyeoffset, 0.0f, 0.0f);     glkmatrix4 eyebasemodelviewmatrix = glkmatrix4multiply(temp, self.basemodelviewmatrix);      if (self.istransparant)     {         glenable (gl_blend);         gldisable(gl_cull_face);         glblendfunc (gl_src_alpha, gl_one_minus_src_alpha);     }      if (self.textureinfo)     {         glbindtexture(self.textureinfo.target, self.textureinfo.name);     }       glbindvertexarrayoes(_vertexarray);      gluseprogram(_program);      self.modelviewmatrix = glkmatrix4maketranslation(self.position.x,self.position.y, self.position.z );//(float)x, (float)y, -1.5f)     self.modelviewmatrix = glkmatrix4scale(self.modelviewmatrix, self.scale.x, self.scale.y, self.scale.z);      //rotation +=0.01;     self.modelviewmatrix = glkmatrix4rotate(self.modelviewmatrix,rotation, 0.0 ,0.0 ,1.0);     self.modelviewmatrix = glkmatrix4multiply(eyebasemodelviewmatrix, self.modelviewmatrix);      glkmatrix3 normalmatrix = glkmatrix3invertandtranspose(glkmatrix4getmatrix3(self.modelviewmatrix), null);     glkmatrix4 modelviewprojectionmatrix = glkmatrix4multiply(self.projectionmatrix, self.modelviewmatrix);      gluniformmatrix4fv(uniforms[uniform_modelviewprojection_matrix], 1, 0, modelviewprojectionmatrix.m);     gluniformmatrix3fv(uniforms[uniform_normal_matrix], 1, 0, normalmatrix.m);      _colorslot = glgetuniformlocation(_program, "color");     glfloat color[] = {         self.color.x, self.color.y, self.color.z, self.color.a};     gluniform4fv(_colorslot, 1, color);      gldrawarrays(gl_triangles, 0, spherevertices);      if (self.istransparant)     {         glenable(gl_cull_face);         //glenable(gl_depth_test);         gldisable(gl_blend);     } } 

you're trying use vao client vertex arrays. not supported. quoting extension spec:

  • should vertex array object allowed encapsulate client vertex arrays?

    resolved: no. opengl es working group agreed compatibility opengl , ability to guide developers more performant drawing enforcing vbo usage more important possibility of hurting adoption of vaos.

if want use vao, need enable vbo code seems present in code, commented out.


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -