arrays - C++ OpenGL Large Mesh is missing triangles -


So I'm putting an altitude map renderer which will do most of the task int to the shirtier, but first of all I want to render I am creating a net for the moment, I am currently playing with upper bounds of Open GL and C ++ to see how I can dense a mesh (hence I want to do something later in the case of Lod mesh division. I'm)

anyway! To cut this issue;

After testing a mesh resolution of 32, 64 I saw while 128 occurred to me runtime experience crashes, I stopped them using a self-class "Indeksafs", which is the array length Keeps the 6 index to reduce, the problem is only on the resolution of 128, the 3G of the mesh actually displayed, I was wondering if the number of indexes can be open GL or may be Using 1 set of fferObjects or if there is a problem with handling things of C ++ with my hand.

I have been generated mesh through the following:

  void HeightMapMesh:: GenerateMesh (GLfloat Masskel, Glushart Meshrisolusn) {Glushart Vertex mount = (Mesh Resolution + 1 ) * (Mash resolution + 1); Vertexophyte * vertexdata = new vertexoshox [vertex count]; Glucose Index Calculation = (Aries Rangelion * Mesh Resolution) * 6; // indexFace 6 keeps an array of GLushort attempts to remove the size range from the index * index = new indexApps [meshrecolution * meshreculation]; Gflflot scalar = meschelle / ((GL float) meshrestulation); GL Float PoEx = 0; GLfloat posY = 0; For (int x = 0; x & lt; = meshResolution; x ++) {posX = ((GLfloat x) * scalar; For (int y = 0; y and lt; = meshResolution; y ++) {posY = ((GLfloat y)) * scalar; VertexData [y + (x * (mesh resolution + 1)) = wertexophyte (pausx, pose, 0.0 f, x, y); }} GLint Index; GLIFT TL, TR, BL, BR; For (int x = 0; x & lt; meshResolution; x ++) {for (int y = 0; y and lt; meshResolution; y ++) {indexPosition = (y + (x * (meshreulsion)); BL = Y + (x * (mesh resolution + 1)); TL = Y + 1 + (x * (mesh resolution + 1)); BR = Y + ((x + 1) * (mesh resolution + 1)) Index; indexFace (BL, TR, TL, BL, BR, TR);}} Mesh.Fill (Vertex data, TR, y + 1 + (+ x + 1) Head number, (Zero *) IndexData, IndexCount, GL_STATIC_DRAW, GL_STATIC_DRAW); Delete [] VertexData; [] Index Delete;} // This is the mesh. Fill () void fill (T * Warddata, Glusort Virkount, blank * Inddta, Glusort Indakunt, Jielaanuuaruyuesaji, Jielaanu Indug) {indexCount = indCount; the count = plain number; Glbindbfr (GL_ARRAY_BUFFER , Warteksbfr Objektaidiaidi); Glbindbfr (GL_ELEMENT_ARRAY_BUFFER, Indeksbfrobjektaidiaidi); Glbfrdata (Jiel_aararaaibiyueffiar, Akarf (T) * Wartekskount, Wartdeta, Wartug Ez.); GlobfordData (GL_LEMEARRAFF, GLushort * index, INDANDA, INDUUSES); }  

Due to this you have created your index shorts.

Example: GLushort indexCount = (meshResolution * meshResolution) * 6; USHRT_MAX is hitting the value of 105 for meshResolution . (105 * 105 * 6 = 66150> 65535)

Use as an index. So change your indexes to unsigned insets everywhere, and thus make a last drop call:

  glDrawElements (GL_QUADS, Indicate ount, GL_ UNSIGNED_INT, index); // // glDrawElements (GL_QUADS, Indicate ount, GL_NSINSIHARART, index); // Instead of // GL_QUADS has been deprecated, but it seems that your data is in that format, so I left it like this  

If you go to GLURINTTP < / Code> S rather or better yet there is no problem with the GPU because it is the right use case for this.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -