334 questions
0
votes
0
answers
70
views
What is the least computationally expensive way to update a vertex buffer in order to refresh vertex positions?
Right now, I have a simple MacOS application with a MTKView occupying most of the window and a panel on the right to change values that affect what the MTKView renders. Currently, there is a slider ...
1
vote
1
answer
80
views
OpenGL pygame cannot get buffers working reliably with vertextPointer and colorPointer
So I'm pretty sure I'm just doing something wrong here with how I'm calling the OpenGL.
I've provided an example below where about 30% of the time it shows the semi transparent vertex colored squares ...
0
votes
1
answer
327
views
Associating an attribute with multiple VBOs using glVertexAttribBinding/glVertexArrayAttribBinding
Suppose I have 2 meshes and I used one VBO for each mesh. The vertex attributes (position, normal, color)
are contained in a struct:
struct Vertex {
glm::vec3 position;
glm::vec3 normal;
glm::...
1
vote
1
answer
200
views
Can I append vertexes to a default buffer using UpdateSubresources?
The documentation for UpdateSubresources is here. The parameter descriptions are so minimal that they aren't very helpful to someone using the function for the first time (like me).
UINT64 inline ...
2
votes
1
answer
1k
views
How to make the vertex buffer available to a compute shader
I have a C++ program that uses Direct3D to draw a 3D model. That program works as expected, i.e. images of the 3D model are properly rendered. The next step is to write a compute shader that takes the ...
0
votes
0
answers
46
views
Directx11 vertexbuffer
I'm trying to learn how to program a simple 2d game using directx 11 and I have a question regarding the vertex buffer, I created a 1.0f x 1.0f square to load a 512x512 pixel texture, to create a ...
0
votes
2
answers
444
views
WebGPU. How to SET COLOR PER TRIANGLE, but not per vertex, and USE ONLY VERTEX BUFFER
I am trying to set color per triangle.
But it is not working.
Only setting color per vertex works!
This is what I made:
<!DOCTYPE html><title>Color Per Triangle</title><style>
...
0
votes
1
answer
485
views
Importing 3d model(fbx) using Assimp creates higher number of vertices than original 3d model
I have a simple human face 3d model with 468 vertices. In blender stats also shows 468 vertices and 898 faces, when I import/read using Assimp, it becomes 2694 vertices(which I think 3×number of faces)...
2
votes
0
answers
489
views
Vulkan StorageBuffer versus VertexBuffer
I'm experimenting with Vulkan rendering, and noticed that we can render using StorageBuffer + gl_VertexIndex instead of VertexBuffer. I've seen this in Metal API tutorials.
There are any benefits of ...
1
vote
0
answers
390
views
Unity: How to edit vertex after skinned mesh animation has been applied
As a test im trying to move an animated skinned mesh up and down per vertex but it doesnt really work.
without offset
with offset 1 in the y
Im fairly certain that the vertices im changing are before ...
0
votes
1
answer
349
views
Issue with read vertex / index buffer with structured buffer in DXR
Scene is just like above image(Sponza scene), and I think texture index for each geometry is good, but texture coordinate seems wrong
I'm currently upload descriptor in descriptor heap like this :
(...
0
votes
1
answer
441
views
Adding vertices on mouse click in DirectX 12
I'm trying to implement a functionality where a vertex is added whenever the user clicks
on the viewport.
So far I've managed to draw vertices with the mouse using D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
...
0
votes
1
answer
2k
views
Vertex attribute not consumed by shader for my Vulkan program
I'm working with a tutorial to help learn Vulkan in C++, and I'm stuck trying to be able to change what my vertices are and colors. It always shows a triangle with 3 colors interpolated between each ...
0
votes
1
answer
976
views
Unity: skinned mesh vertexbuffer output slightly different than correct results
It’s like this hip is stuck in place, with in the pictures(being at different times in the animation since I can’t upload a gif) the red wireframe is the drawing of the raw output triangles and ...
1
vote
1
answer
822
views
Drawing two triangles using index buffer
I am following Cherno's brilliant series on OpenGL, and I have encountered a problem. I have moved on from using a vertex buffer only, to now using a vertex buffer together with an index buffer.
What ...
2
votes
1
answer
524
views
OpenGL - Can I draw non-indexed when index-buffer is set for VAO?
I set up a VAO, binding vertex-buffers to it for vertex attributes, but also set index-buffer (With glVertexArrayElementBuffer). Does that restrict it so it only works with glDrawElements type of ...
0
votes
1
answer
491
views
OpenGL texture issue on plane drawn using glDrawArrays()
I'm trying to apply a texture to a plane made up of 6 vertexes drawn using glDrawArrays()
The first triangle drawn seems to be drawn correctly but the texture for the second triangle doesn't seem to ...
0
votes
1
answer
901
views
Draw multiple buffers with the same vertex layout
I have multiple objects, each one of them has its own index buffer, vertex buffer, some have a different shader or texture, and all of them have the same vertex format (x, y, z, u, v, nx, ny, nz). I ...
1
vote
0
answers
538
views
What is the best way to change the vertex stride between draw call in Vulkan
I am trying to create Vulkan support for my DX12 GameEngine, however, I've run into a problem and am not sure how to solve it.
I have two kinds of meshes: a regular mesh which contains vertex position,...
0
votes
1
answer
142
views
Ho do you convert an OpenGL project from older glVertexAttribPointer methods to newer glVertexAttribBinding methods?
I have an OpenGL project that has previously used OpenGL 3.0-based methods for drawing arrays and I'm trying to convert it to use newer methods (at least available as of OpenGL 4.3). However, so far ...
4
votes
1
answer
223
views
Broken Vertex Data in Mesh Class
I'm trying to implement model loading, but I'm stuck with one problem. When i try to draw a mesh (a single textured quad written by hand for test purposes) for some reason duplicated data associated ...
0
votes
1
answer
334
views
Using separate vertex buffer and texture coord buffer and multiple indices to draw tris DirectX11
So I saw these posts DX10+ multiple vertex buffers, single index buffer and Using Multiple Vertex Buffers In DX10/DX11 and vague understood Why Directx11 doesn't support multiple index buffers in ...
10
votes
0
answers
2k
views
Interleaved vs non-interleaved vertex buffers
This seems like a question which has been answered throughout time for one IHV or another but recently I have have been trying to come to a consensus about vertex layouts and the best practices for a ...
3
votes
1
answer
207
views
Can I glDeleteBuffer a VBO and IBO after binding to a VAO?
I've read that a VBO (Vertex Buffer Object) essentially keeps a reference count, so that if the VBO's name is given to glDeleteBuffers(), it isn't truly dismissed if a living VAO (Vertex Array Object) ...
0
votes
1
answer
1k
views
Vertex Buffer Abstraction in OpenGl [duplicate]
I have been trying to write some classes to abstract OpenGl. So far I have written a VertexArray class that uses template functions which are working fine so far. However I have encountered problems ...
2
votes
1
answer
5k
views
OpenGL - Is it efficient to call glBufferSubData (nearly) each frame?
I have a spritesheet that contains a simple sprite animation. I can successfully extract each animation frame sprite and display it as a texture. However, I managed to do that by calling ...
1
vote
2
answers
633
views
OpenGL: How does Vertex Buffer manage its memory?
I'm learning OpenGL and I'm trying to understand things properly. If my understanding is incorrect at any point, please correct me.
Introduction
So let's say we have a triangle. This triangle has its ...
0
votes
1
answer
488
views
How do I use two Vertex Buffers?
I have two buffers I created like this:
GLuint vao;
GLuint vbo[2];
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glGenBuffers(2, vbo);
// 1
glBindBuffer(...
0
votes
1
answer
938
views
Using multiple VBO in a VAO
I try to use 2 VBO inside a VAO and I end up with a crash (far beyond my app).
The idea is to make a first VBO (and optionnally an IBO) to stucture the geometry.
This worked well, until I get the idea ...
0
votes
0
answers
231
views
OponGL 4.1 Is it possible to bind the some vertex data and use both for a vertex array and for a uniform buffer for a shader program?
Using OpenGL 4.1, I am trying to figure out if it is possible to bind a set of vertices as a vertex array and then use that same vertex data as a uniform buffer object for a shader program (or visa ...
0
votes
0
answers
624
views
Drawing a plane with vertex buffer object
I'm trying to draw a square plane of 10 x 10 using the VBO on OpenGL. So I have a function getPlaneCoords that calculate the vertices and the indexes however the program just ends up crashing when I ...
1
vote
1
answer
387
views
OpenGL correct way to draw multiple objects?
I am trying to understand how to correctly draw multiple objects, and to do that i wanted to draw a cube face by face. Problem is i obviously didn't get it right because only the first face is being ...
0
votes
1
answer
368
views
When drawing multiple objects, when do you create a new vertex array object?
I'm trying to create a game with WebGL.
I currently have three textures, one with letters for the font, a sprite sheet for the character, and a tilemap for the world. So I have a few large textures ...
0
votes
1
answer
2k
views
OpenGL Draw Multiple Vertex Arrays
I want to draw multiple vertex arrays. This is the initialization:
unsigned int va1;
unsigned int vb1;
void init_va1() {
glGenVertexArrays(1, &va1);
glBindVertexArray(va1);
...
0
votes
0
answers
75
views
Ways of drawing vertex ranges in Direct3D
Suppose I have a one big shader program and want only specific ranges of vertices/triangles rendered.
What are some performant ways of doing this? Which one looks most promising?
I came up with 3 ...
-1
votes
1
answer
569
views
Three.JS r97 Issue GL ERROR :GL_INVALID_OPERATION : glDrawElements: attempt to access out of range vertices in attribute 2
I'm posting this issue as a last resort.
I have read ALL similar topics from the site.
Here is the problem:
I'm using an older version of Three.JS (r97) and updating to latest is not an option.
I'm ...
1
vote
1
answer
2k
views
C++ OpenGL, why isn't the vertex array binding the vertex buffer?
I'm pretty sure that the vertex array is not binding the vertex buffer because if I comment out the line where I unbind the vertex buffer it works perfectly fine, which suggests that the vertex array ...
0
votes
1
answer
476
views
What is the minimum guaranteed Shader Storage block size?
I can't seem to find it if it exists.
I've run into a problem with uniform buffers where the gl spec gives a minimum size of only 1024 locations. Is there a set minumum to the number of locations i ...
4
votes
1
answer
8k
views
Most generally correct way of updating a vertex buffer in Vulkan
Assume a vertex buffer in device memory and a staging buffer that's host coherent and visible. Also assume a desktop system with a discrete GPU (so separate memories). And lastly, assume correct inter-...
1
vote
1
answer
609
views
OpenGL program doesn't show a triangle
I am following a tutorial on OpenGL in C++ and for some reason the exact same code doesn't work for me.
It is supposed to display a triangle, but it doesn't show anything.Just a blank screen.
Here is ...
0
votes
0
answers
1k
views
OpenGL - How can I delete vertices from a Vertex Array Buffer?
My current implementation of removing vertices from the buffer is by copying the portions of the buffer before and after the section of vertices I want to remove, into a new buffer.
However this ...
2
votes
1
answer
282
views
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 * ...
0
votes
1
answer
254
views
How do I incorporate Vertex Buffer Array into my graphics program?
I am writing a 3d graphics toolkit for Python and PyQt5, using PyOpenGL. I am writing my own shaders to go with it, if that helps. What I am trying to do is go from using glBegin to using a Vertex ...
4
votes
2
answers
2k
views
how can I update dynamic vertex buffer fastly?
I'm trying to make a simple 3D modeling tool.
there is some work to move a vertex( or vertices ) for transform the model.
I used dynamic vertex buffer because thought it needs much update.
but ...
3
votes
1
answer
2k
views
Passing VBO to shaders with different layouts
If I have a vertex shader that expects this...
layout(location = 0) in vec3 aPos;
layout(location = 1) in vec4 aBoneWeights;
layout(location = 2) in vec4 aBoneIndices;
How do I pass a a VBO that is ...
0
votes
1
answer
276
views
Fastest algorithm to lookup which triangles share a vertex
There are index and vertex buffers like the ones described here to draw triangles.
Frequently in my code, I need to lookup which triangles share a specific vertex. The most basic approach is:
To loop ...
0
votes
1
answer
475
views
Multiple draw calls with single vertex/index buffer?
I want to imlement simple bullet trail (in OpenGL-ES 2-3) system that will allow use different textures or materials for different trails, so it means, that that trails meant to be rendered in ...
2
votes
1
answer
599
views
OpenGL Index Buffer Object element order incorrectly drawn
Notice how my program draws a single triangle, but instead what I am trying to express in code is to draw a square. My tri_indicies index buffer object I believe correctly orders these elements such ...
1
vote
1
answer
1k
views
VertexArray glVertexAttribPointer GL_INVALID_VALUE 0x0501
Writing an OpenGL program to draw a square on screen, but running into an invalid value error. The error occurs on the call MyGLCall(glVertexAttribPointer(i,. MyGLCall is an abstraction of GLCALL to I ...
1
vote
1
answer
460
views
Confusion about binding the index of a non-existent attribute using glVertexAttribPointer
When binding an attribute index using glVertexAttribPointer, what happens when an associated program does not contain an attribute at said index?
Is the behaviour undefined, or is the attribute ...