Questions tagged [vertex-array]

109 questions
2
votes
1 answer

Is it ok to render Raycasting using vertex array?

Im making simple fps game using raycasting, because I thought its very fast and light method. My Raycasting function saves data in to a vertex array, which is then rendered by OpenGl. But because this array contains vertex for every pixel on the…
Dave F.
  • 145
  • 6
2
votes
1 answer

Corrupted data in vertex shader attribute location

My model looks stretched because of corrupted data in vertex shader attribute location Here's the vertex shader code: #version 330 core layout (location = 0) in vec3 vertPos; layout (location = 1) in vec3 vertNormal; layout (location = 2) in vec2…
rahul meda
  • 23
  • 3
2
votes
1 answer

Fastest way to draw dynamic GL_TRIANGLE_STRIP

After some effort, I managed to draw dynamic aircraft trail using OpenGL. You may see a part of my code below: private void getTrailVertices(){ verticeBuffer = Buffers.newDirectFloatBuffer(6 * positionList.size()); for (int i = 0; i <…
2
votes
2 answers

Qt Vertex Arrays not working with QImage

I'll begin by apologizing for the length of the question. I believe I've committed some small, dumb error, but since I'm entirely unable to find it, I decided to post all relevant code just in case. I finally got texture loading working using…
Prime
  • 4,081
  • 9
  • 47
  • 64
2
votes
1 answer

Render multiple pixels using OpenGL ES 2.0

To tell from the beginning, I'm very novice within OpenGL world but I need to use it for some rendering optimisations in Android. I have to render a block or a bunch of contiguous pixels in a 2D space using OpenGL ES 2.0. I've found some suitable…
Cosmin Telescu
  • 113
  • 1
  • 2
  • 8
2
votes
1 answer

SFML drawing primitives from VertexArray

How do I draw a primitive of my choice from a constructed VertexArray? In the example below I am adding two vertices to the 'vertices' array and I am trying to draw it with 'window.draw(vertices, 2, sf::Lines)' but it gives me an error. I know I can…
Yajirobe
  • 115
  • 3
  • 10
2
votes
2 answers

glDrawElements not working on iPhone but glDrawArrays works

I have tried to convert my OpenGL application to OpenGL ES. I am drawing elements on Mac this way: glUseProgram(m_program); // Update uniform value. glUniform4f(uniforms[UNIFORM_COLOR], (GLfloat)color[0], (GLfloat)color[1], (GLfloat)color[2],…
Martin Pilch
  • 3,245
  • 3
  • 38
  • 61
2
votes
1 answer

Dynamic Lighting program with SFML, 1.6 to 2.x conversion

I found this sfml tutorial written back in 2009 and I'm trying to convert it to 2.4. I haven't been able to convert these 2 lines: win.draw(sf::Shape::Rectangle(le.Blocks[0].fRect, sf::Color(255, 0,…
Nathaniel G.M.
  • 433
  • 5
  • 15
2
votes
1 answer

How to restore CCW winding order after reflecting vertices in the x or y axis?

I'm rendering a polygon in OpenGL with a vertex array called vertices and a final index buffer called DRAW_ORDER with CCW winding. I have back-face culling enabled, and I make draw calls using glDrawElements(GL_TRIANGLES, DRAW_ORDER.capacity(),…
William
  • 111
  • 2
  • 5
2
votes
0 answers

Merging polygons

Is there any fast algorithm to merge polygons together as in the image below? Notice that new vertexes are created in the process. Is there any way to achieve this fast enough as to implement it in a real time system (game engine)?
Leo
  • 1,174
  • 11
  • 25
2
votes
2 answers

Generating Smooth Normals from active Vertex Array

I'm attempting to hack and modify several rendering features of an old opengl fixed pipeline game, by hooking into OpenGl calls, and my current mission is to implement shader lighting. I've already created an appropriate shader program that lights…
Zain Syed
  • 443
  • 4
  • 12
2
votes
1 answer

OpenGL ES 2.0: Efficient Rendering of Static and Dynamic Vertex Data

I am writing an iOS/Android game and looking for the most performant way to render my vertex data with OpenGL ES 2.0. I have two different kinds of data: dynamic data that changes its attributes every frame, for example the player or animated…
Sven
  • 143
  • 1
  • 1
  • 7
2
votes
1 answer

OpenGL ES 2.0 - How to batch draw particles that have unique translations, rotations, scales, and alphas?

I've combined all of my vertex data for many particles into a single array. How would I batch draw all of those particles in a manner that preserves their unique translations? I am so confused as to how to do this. I've already created two posts on…
BigSauce
  • 1,830
  • 3
  • 21
  • 27
2
votes
3 answers

glGenVertexArrays not giving unique vaos

My friend and I are working on a project using C++ and OpenGL. We've created a C++ class for a "ModelObject", and each ModelObject has a GLuint vao as a member variable. Then while initializing a ModelObject, we call glGenVertexArrays( 1, &vao…
Nick
  • 6,900
  • 5
  • 45
  • 66
1
vote
1 answer

How to refactor code from Vertex Array to Vertex Array Object methods

I'm studying Opengl and the book i've been using is OpenGL(R) ES 3.0 Programming Guide, 2nd Edition. And at chapter 6 they talk about Vertex arrays and they have a example code that uses Vertex Array methods, which is the code below. Later down that…
apo
  • 43
  • 4