38,106
questions
0
votes
1
answer
60
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
29
views
How to retrieve compressed texture width and height with assimp [closed]
I’m having trouble using the Assimp loader library with OpenGL. I’m able to load meshes with Assimp, but I’m encountering an issue with compressed textures. Specifically, the getEmbeddedTexture() ...
-1
votes
0
answers
30
views
Hello Triangle rendering incorrectly, mixing colors and position inconsistently from VBO [closed]
I've been following the LearnOpenGL.com tutorials trying to add a renderer to an engine I'm writing by abstracting its code into classes and am having some strange difficulty with adding colors to my ...
1
vote
0
answers
61
views
Unable to static build the application using QML
I am working on a desktop Qt (6.2.0) application with UI built on QML (used through resource). I am looking forward to create static build for this application, but it fails because libGLX.a is not ...
-4
votes
0
answers
66
views
Compiler can't find glfw3.h? [closed]
I have tried to set up my glfw stuffs:
#include <iostream>
#include <GLFW/glfw3.h>
using namespace std;
int main(){
GLFWwindow* window;
while (!glfwInit){
cout << &...
0
votes
0
answers
49
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 ...
-1
votes
0
answers
54
views
Why is ImGUI not rendering anything? [closed]
I encountered a problem while trying to set up ImGUI. I dont get any error messages or warnings but imgui doesnt render anything on my GLFW window and i dont get why. I played around with some GLFW ...
-1
votes
0
answers
41
views
Compute shader not modifying SSBO [closed]
I am sending some SSBOs to a compute shader, so it can modify the buffers. Then I am using the elements of those buffers as positions to render multiple instances of a mesh.
For some reason, when I ...
-2
votes
0
answers
40
views
Can I link libraries directories in cmake instead of copy the header, cpp files of that library? [closed]
I started wanna learn cpp and opengl. But I saw the way many people set up the project is so time consuming and complicated. I am wondering if i can use a function in cmake to link libraries ...
0
votes
0
answers
64
views
Segmentation fault when running PySide6 with OpenGL
I took this example First Steps with python + Qt + OpenGL and tried to use it with PySide 6 but I get segmentation fault error when I try to run it on macOS with anaconda (didn't try on Windows or ...
-1
votes
0
answers
25
views
How is CAShapeLayer implemented [closed]
I want to create a painting app for iOS and I saw many examples use a CAShapeLayer to draw a UIBezierPath.
As I understand CoreAnimation uses the GPU so I was wondering how is this implemented on the ...
-1
votes
0
answers
38
views
How do I render a non-default framebuffer to the screen? [duplicate]
I have a framebuffer with 2 attachments: GL_COLOR_ATTACHMENT0 for color and GL_COLOR_ATTACHMENT1 for custom integer data. However, the program is not rendering anything to the screen. How would I do ...
0
votes
0
answers
38
views
OpenGL rasterization performance across mandatory internal formats
Note that I'm asking about rasterization performance only. So, for the sake of this question, consider just the performance of rendering an untextured Gouraud-shaded triangle, perhaps with blending ...
4
votes
0
answers
112
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 ...
2
votes
0
answers
25
views
Freezing idle function in GLUT
I have an arduino that send data from accelerometer to computer, when i tried to read data exactly in idle() function it doesn't work, program just draw window with cube, and that window is freezing (...
0
votes
0
answers
71
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
0
answers
43
views
GL_INVALID_VALUE with EXT_external_objects_win32 [duplicate]
I'm trying to import texture from DXGI to OpenGL using the EXT_external_objects_win32 extension.
Sometimes it works, but I often get an error GL_INVALID_VALUE error generated. Memory object too small ...
-1
votes
1
answer
84
views
How is gl_FragCoord generated? [duplicate]
I'm thinking it is generated when program is in process of rasterization , based on gl_position. And since its range begins with (0.5,0.5) , I'd think it becomes available after a primitive is ...
-3
votes
0
answers
40
views
`glBufferData` and `glVertexAttribPointer` Not Working After Encapsulation in C++ Classes [duplicate]
I've encapsulated the glBufferData and glVertexAttribPointer functions into member functions of my VBO and VAO classes. However, when I call these class methods in my main function, the expected ...
0
votes
1
answer
113
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/...
-1
votes
2
answers
57
views
What's the point of having a single vertex attribute?
I notice that the size parameter for gl.vertexAttribPointer() can be 1, 2, 3, or 4. What is the point of having 1 attribute per vertex?
Is it for rendering lines? If that's the case, then wouldn't the ...
0
votes
1
answer
80
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 ...
-2
votes
1
answer
59
views
Characters centering weirdly in Freetype, OpenGL [closed]
I am trying to render some text inside a button (which is just a vec2 of button size and vec2 of button position), and I am trying to center the text inside the button. and it works for characters ...
-8
votes
0
answers
54
views
How do I include GLAD and GLFW3 in C++ and avoid undefined reference errors? [duplicate]
How do I include GLAD and GLFW3 in C++ and avoid errors like:
undefined reference to `glfwInit'
undefined reference to `glfwWindowHint'
undefined reference to `glfwWindowHint'
undefined reference to `...
1
vote
1
answer
23
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
-...
1
vote
1
answer
88
views
Why computed prefilter radiance map looks different in opengl api comparing to dx11?
I've got a shader that computes radiance texture in my DX11 renderer and I want to port it to opengl.
//this ifdef is only for the showcase, it's not in the original shader
// because version ...
6
votes
1
answer
63
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 ...
4
votes
1
answer
52
views
OpenGL viewport is of incorrect dimensions compared to window set to same dimension
I have a window of 600x400, the viewport on which OpenGL is rendering appears to be much smaller (pictured below).
Picture of the viewport I'm expecting and the viewport I'm getting, note most of the ...
0
votes
0
answers
46
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
1
answer
67
views
LWJGL 3 sharing context between Swing and GLFW window
I'm creating an application in Java where there are two windows, a "game view" window, and a Swing window with debug options. Included in Swing window is another view of the game, where I ...
0
votes
0
answers
56
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 ...
3
votes
1
answer
60
views
Problem with installation of open-gl in lisp
Using SBCL 2.0.3 the following script
#!/usr/local/bin/sbcl --script
(load "~/quicklisp/setup.lisp")
(ql:quickload :cffi) ...
0
votes
0
answers
48
views
How to Maintain Image Aspect Ratio When Tiling and Using a Camera in OpenGL?
I am working on rendering a large image in tiles using OpenGL. My goal is to render images in tiles, but i am struggling maintain the aspect ratio of the original image when applying a camera ...
0
votes
1
answer
55
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
vote
1
answer
32
views
Trying to get PyOpenGL Shaders to Work (Only White Screen Appearing); Maybe Vertex Wrong?
I attempted to use a pygame font surface and converting it to pixel data using data = pygame.image.tostring(img, "RGBA", 1) and then used a gl function to create an opengl texture and draw ...
0
votes
0
answers
14
views
OpenTK render objects outside of Viewport to Framebuffer's texture
I am working on a Windows Form application, I am drawing rectangles onto a GLControl in one tab.
After I'm done drawing the rectangles, I am trying to draw them into another GLControl that is inside ...
0
votes
0
answers
43
views
Rust three_d crate. Setting cull mode has no effect?
I am trying to get the culling mechanism to work, but regardless of what culling option I choose I don't see any difference in what is being rendered. Perhaps i am understanding culling wrong, or ...
-2
votes
1
answer
52
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 ...
0
votes
0
answers
71
views
Passing complex structure to Fragment Shader
I am generating some geometries, in this case the Mandelbrot Fractal. It is calculated entirely in the fragment shader. And there is a structure MandelbrotBase, containing different settings, like ...
1
vote
0
answers
49
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
58
views
Access violation inside glfwPollEvents()? [closed]
When I start my program:
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
struct ...
0
votes
1
answer
79
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(...
-1
votes
2
answers
75
views
How to render text using FreeType and OpenGL
Currently I managed to render quads which look like their corresponding characters if I'm not multiplying by sampled, but whenever I do so then the quads turn fully transparent and disappear
Setup for ...
2
votes
1
answer
80
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
...
2
votes
1
answer
199
views
Trying to load OpenGL 4.1 but only get OpenGL 2.1 on MacOS
I am trying to setup a OpenGL-based project in my Macbook Pro 14 (M2 Pro CPU, Macos Sonoma 14.5). I have basically managed to get everything working, BUT no matter what I do I cannot make the program ...
2
votes
0
answers
71
views
Confusing problem with local vs class variables and rendering with silk dot net and OpenGL
I'm trying to learn/implement OpenGL using the silk.net library and I've got a rendering framework functioning. I can add a shape to the render list from my Layer update method, and I can add a shape ...
0
votes
0
answers
37
views
OpenGL Bindless with sampler2DArray, samplerCube etc
Every bindless texture example I can find uses sampler2D but is it possible to use samplerCube/sampler2DArray/sampler3d as well?
For example something like:
layout(bindless_sampler, location=0) ...
2
votes
1
answer
67
views
Multiple models not rendering together but rendering seperately
I am building a simple test to see if I can render multiple separate objects using multiple EBOs, VAOs, and VBOs. I've gotten this to work in the past with just quads, but now that I am using a cube ...
-1
votes
1
answer
40
views
Only one texel rendering during mass batch rendering using SSBOs
First, this is my second time asking this question. The first time, I was given many different tips that I applied into this new question.
Currently, I am working upon a 2D tile renderer. Switching ...
1
vote
0
answers
24
views
Attempting to build a skybox in an OpenTK Rasterizer, no color output
I'm trying to build a simple rasterizer using C# and OpenTK. Most of my stuff is working, but when attempting to implement a skybox feature I got lost. I followed the tutorial at https://learnopengl....