Questions tagged [gldrawarrays]

render primitives from array data

glDrawArrays specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors and use them to construct a sequence of primitives with a single call to glDrawArrays.

When glDrawArrays is called, it uses count sequential elements from each enabled array to construct a sequence of geometric primitives, beginning with element first. mode specifies what kind of primitives are constructed, and how the array elements construct those primitives. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are generated.

Vertex attributes that are modified by glDrawArrays have an unspecified value after glDrawArrays returns. For example, if GL_COLOR_ARRAY is enabled, the value of the current color is undefined after glDrawArrays executes. Attributes that aren't modified remain well defined.

38 questions
1
vote
1 answer

Why is glDrawArrays failing on Intel Mesa 10.3, while working with nVidia using OpenGL 3.3

I am trying to run Piccante image processing library on Intel GPU. The library is using OpenGL shaders to apply filters on images. The library is using OpenGL 4.0 according to its documentation, so I had to make a small modifications in order to get…
maitek
  • 21
  • 5
1
vote
1 answer

Java OpenGL EXCEPTION_ACCESS_VIOLATION on glDrawArrays only on NVIDIA

I'm working on a game in java using lwjgl and it's OpenGL implementation. Never had any problems until I exchanged it with a colleague who uses NVIDIA instead of AMD, and suddenly it crashes on a line that works on AMD but it only crashes at that…
ShynRou
  • 41
  • 6
1
vote
0 answers

glDrawArrays versus glBegin - glEnd rendering

I am starting to learn OpenGL; I tried to display a few number of vertices in order to render a polygon. My display function succeeds if I use the following code: glBegin(GL_POLYGON); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.5, 0.0,…
Nick
  • 10,309
  • 21
  • 97
  • 201
1
vote
2 answers

Rendering independent quads using one draw call per quad or one call for all of them?

In an WebGL application I've got to draw a bunch of quads (the more the better, but 1000 should be a reasonable upper bound). Each quad has some attributes, like color, position, size, perhaps a few material properties. Something in the order of 10…
MvG
  • 57,380
  • 22
  • 148
  • 276
1
vote
1 answer

OpenGL Drawing data from mystery buffer

I've got a problem with drawing an buffer object with no index. My other indexed vbos draw fine... void drawArray(VertexArrayObject VAO) { GL11.glColor3d(1.0f, 0.2f, 0.2f); GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); …
1
vote
1 answer

Problems drawing VBO with glDrawArrays using OpenGL/LWJGL

I'm having some difficulty getting VBOs to draw in my game. I've looked around, and checked all the common mistakes but nothing seems to get them to draw. Here's the relevant code in order of execution: Run Once: public void startLWJGL() { try…
1
vote
0 answers

Performance issue with glDrawArraysInstanced

I'm trying to implement an OpenGL4 instanced drawing algorithm where each instance is composed by a single triangle. The main reasons why I want to implement this kind of algorithm are: the ability to use less GPU memory in the frequent scenario…
l.moretto
  • 193
  • 1
  • 13
1
vote
1 answer

glDrawArrays gives vertical lines when using GL_POINTS

I'm drawing a points using glDrawArrays with GL_POINTS. On my Intel 82945G Express Chipset Family everything is working fine. But on ATI Radeon Mobility 5730 vertical lines appear randomly when resizing the window. Here is the code that renders the…
zulunation
  • 297
  • 1
  • 5
  • 13
0
votes
1 answer

glDrawElementsInstanced: VertexAttribute mat4 not applied per instance

I have a problem with rendering multiple instances of an object, using one VertexArrayObject and four VertexBufferObjects. I cannot get my head around what's wrong with my approach. Here are the basics: My relatively simple…
sgraut
  • 3
  • 2
0
votes
0 answers

glDrawArrays - Getting GL_INVALID_OPERATION and GL_INVALID_VALUE

I am porting some legacy OpenGL code to Web Assembly (using emscripten). This is using OpenGL 1.1 I have two vertex formats, and I swap between them (depending on whether I'm doing 2D drawing or 3D drawing). Here are the two formats: struct…
John Raptis
  • 177
  • 7
0
votes
2 answers

problem with QOpenGLWidget, QOpenGLWindow

Can anyone tell me why the following code in my paintGL does not draw when using the DrawArrays function? I'm using Qt 5.14.2 in Qt Creator on the last Windows 10. A few comments; I'm experimenting to try to understand the differences between…
0
votes
1 answer

Webgl gl_VertexID affected by drawArrays offset?

When drawArrays is called with an offset, (the "first" argument being non zero), does the first gl_VertexID still start at 0, or does it start at the offset value?
Markus Fjellheim
  • 335
  • 2
  • 11
0
votes
1 answer

OpenGL ES Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 8367 (GLThread 3562)

I have a crash in my call to glDrawArrays when trying to render a .obj loaded using a library. I dont know what is happening since it is my first time using openGL ES. My guess was that the number of triangles was wrong and after trying glDrawArrays…
Traoré Moussa
  • 433
  • 1
  • 6
  • 22
0
votes
2 answers

Draworder OpenGL - larger objects over smaller

In my OpenGL ES Android game I am trying draw shapes in succesive order in accordance with their z-value (that is position in the z-plane). This means to draw the smallest most distant shapes (textures) first and then draw the larger. I have stored…
java
  • 1,165
  • 1
  • 25
  • 50
0
votes
2 answers

glDrawArraysInstanced not working properly

I am new in opengl I am creating two cubes when i am using glDrawArraysInstanced . According to my matrix transformation i am not getting expected result Here is my code which i am using with the varying data float…
varun gakhar
  • 13
  • 1
  • 5