438 questions
Best practices
0
votes
0
replies
24
views
How to display a lot of line_strips efficiently with ModernGL
I need to display many (a lot) 3d trajectories with modernGL.
For now, I chain the trajectories and I create two arrays only (one for all the vertices and one for their colors) that I pass as params ...
0
votes
0
answers
54
views
OpenGL 4.6 and context sharing with GLFW3 [duplicate]
I have recently moved on newer hardware (laptop with rtx 5070) and so with new nvdia driver (version 575). I am now using OpenGL 4.6 rather than 3.3 I used before and now I am struggling ...
0
votes
1
answer
97
views
glGetProgramResourceIndex returning wrong indices [closed]
I'm using a generic mathod to bind buffers (uniform buffers, shader storage buffers, ...) to my shader programs, based on glGetProgramResourceIndex() function and buffer's name, but sometimes I'm ...
2
votes
0
answers
124
views
How do you query an Intel GPU for total memory?
I'm currently getting a GPU's total memory from GL_NVX_gpu_memory_info or GL_ATI_meminfo. However, testing this code with an Intel Arc card neither extension is supported (makes sense). However, ...
-1
votes
1
answer
36
views
How to call glTexImage2D properly using GLFW in C#
I was trying to set up texture rendering for an OpenGL project I was working on and I can't get it to work because apparently the glTexImage2D function's last parameter in a nint. I looked online and ...
2
votes
1
answer
582
views
Value of gl_DrawID when calling glMultiDrawElementsIndirect with instance count set to 0
Suppose I have three meshes A, B, C in one VBO and used glMultiDrawElementsIndirect with the instance count set to 1, 0, and 1 for A, B, and C respectively and the draw count set to 3. What would be ...
0
votes
0
answers
71
views
Passing extra variable to fragment shader completely breaks the shader program
The vertex shader:
in vec3 a_Position;
in vec4 a_Color;
in float a_Width;
in vec4 a_JointProduct;
in int a_EntityID;
layout(location=0) out vec3 pos;
layout(location=1) out vec4 color;
layout(...
0
votes
1
answer
125
views
How to create a SSBO with dynamic size
I have looked everywhere but couldn't find one that used DSA (Direct State Access). I need a SSBO with dynamic size so that I can update my instances WITHOUT having a limit like MAX_INSTANCE_COUNT.
At ...
4
votes
1
answer
271
views
Why did glGet with GL_POLYGON_MODE returns two values?
When getting the mode of GL_POLYGON_MODE, glGetIntergerv(GL_POLYGON_MODE, data), I'll have to make data an integer array of size 2.
because I've read somewhere that:
params returns two values: ...
0
votes
1
answer
320
views
How do I get glBindTextureUnit() to work?
The following works fine:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_ID);
But when I replace it with this, it doesn't work. (I don't get any errors, just a black color instead of ...
-1
votes
1
answer
76
views
OpenGL shadow acne visual error without shadows implemented
so I'm having a problem with what it seems to be shadow acne (as far as I can tell), but the thing is that I have not yet implemented shadows of any type. I have implemented Phong Lighting model (...
0
votes
1
answer
329
views
sampler2D in compute shaders, compilation errors
I'm trying to port a Windows program to GNU/Linux, but a compute shader doesn't compile.
I have a few knowledge of GLSL. So I wonder if there are workarounds to get the shader working.
I have written ...
0
votes
1
answer
193
views
OpenGL shader uniform is not recognized in the code
I am currently trying to learn OpenGL, and I have the following issue: when I use glGetUniformLocation to locate my shader uniform, it simply cannot find this uniform. Do you have any idea why?
My ...
-1
votes
1
answer
95
views
Buffer read-back working depends on order of bind/map with DSA
I am trying to perform read-back of SSBO data in OpenGL. For this I persistenly map the SSBO, but the following piece of code does not actually read back the written data from the example compute ...
0
votes
1
answer
95
views
What happens to buffer attached to VAO via glVertexArrayVertexBuffer after deleting buffer?
I'm using OpenGL4.5, and using Direct State Access where possible. I wrote basic wrappers around VAO and buffer objects. I'm using glVertexArrayVertexBuffer to bind a buffer to a VAO. I'm wondering if ...