38,020 questions
1
vote
1
answer
174
views
My Compute Shader doesn't have any outside effects
I'm trying to write a compute shader in GLSL with OpenGL, GLFW, GLEW, and GLM. The problem is that the compute shader either isn't running or isn't modifying any buffers. I have the latest NVIDIA 4060 ...
2
votes
1
answer
121
views
Rendering Text glitches and shows text quads behind and wrong color hex
I am trying to make a function in my game engine to draw text with stb_truetype , The problem is that when rendering it , for some reason there's black boxes behind the text and even when the color ...
-1
votes
1
answer
297
views
How do I link GLEW (OpenGL) on a Mac M1 in vs code
I'm programming in C++ and I've already linked GLFW in the project, however, I can't figure out how to add GLEW to the project. I tried downloading it from their website but unzipping the folder gives ...
2
votes
1
answer
73
views
How would I store the depth information for multiple color targets if my OpenGL FBO allows multiple color attachments but only one depth attachment?
If OpenGL FBOs have a provision for multiple colour targets with GL_COLOR_ATTACHMENT0 to GL_COLOR_ATTACHMENT31 but only one depth/stencil target with GL_DEPTH_STENCIL_ATTACHMENT, then how would I be ...
0
votes
2
answers
181
views
Attach Weapon to Character Hand
My "engine" is heavily based on this article.
The overall Question:
How to attach weapon to "character arm"?
Although animations work for all characters and animations at mixamorg ...
1
vote
1
answer
170
views
Segfault when rendering a triangle?
I compile fine but get a segfault. Is it something to do with GLchar * fragmentShaderSource and GLchar * vertexShaderSource?
I have:
#include <iostream>
#define GLEW_STATIC
#include "shader....
1
vote
1
answer
223
views
Rendering an object that is partially opaque and partially fully transparent
I have a problem when I'm trying to render a transparent object. I only have one mesh so one drawcall and if the object is a little complex like a plant I can see through the object, you can see that ...
7
votes
1
answer
357
views
How to correctly share a texture from DX12 to OpenGL?
Under normal circumstances, creating a shared handle in DX using CreateSharedHandle, then using glImportMemoryWin32HandleEXT in OpenGL should allow sharing. I tried rendering a triangle in DX and ...
1
vote
0
answers
120
views
How to use OpenGL3 + (VAO, VBO) to draw lines with mouse click?
I'm trying to use glfw+glad to draw lines with mouse click input coordinates. At first i tried to use glBegin, glVertex2f but they seems to be no longer supported in OpenGL3+. So i tried to use VAO, ...
0
votes
1
answer
111
views
What is common practice for storing a bool to determine if a key is held?
I am new to OpenGL and using GLFW for input. I recently have been developing a simple program to create shapes when clicking the left mouse button. If the left mouse button is held down, the shape ...
1
vote
1
answer
211
views
OpenGL window is unresponsive, fully white, and closes itself after a few seconds
I'm running this on Visual Studio 2022, with the Win32 (x86) platform. The same bug occurs on x64, though, I've tested it.
I have found no errors in my code, but still I've tried adding compile error ...
0
votes
0
answers
108
views
Smoothing normal on GPU (using geometry shader) without knowledge to adjacent faces
Smoothing normal on GPU might be a common question because you really can generate flat normal by triangle primitives , but you don't have adjacent faces so it is not possible to smooth normal . I ...
4
votes
1
answer
219
views
Why is an OpenGL positional (spot) light interfering with non-positional light on MacOS
I have a legacy OpenGL fixed-pipeline app which has been ported from Windows (32-bit) to MacOS 64-bit.
The problem is that if I have a scene with a non-positional light, everything works great. If I ...
0
votes
0
answers
116
views
QLayerFilter and QObjectPicker doesn't work properly in Qt3D, are there any alternatives?
There is a potential bug in Qt3D that prevents meshes instantiated with different QLayers from functioning properly with a framegraph containing two or more QLayerFilter nodes. But implementing ...
0
votes
1
answer
161
views
glReadPixels() returns background color?
I am trying to get the colour which was clicked on in OpenGL via glReadPixels():
#include <iostream>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <glm/gtc/...
0
votes
1
answer
140
views
How many times vertex-shader , geometry-shader and fragment-shader separately are called to draw one frame?
In order to draw one frame , or to say given an array of vertices , while this array being transmitting and passing through stages of a shading program , is there a strict correspondence between ...
1
vote
1
answer
43
views
PNGDecoder in LWJGL returning few negative values
I am using PNGDecoder to decode a png that is a height map. Howerver, when I am just printing the values returned in console I see few of the rgb values are returned as negative
-128, -128, -128, -1
-...
6
votes
1
answer
76
views
How can I fix hard face translation when sampling lower mips of the texture cubemap?
I've got a texture that I want to use as a indirect radiance light.
There is a problem that when I sample this texture's lowest mip the result looks like this:
but actually should look like this:
I ...
1
vote
0
answers
68
views
tbb freezes glfw window
When I use tbb::parallel_invoke to separate the input loop from the render loop into two different threads, both loops are running, but the window from glfw freezes immediately.
The following is the ...
0
votes
0
answers
63
views
Loading different OpenGL backend libraries under the same name
I am trying to build a fallback mechanism for OpenGL drivers in an application that uses GLFW and GLAD, where if the system provided library does not support 4.5 version, a Mesa implementation is used ...
0
votes
1
answer
137
views
Where is glClear and glClearColor defined using GLEW and SDL2?
I'm using windows 10, vs 2019, GLEW 2.1.0, and SDL2. I'm pretty sure that I have everything linked. I've triple checked.
I have all the version information and stuff like that set, since I'm following ...
-1
votes
1
answer
110
views
How do I get world coordinates from mouse coordinates in OpenGL with Camera class?
I am trying to convert mouse coordinates to world coordinates in OpenGL and I am using the camera class from learnOpenGL.com, which is this. And I'm using this function for converting cursor space to ...
1
vote
0
answers
61
views
What is the most efficient way to use VAOs?
Each mesh is the set of a VBO and an EBO, assuming you have multiple meshes with the same vertex format (ex: position, color), you could use the same VAO for each mesh, like this:
...
GLuint ...
0
votes
1
answer
104
views
Rotate camera around a pivot point calculated from mouse click on the screen
My model is shifted to another position on the screen after select pivot point on the 3D model.
I'm trying to use the GL.LookAt to implement the rotation around pivot point feature.
GL.MatrixMode(...
2
votes
1
answer
313
views
Reading from `out` function argument in GLSL
In GLSL, is it legal for a function to read from an out argument, after it has already written to it?
For example
void f(out float x) {
x = ...
x = sqrt(x);
}
Or is it needed to write it as
...