Questions tagged [opengl]
OpenGL (Open Graphics Library) is a graphics standard and API which is platform independent and available for desktop, workstation and mobile devices. It is designed to provide hardware-accelerated rendering, and hence gives greatly improved performance over traditional software rendering. OpenGL is used for applications like CAD software and computer games. The OpenGL standard, as well as OpenGL ES, is controlled by the Khronos group.
opengl
38,081
questions
0
votes
0
answers
7
views
Problems with OpenGL text rendering - OpenGL reuses VAO/VBO/texture IDs after deleting them
I'm making a graphics library, and working on a text rendering system. There is a CharRenderable class that simply contains a VAO, VBO, and texture ID. It loads the texture of a given character using ...
0
votes
0
answers
8
views
"EXCEPTION_ACCESS_VIOLATION" When Creating a Window with OpenGL in IntelliJ IDEA
I'm interesting in learning Java graphics and game development in general with OpenGL so I was trying to get LWJGL set up in IntelliJ IDEA. I'm pretty new to programming so forgive me if I'm missing ...
0
votes
0
answers
21
views
OpenGl to Visualize images
I am trying to use opengl to visualize a image with 16 bits depth because with GTK i was limited to 8 bits. GdkPixbuf has limitations and i need represent the image with all values without changes. I ...
0
votes
1
answer
27
views
Does My OpenGL Device really only support 90 Uniform Buffer Objects?
I am trying to create an OpenGL application that needs a lot of UBO, although a single shader only needs to be able to bind to 6-7 UBO's. And So I was trying to create a bunch of binding points for ...
-2
votes
0
answers
25
views
How to declare an int varying in GLSL 130? [duplicate]
Im playing with the minetest source code so Im stuck in glsl 130. Id like to add int my_int to every mesh vertex and pass that to the shader.
In the vertex shader I added:
varying int my_int;
I get ...
-1
votes
0
answers
19
views
How to monitor hardware counters in OpenGL on Intel GPUs
I'm working on an OpenGL project and would like to monitor hardware counters on Intel GPUs. I'm specifically interested in tracking performance metrics like GPU usage, memory usage,ALU count and other ...
-2
votes
0
answers
38
views
Why isn't an object displaying an attached texture with OpenGL? [closed]
I've got this 3D scene for a uni assignment and I wanted to attach a texture to a 3D object using OpenGL. The path of to the texture is correct - it's the same as all the other textures in the scene ...
-1
votes
0
answers
31
views
Trying to set dynamic index buffer in OpenGL [closed]
I'm trying to render a simple chunk in a minecraft clone to optimize the rendering process I've tried to render only the faces without blocks in front. But when doing so I am facing a lot of issues ...
0
votes
1
answer
30
views
In what scope do OpenGL binding points exist?
OpenGL allows for the creation of Uniform Buffer Objects. Each UBO lives at a certain binding point (index) from which it can be picked up by a shader (associating a binding point with a block index). ...
-1
votes
0
answers
34
views
Sphere not visible at all times while rotating around other sphere [closed]
I'm building program that draws a small sphere that rotates around the bigger sphere - kind of like the earth rotates around the sun.
Here is my drawScene function:
void drawScene(void)
{
int i;
...
-1
votes
0
answers
24
views
Why QOpenGLWidget + PyOpenGL get wrong result of picking object?
I'm using QOpenGLWidget + PyOpenGL to do 2D object picking. The problem is: when i click any location of the view, the hit returns all of the 3 boxes. When I use PyOpenGL only, it works correct. Is ...
-2
votes
0
answers
41
views
Strange Qt/OpenGL behavior [closed]
Building a Qt (v6.6.1) C++ (VS 2022) application with QOpenGLWidget.
I'm doing the following in the PaintGL function:
I set the clear color to GREEN and clear the default framebuffer
I bind an FBO ...
-1
votes
0
answers
23
views
OpenGL GenerateTexture with ComputeShader
I am playing with OpenGL Textures, I have the folowing texture: https://www.onlygfx.com/wp-content/uploads/2021/03/geometric-triangle-retro-pattern-3.png
I have a nice example on how to load it and ...
0
votes
0
answers
37
views
Error while compiling shaders with #version 300 using glium [closed]
While compiling the shaders glium panics if i had #version 300 to the them and gives me the error:
CompilationError("ERROR: #version: versions 300, 310, and 320 require specifying the 'es' ...
0
votes
1
answer
93
views
Win32: SwapBuffers() throws an exception on window resize
I am writing a win32 app that uses OpenGL. I want the window to continually update while it is being resized. My rendering code is in my main loop and DefWindowProc() enters a loop on resize, so my ...
0
votes
0
answers
20
views
Blinn Phong Implementation C# OpenTK [closed]
I'm trying to implement Blinn-Phong lighting in my lighting.frag file where I've already implemented Phong lighting. What should I change in this code to make the lighting Blinn-Phong? Here's the code:...
-4
votes
0
answers
37
views
How to proper position skybox camera using openGL and everything appears inside the skybox [closed]
I created a skybox for my project and it looks the way I wanted it to; however, there are a few issues I cannot figure out how to fix. The first problem is that I don't know how to get the box to ...
-1
votes
0
answers
29
views
OpenGL Shadow Mapping Issue: Black Screen When Using Shadow Map Texture
I am developing a 3D scene using PyOpenGL, where I'm trying to implement shadow mapping. My scene includes a cube and a flat surface, which render correctly without the shadow map. However, when I ...
0
votes
0
answers
39
views
With glTexStorage3D why cant i allocate more than 2048 2D texures and what do I do if i need more?
While using glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_RGBA8, width, height, depth); I can't set depth more than 2048 (otherwise OpenGL drops 1281 error which is GL_INVALID_VALUE), but I didn't found ...
-1
votes
0
answers
38
views
Multi threading with GLFW [closed]
I understand that OpenGL contexts are typically bound to a single thread, and making OpenGL calls from multiple threads simultaneously can lead to undefined behavior and crashes. The main loop has to ...
-2
votes
1
answer
44
views
What is wrong with my model loading strategy in my OpenGL graphics library?
I am creating a graphics library in C++ (https://github.com/jopo86/onyx for more info). So far I have made pretty good progress, you can render things using user-defined vertices, including position ...
-2
votes
0
answers
34
views
How to keep individual object's origin when importing a fbx file into OpenGL? [closed]
I have a robot model in Blender, and I want to export it as a fbx, then load it into OpenGL to make some animations. The problem is, if I don't apply transforms of all objects (hands, arms, legs, etc.)...
-1
votes
0
answers
39
views
How should I use `"PYOPENGL_PLATFORM"` on Mac OS? - OSMesa doesn't work
I've recently encountered an interesting task, i.e. to develop some code, which can recognise tumour growth and certain characteristically tumour-growth patterns of some types of tumours. I have ...
-3
votes
0
answers
40
views
Texture displaying weirdly in OpenGL C++ [closed]
I'm trying to display a texture on a square in OpenGL in C++ but it displays very weirdly. It displays it multiple times and seems to display it very small multiple times in the image. I am following ...
0
votes
0
answers
48
views
GLFW window creation fails with GLXBadFBConfig on Linux Mint? [closed]
When I execute a simple program:
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void ...
0
votes
0
answers
34
views
OpenCL segfault on call to clCreateFromGLRenderbuffer
#include <iostream>
// this stuff is allready setup in main
#define GLAD_GL_IMPLEMENTATION
#include <glad/gl.h>
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
// opencl 3.0
#...
1
vote
1
answer
35
views
Why isn't gl_InstanceID a dynamically uniform expression?
In OpenGL vertex shaders, the only builtin input which is considered dynamically uniform is gl_DrawID. I can guess that the decision to not make gl_InstanceID dynamically uniform was made to allow ...
-1
votes
0
answers
21
views
OpenGL: Model's texture doesn't show properly [closed]
i am working with some models in OpenGL and have the same problem with many models. Firstly, i successfully imported one model into Blender and everything was fine. When i try to import it in my ...
-1
votes
0
answers
51
views
VTK 9.3 show black window in MFC environment
I have a problem with a project. I know there is a plattform for vtk, but there seems to be no response to my problem anymore, so I try here.
We used for an old software vtk 5.5 and trying to port ...
-1
votes
0
answers
23
views
Pipeline for rendering 3d world in flutter from dxf/LandXML/CSV etc?
First off, this is my first real app, and it's in the very early stages. Currently it can connect to a gnss rover, display and capture its position etc.
It's purpose is to display survey data.
I'm ...
-3
votes
0
answers
26
views
In OpenGL i cannot change the color of triangles with glUniform3f(),
type void init(void){
//create and compile and vertex shader
const char *vertexText =
"#version 330 core\n"
"layout (location = 0) in vec2 aPosition;\n"
...
-1
votes
1
answer
47
views
How do I initialize OpenGL before GLFW? [closed]
I'm currently developing an OpenGL graphics engine with a focus on versatility. I aim for it to display frames in a window and also enable saving images to disk without displaying a window. To achieve ...
0
votes
1
answer
44
views
MFC App Using OpenGL to draw control, glGetUniformLocation() fails on second call
I've stripped the below code down to try and isolate/illustrate my problem. I have an MFC Picture CWnd control that I have derived to create my own CGLImage control.
I have used this method of drawing ...
-1
votes
1
answer
29
views
Render particles in the transparent parts of other particles
Problem
I am rendering a 3D cube, and this works fine. Afterwards, I render particles as an array of points, which a geometry shader transforms to quads (2 triangles). The problem I have is that the ...
0
votes
0
answers
41
views
Can I get my texture coordinates as pixel coords in 2D Game?
I have an issue with my 2D Game in C++/OpenGL.
I need to somehow get the pixel coordinates (preferably the glfw coords) of a texture that has been rendered on the screen. The final goal is to be able ...
1
vote
1
answer
32
views
How to fix "Access violation executing location" when using GLFW and GLAD
I caught this exception when running the program:
Exception thrown at 0x0000000000000000 in OpenGL project.exe: 0xC0000005: Access violation executing location 0x0000000000000000.
This is my code ...
-2
votes
0
answers
34
views
getting Access violation writing location when calling glDrawElements caused by shader
I am trying to write a program that compiles a shader with shaderc so I can load the binaries instead of compiling the shader each time i run the program. I get no errors when loading or compiling my ...
-2
votes
1
answer
36
views
Experimenting with GLFW library: window boundary problem and normalized coordinates
I'm experimenting with GLFW (compiling with g++ -o nxtBluePixel nxtBluePixel.cpp -lglfw -lGLEW -lGL ) to simply draw a blue box and move it up/down/left/right. I want to output a message "out of ...
0
votes
2
answers
42
views
How can glPushMatrix affect the rotation of an object around a rotating object? [duplicate]
I have been practicing matrix transformations for a while with a simple 2D solar system. I'm not concerned with the details about the size proportions, orbits, or distances each planet has. What I'm ...
1
vote
1
answer
36
views
Does addition-assignment cause dependency chain in GLSL?
I frequently see sample GLSL code like this:
vec4 sum = texture2D(texture, uv) * 4.0;
sum += texture2D(texture, uv - halfpixel.xy * offset);
sum += texture2D(texture, uv + halfpixel.xy * ...
-1
votes
1
answer
33
views
Compiling C++ program with Opengl and Glut in windows
I was trying to convert a project I have in codeblocks to compile in the makefile, but I'm having problems linking the opengl libraries.
I'm trying this for days and haven't been able to get it to ...
1
vote
0
answers
53
views
Using Silk.NET in WinForms
I have a project with WinForms, using GDI+ and DirectX for render some data (2d). I want to add additional renderer via Silk.NET (interesting OpenGL/Vulkan).
Have any ideas how to add silk-surface on ...
0
votes
0
answers
37
views
What happens when rendering an OpenGL buffer that has been padded with NULL (or another value)?
I have the following setup:
S - the scene that includes terrain, some houses and other man-made objects
T - a set of tree configurations that I would like to iterate through and place in S.
Every ...
1
vote
1
answer
56
views
How can I make a sphere follow an eight-like path in Python using OpenGL?
I have to make a sphere move in the shape of the infinite symbol for my computer graphics class.
I think I have managed to recreate the exact movement of the sphere in the following Python program as ...
1
vote
1
answer
36
views
OpenGL only rendering second triangle, first triangle not visible
I'm currently working on a simple OpenGL program using Python with the glfw and OpenGL.GL libraries. I have two triangles that I'm trying to render, but for some reason, only the second triangle is ...
-3
votes
1
answer
57
views
OpenGL shows black texture on quad [closed]
No matter what i try , i cant seem to make the quad show any textures, tried with solid color in the fragshader works fine, tried drawing the gradient tex coords worked fine .. as soon as i introduced ...
0
votes
0
answers
49
views
My Visual Studio 2022 consistently gives me errors saying that the GLchar variable type is undefined
I've been working on a little bit of code recently using the WIN32 API, GL.h, and GLU.h. I recently figured out that if I define a variable with the type GLchar my Visual Studio will give me an error ...
0
votes
0
answers
49
views
undefined reference to `__mingw_vsscanf' while trying to link GLFW statically on VScode
I have been trying to set up my OpenGL, GLFW and glad project for some days now and have not been met with success. At first I was getting "undefined reference to 'glfwInit()'" while trying ...
2
votes
1
answer
25
views
glBlitFramebuffer vs GL_DEPTH_STENCIL_ATTACHMENT
I have a custom framebuffer which has a depth and stencil attachment:
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, texId, 0);
Does the following operation blit ...
0
votes
1
answer
79
views
Where to get GLEXT.h?
How can I get the glext.h header file? Am I supposed to make my own glext.h file and paste all the code from the Khronos OpenGL Registry into it? Also, I'm using Windows and have the SDK, is glext ...