Questions tagged [vertex-arrays]
The vertex-arrays tag has no summary.
46 questions
1
vote
1
answer
705
views
What is a efficient way for adding and removing vertices and indices in C++?
So I have this middle-large mesh that is composed from vertices and respective indices. At some point I need to add new ones and remove some. But that brings me into trouble. Because if I have, for ...
1
vote
1
answer
122
views
How can I remove unnecessary vertices from wall edges?
I've got a pretty simple tile based 2d top-down map with an array of walls. In order to figure where to cast light and shadows, I've generated an array of vertex coordinates along the walls like so:
...
2
votes
0
answers
111
views
Tell if two polygons are colliding
I want to make a function like areColliding which takes two polygons as args.
I also want to cover cases like
and the dreaded
because I am trying to create a ...
0
votes
2
answers
406
views
Cannot Draw a triangle without VAO on MacOS
So I was watching Cherno's Video on Vertex attributes and he was successful in drawing a triangle without a VAO, but in tutorials from learnopengl.com they specifically say they we need a VAO to draw ...
1
vote
0
answers
769
views
OpenGL VAO buffer rebinding vs binding switching
I'm considering two different approaches to vertex buffer management in my OpenGL game engine. The first one seems to be pretty usual, but I haven't seen the second one being proposed or used anywhere....
1
vote
1
answer
5k
views
Unreal 4 - How to access and iterate through the polygons of a mesh?
I'm newbie with Unreal Engine 4. I need to create a function which calculates the volume of a mesh, based on the following example:
https://n-e-r-v-o-u-s.com/blog/?p=4415
To achieve that I created ...
1
vote
1
answer
2k
views
VAO and VBO connection and granularity with multiple objects
How general should vertex array objects be?
I'd like to plan ahead and avoid a major revision down the road. I'm having a hard time wrapping my head around a few (possibly conflicting) pieces of ...
0
votes
1
answer
260
views
How the sharpdx set vertices by reading the vertex information files instead of coding the vertices?
During my developing, I always spend much time to fill up my vertex array by coding every vertex information when I have to create some complex models. It's quite inconvenient.
It's will be very ...
1
vote
0
answers
194
views
SFML 2.4's RectangleShape is running slow when rendered multiple times
I am creating a level for my game and currently, there is a Tile class where I have a black RectangleShape rendering without any weirdness, except when I look at the FPS, its 200. Now, I have a pretty ...
1
vote
1
answer
112
views
Combining varying vertex variable and vertex variable in OpenGL. How to? [duplicate]
Let's say I have 2 triangles sharing an edge defined by 4 vertices. Though the normals for these 2 triangles are unique for each triangle and are defined per vertex. So say I have 4 vertices, 6 ...
2
votes
1
answer
407
views
What to do with unused vertices?
Imagine yourself a vertex array in OpenGL representing blocks in a platform game.
But some vertices may be not used.
The environment is dynamic, so there always some vertex may suddenly become ...
23
votes
2
answers
23k
views
Difference in glDrawArrays and glDrawElements
While refreshing my mind on OpenGL ES, I came across glDrawArrays and glDrawElements.
I understand how they are used and sort ...
0
votes
1
answer
446
views
Streaming to VAO VertexBuffer using OpenGL Direct State Access for Instancing
How do i stream to a vertex buffer using Direct State Access? I want to update my vertex buffer of matrices every frame so i can use it in my Shader.
This is how i specify my buffer. I do this once ...
0
votes
1
answer
469
views
Heightmap vertex list to vertex + index list
Right now I'm trying to load a heightmap into my LWJGL application. I load it like that into a float[][] array and I can read the height value at a given x and z position in the map:
...
0
votes
1
answer
825
views
In game engine, how to get the vertices buffers of different vertex formats for render from the mesh file properly?
I'm a fresher on engine programming. I have a question of how we can get the vertices buffers of vertex formats from the mesh file.
For example, in OBJ file or FBX file, we save the positions, ...
0
votes
1
answer
1k
views
Avoiding GC when rebuilding Mesh.uv and Mesh.vertices
Since unity will not allow users to iterate over mesh.uv and mesh.vertices, I am stuck having to use GC intensive calls when applying an array of uvs and vertices to a mesh. I run into high GC ...
3
votes
2
answers
7k
views
GL_INVALID_OPERATION on glBindVertexArray Despite glGenVertexArrays()
so I've been trying to create a simpler way to draw polygons and and have come across the following issue:
When I call glBindVertexArray(m_VAO); it throws a ...
0
votes
1
answer
109
views
Texture to Painted Vertex Algorithm
I want to generate some game textures into coloured vertex arrays.
Is there a known algorithm to transform texture/bitmap data into an optimised vertex array. Much like how the Homeworld skyboxes ...
0
votes
1
answer
247
views
How to combine VAO and shader language?
I'm new and trying to draw a very simple quad with VAO and GLSL.
My definitions:
...
1
vote
1
answer
106
views
Do I have to use vertexArray in opengl
GLuint VertexArrayID;
glGenVertexArrays(1, &VertexArrayID);
glBindVertexArray(VertexArrayID);
As you can see from the above code, some tutorials use this ...
0
votes
1
answer
364
views
What data to store along a vertex
Is there any other recommended data I should store in the vertex buffers aside from a vertex' coordinates, normals and texture coordinates?
For example data I'd need for a feature that almost every ...
0
votes
1
answer
1k
views
Getting access violation because of ID3D11Buffer [closed]
I try to create a simple class store my model variables vertex array and vertexbuffer. So I create an array of myclass to create and manage object dynamically. But when
...
0
votes
1
answer
552
views
Loading Wavefront Data into VAO and Render It
I have successfully loaded a triangulated Wavefront (.obj) into 6 vectors, the first 3 vectors contain the locations for vertices, UV coords, and normals. The last three have the indices stored for ...
3
votes
3
answers
16k
views
In Unity, how do I dynamically manipulate parts of a mesh?
I'm trying to achieve mesh manipulation of any mesh based on user input (mostly sliders). Here's an example of what I want. I am not sure whether to call this "morphing", as I am trying to change one ...
2
votes
1
answer
698
views
Does interleaving in VBOs speed up performance when using VAOs
You usually get a speed up when you use interleaved VBOs instead of using multiple VBOs. Is this also valid when using VAOs?
Because it's much more convenient to have a VBO for the positions, and one ...
1
vote
2
answers
13k
views
SFML: Generate a background image
I want to generate a background, which is used in the game, on every instance of the game based on certain conditions. To do so, I'm using a sf::RenderTexture and a ...
0
votes
1
answer
380
views
OpenGL Transform Feedback output size
I'm working on a particle system using transform feedback, and I would like to know if it is possible to render to anything other than floats, like halfs, using Transform Feedback (OpenGL 3.3)? It ...
1
vote
1
answer
371
views
How can I efficiently store Vertex data in C#/XNA?
I am creating a terrain system using voxels in a somewhat minecraft-like style and I was wondering if there was anything I could do to increase the number of vertices I am able to store (and therefore ...
0
votes
2
answers
215
views
XNA Game arhitecture, sharing vertices between objects
I'm practicing primitives rendering in XNA and I want to create something like pipe or tunnel.
I have base class called PipeSegment from which I inherit classes like RotatingSegment and NormalSegment (...
3
votes
3
answers
7k
views
How to Bind Multiple Shapes/Models to One Vertex Buffer?
If I have two Vertex Arrays, one for Square, and one for Triangle; what is the best way to bind them to the VertexBuffer?
What are the patterns used to write multiple vertices to the VertexBuffer? ...
3
votes
1
answer
1k
views
Per Instance Textures, and Vertex And Pixel Shaders?
How do you implement per instance textures, vertex shaders, and pixel shaders?
Given:
1. Two different model templates in Vertex Buffer, Square & Triangle
2. Instance Buffer with [n] instances of ...
5
votes
1
answer
12k
views
DirectX / Instance Buffer - How To Use Instance Buffers To Enable Reuse of VertexBuffer Data?
I created a simple Model framework in C++ 11 so that the same model can be rendered in different parts of a scene.
What I am trying to figure out is how to reference VertexBuffer data already "set" ...
4
votes
3
answers
959
views
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?
Any code examples ...
7
votes
2
answers
4k
views
Vertex data split into separate buffers or one one structure?
Is it better to have all vertex data in one structure like this:
class MyVertex
{
int x,y,z;
int u,v;
int normalx, normaly, normalz;
}
Or to have each ...
3
votes
1
answer
171
views
1
vote
1
answer
616
views
Triangle Strips of Tetraheron
I am confused about the triangle strip representation of closed mesh .The vertex buffer for triangle strip representation of the a figure is shown below:
A(0,1) B(0,0) C(1,1) D(1,0)E(2,1)
vertex ...
0
votes
2
answers
1k
views
Lighting with VBO
INTRO
I'm using a Java JOGL wrapper called processing.org and I have coded some environment on it and I'm quite proud of it even if it has some library stuff that I didn't know anything about it (==...
0
votes
4
answers
2k
views
Should I use a VBO if the vertex data changes from time to time?
If I have a very large number of vertices, but they're static for about 70% - 80% of their life time, should I use a VBO for them? If so, what usage should I specify? This doesn't sound like a case ...
8
votes
3
answers
3k
views
What is a better abstraction layer for D3D9 and OpenGL vertex data management?
My rendering code has always been OpenGL. I now need to support a platform that does not have OpenGL, so I have to add an abstraction layer that wraps OpenGL and Direct3D 9. I will support Direct3D 11 ...
0
votes
1
answer
617
views
Refactoring an immediate drawing function into VBO, access violation error
I have a MD2 model loader, I am trying to substitute its immediate drawing function with a Vertex Buffer Object one....
I am getting a really annoying access violation reading error and I can't ...
2
votes
1
answer
2k
views
how can I specify interleaved vertex attributes and vertex indices
I'm writing a generic ShaderProgram class that compiles a set of Shader objects, passes args to the shader (like vertex position, vertex normal, tex coords etc), then links the shader components into ...
0
votes
2
answers
265
views
vertex array with smoothness
I'm using vertex array to draw 2d geometry,
but I can't achieve smoothness.
This is the code I'm using:
...
2
votes
2
answers
5k
views
Using index arrays with OpenGL VBOs
I've recently started reading about VBOs.
If, for example, I want to draw a cube using VBOs, can I use one VBO to hold the coordinates for the 8 vertices, and another one as an index array, to ...
5
votes
2
answers
1k
views
Generating geometry when using VBO
Currently I am working on a project in which I generate geometry based on the players movement. A glorified very long trail, composed of quads.
I am doing this by storing a STD::Vector, and removing ...
4
votes
3
answers
3k
views
How to create per-vertex normals when reusing vertex data?
I am displaying a cube using a vertex buffer object (gl.ELEMENT_ARRAY_BUFFER). This allows me to specify vertex indicies, rather than having duplicate vertexes. In the case of displaying a simple cube,...
2
votes
1
answer
812
views
Beginner question about vertex arrays in OpenGL
Is there a special order in which vertices are entered into a vertex array? Currently I'm drawing single textures like this:
...