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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
300 views

OpenGL blending with the screen

I don't understand how OpenGL performs the blending of a texture on the screen. By default, the clear color is set to (0, 0, 0, 0). If we use the default blending equation GL_SRC_ALPHA and ...
1 vote
0 answers
28 views

Animation issue using BVH data in OpenGL

I’m currently working on a project involving animation programming using OpenGL and BVH (Biovision Hierarchy) data for animation, and I am trying to get my head around it. I’ve run into some issues ...
0 votes
1 answer
108 views

Do GL compute shaders trigger TDR if they crash. Not just timeout?

I'm getting a TDR trigger after 4ms with a GL4.3 compute shader. tdrDelay is currently set to 30 secs, this obviously isn't long enough to get a timeout with the default Windows 11 tdrDelay value let ...
0 votes
1 answer
209 views

How to properly create textures using DSA for ImageTexture in OpenGL

For the old approach, generating a texture for the ImageTexture for compute shaders would look like this: ...
0 votes
1 answer
65 views

How to correctly handle rendering of ~600000, arbitrary colored 2D squares with WebGL?

Information I have to render a map, that is rendered as a 2d collection of squares of different color, separated by white lines horizontally and vertically. There may be ~600000 squares surrounded by ...
1 vote
2 answers
2k views

Opengl GLSL binding locations confusion

The background of this question is that I am trying to write an automatic binding system, where for each uniform variable I want to declare in my GLSL code, I call a method ...
2 votes
3 answers
2k views

vulkan perspective matrix vs opengl perspective matrix

Hi I have a slight confusion in using the opengl perspective matrix in vulkan. glm's perspective matrix works directly in vulkan just by multiplying the "[1,1 term by -1 but when I compared the ...
0 votes
1 answer
337 views

OpenGL ignores glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

I'm learning OpenGL for a personal project. I need to draw a triangle mesh as a wireframe. From what I've read, I can do this using glPolygonMode. However, the program always draws my polygons filled. ...
1 vote
0 answers
32 views

Why does my implementation of a sinusoidally time-varying color work so slowly?

I've been following TheCherno's OpenGL tutorials and I got to the point where I could render a square by using an index buffer. Now I wanted to vary the color of the square by using $$\frac{\sin(t) + ...
-1 votes
1 answer
28 views

How to implement camera translation arround object using gluLookAt?

I'm trying to move my camera around the object, a house, using some keyboard keys and the gluLookAt() function. ...
1 vote
1 answer
365 views

Problem using Decaling with Stencil to avoid Z-fighting

I need to create a decaling into a surface like a mesh, and to avoid Z-fighting I've been using Stencil Buffer to Turn-off depth test and make the decaling over the surface the Stencil Op permits. In ...
0 votes
1 answer
431 views

Unity: Pass texture pointer from OpenGL to Unity

I'm working on a scene in Unity where I have textures loaded at runtime. As a result of that, the scene is being slowed down (even with co-routines), so I thought maybe I could move the texture ...
1 vote
0 answers
31 views

How are multisample samples partitioned in OpenGL, and at which points does interpolation take place?

As I understand it, with glEnable(GL_MULTISAMPLE), glEnable(GL_SAMPLE_SHADING) and ...
0 votes
1 answer
46 views

Are stencil buffer dimensions required to match render target dimensions?

I may not need as precise pixel-perfect stenciling as my render target during stencil tested render pass. I could be okay with stencil test happening at half or quarter of resolution to save bandwidth,...
0 votes
1 answer
648 views

OpenGL state management

I am working on a software with lots of different shaders, which require different states in OpenGL. My problem is the following: The different models with different shaders are not rendered in the ...
0 votes
1 answer
95 views

Is it possible to fill in Stencil Buffer programmatically via fragment shader?

I've never worked with stencil buffers, but I'm researching if it is the right tool for my task. Basically I don't understand yet if stencil buffer can only be filled in by some hardcoded rules during ...
5 votes
1 answer
4k views

How do double-buffers work in opengl?

As I understand, the back-buffer is used for rendering the image while the front-buffer is drawn on the screen. So if you have only one image to be drawn on the screen, then you only need to swap the ...
1 vote
1 answer
75 views

Confusion about glVertexAttribPointer and non-active attributes

When binding an attribute index using glVertexAttribPointer, what happens when a later bound program does not contain an attribute at said index? Is the behaviour undefined, or is the attribute ...
1 vote
1 answer
419 views

PNG textures render correctly in Blender, but not in OpenGL program

I've been following the OpenGL tutorials from ThinMatrix and I've been able to load and render his stall.obj model along with his stall.png texture just fine. But when I try with my own models and ...
0 votes
1 answer
68 views

OpenGL 3.0 is not supported by the OpenGL driver - RizomUV

I have a problem with RizomUV 2022.0. When the program starts, it comes up with pop-up "OpenGL 3.0 is not supported by the OpenGL driver", so I can't import any geometry and work. I'm ...
0 votes
0 answers
50 views

Vertex attribute alignment <4 bytes

I know that vertex attributes sourced from vertex buffers in OpenGL need to adhere to the basic alignment requirements of their base types, so e.g. 4 bytes for floats or uints. However, I am unable to ...
0 votes
0 answers
32 views

interpolated normal vectors after tessellation. How to hash patch corner / edge vertices?

I have a 3D geometry (an asteroid) that is to be tessellated with respect to the camera position. Each vertex in the original mesh has a unique position and is stored once (VBO with IBO) In the ...
0 votes
1 answer
99 views

Question about using glVertexAttribArray

After defining an attribute pointer, why can't I just reuse it? I have a VAO bound so shouldn't it just accept the AttributePointer I defined with the last VAO? ...
0 votes
1 answer
26 views

Is MultiDrawElementsBaseVertex bound by index type?

With glMultiDrawElementsBaseVertex it becomes possible to render multiple sets of indices in one draw call. When using for instance ...
0 votes
1 answer
41 views

Tessellation evaluation shader: vertex duplicates on triangle tessellation

I was very surprised when I ran my tessellation evaluation shader, which only counts the number of vertices through an atomicAdd command. for the following tessellation levels: ...
0 votes
1 answer
20 views

OpenGL texture unit bindings - Why is a single texture mapped to both texture units when each are individually assigned?

I am using NVIDIA Nsight to debug my OpenGL state. In the screenshots below: I generate a single texture with the ID 10. I activate ...
1 vote
2 answers
548 views

Efficiently transferring only needed parts of the vertex data to the GPU (C++/OpenGL)

I have a situation, where I have an array of vertices on the CPU side, for which, besides rendering-relevant data, like their position, I have a lot of other data at each vertex. All vertex data is ...
0 votes
0 answers
36 views

Find good gl_TessLevel for edge distance and edge length

I have a triangular mesh that is read from an ".obj" file and is to be tessellated with respect to the camera position. I try to avoid T-junctions by tessellating common edges with the same ...
0 votes
1 answer
119 views

Keep constant number of visible circles in 3D animation

I have created a 3D animation with a perspective projection of white circles moving randomly in a fake 3D space projected on a 2D computer screen (GIF 1). Since I need to keep the same number of ...
0 votes
0 answers
95 views

Loading Gltf model pbr texture produces insane results

I built a gltf-viewer on my own, but the functionality for loading glf was implemented by referencing gltf-viewer-tutorial, the result is not correct. Below is my ouput for ToyCar.gltf . The ouput of ...
1 vote
1 answer
126 views

is there an universal way to set a uniform?

so I'm working on a game engine. It's partially python and c++. One part that is currently a pain point is setting the uniforms for shaders. Currently I have to define a behavior for all 50+ methods ...
0 votes
1 answer
294 views

Raytracing in OpenGL or Vulkan?

I was looking at this glass ball rendering with an image inside of it (zoom out to see the glass ball), and noticed that it looks like they simulate the refraction of light as it crosses from inside ...
1 vote
1 answer
105 views

Is glDeleteBuffers/glGenBuffers needed if I want to resize the buffer?

Firstly the VBO was initialized like below: ...
0 votes
1 answer
67 views

How to scale down noise frequency?

I'm making a space game and so far what I have is a system to generate spheres with noise on them, making them planets. I make a sphere, create noise data, write that data to an image file, and then ...
0 votes
1 answer
42 views

My projection matrix for OpenGL fails on non-symmetric boundaries

Assuming my viewing volume has x coordinates varies from l to r, and y varies from top to bottom, and finally z-axis varies n to f, I derived the following projection matrix: ...
2 votes
1 answer
131 views

How is the alpha value treated when blending?

I'm struggling with understanding how blending works. Here's what I understand: when I set the following ...
0 votes
1 answer
167 views

Can I copy one texture to another perfectly with texelFetch()

Imagine I have two uncompressed, 2D textures A and B with identical sizes and formats. I bind A to texture unit 0, and B to a framebuffer object. If I draw a full-size polygon in that framebuffer with ...
0 votes
2 answers
258 views

OpenGL compute for sizes that aren't a multiple of "local_size"

I've been going round in circles trying to understand OpenGL compute shader "work groups" and it's doing my head in. It's all about as clear as mud. In my compute program I have to set a ...
0 votes
1 answer
426 views

OpenGL compute local size vs. performance

Does anybody know if using very small local sizes in compute shaders will hurt performance? eg. If I do this in a shader: ...
0 votes
0 answers
48 views

Given 2d control points, how to write a vertex shader that evaluates a cubic bezier curve?

I need to write a program that evaluates a cubic bezier curve, using threejs and vertex shader. I tried to calculate the bezier curve based on the x axis and the control points using the cubic bezier ...
0 votes
0 answers
56 views

Why do I get a black scene in OpenGL in Python?

I'm building a scene: a cylinder, and a torus and an icosahedron spin around it, enter the fog and exit the fog. Using a file with a fog texture (any). However, I get a black scene at the exit - why ...
3 votes
0 answers
54 views

Intel UHD extremely slow copy operations

Is there a way to make copy operations such as CopyResurce(d3d11) and glBlitFramebuffer(ogl) on multi-sample resources faster ...
0 votes
1 answer
64 views

Why can't I get fog on OpenGL?

I am creating a cylinder, and there is fog around it. I can't handle two things: the inner surface of the cylinder, realized as a smaller diameter cylinder, actually gives me just a second cylinder ...
1 vote
1 answer
191 views

Having trouble rendering entire sphere

I'm working on a program where I need to draw spheres. The method I'm using is creating an octahedron And using tessellation shaders to subdivide it into a sphere, however there is a patch of the ...
2 votes
0 answers
45 views

Optimal Command Ordering for CPU/GPU concurrency

I am writing a renderer that uses a deferred clustered shading technique. On the CPU I group lights, decals, and environment maps into 3 seperate clustered structures (functionally, arrays of unsigned ...
1 vote
0 answers
938 views

How Skia uses OpenGL backend?

Skia 2D's one notable backend in OpenGL, but how does it work under the hood to render? Say, we need to draw an anti-aliased circle. Does Skia: make a quad (using 2 triangles) and paint the circle ...
1 vote
0 answers
26 views

How to get back project point cloud from rendered rgbd images by rgbd?

Given a sequence of RGB-D images rendered by blender and the camera parameters for the blender camera(Perspective Projection camera). How can I back project the RGB images with depth map to a RGB ...
0 votes
1 answer
70 views

OpenGL get default depthbuffer

I have an application that uses only the default opengl framebuffer. It is initialized with color and depth buffer. I want to use the depth buffer as a uniform within a shader to access the current ...
1 vote
0 answers
58 views

How does changes in vertex data work?

I have been learning computer graphics and for some time and can't seem to wrap my head around one concept. How to handle vertex data changes? Ex. 1. I have a text rendering on a screen. And up on ...
2 votes
1 answer
277 views

How does Unreal Engine 5's Lumen (most likely) implement reflections?

In this YouTube video, the creator mentions that reflections in Unreal Engine 5's Lumen "work by tracing the path of light as it bounces off of surfaces in the game world." Does this mean ...

1
2 3 4 5
15