As of May 31, 2023, we have updated our Code of Conduct.

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.

151 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
0 answers
684 views

Code runs differently on different hardware

I wrote a 2D fluid-solver in OpenGL (code here) some time back. While it runs flawlessly on my onboard Intel GPU, the simulation very quickly "blows-up" when same code is run using nvidia card : ...
nilspin's user avatar
  • 81
7 votes
0 answers
257 views

Cannot use more than a couple of MB in a shader storage buffer

I am implementing a simple ray tracer with OpenGL. I have a shader storage buffer with all the triangles so I can test them for intersections in a compute shader. It works fine up to a certain buffer ...
gartenriese's user avatar
6 votes
0 answers
1k views

OpenGL texelFetch causes black stripes

THE SHORT VERSION In my fragment shader I'm reading (using texelFetch) multiple times the same texel from a texture (created by another fragment shader) and write it to the output render buffer. ...
Christian_B's user avatar
6 votes
0 answers
883 views

Drawing to framebuffer texture - texture then split in half

I am doing exercises from the OpenGL SuperBible 6th Ed. I have managed to set up rendering into a framebuffer texture and then rendering from that texture to a cube. But for some reason, when the ...
Paweł Pela's user avatar
5 votes
0 answers
1k views

Cascaded shadow maps. Seams between cascades

I implemented cascaded shadow maps, where shadow maps for each cascade is rendered to one canvas: The light projections for each cascade are calculated from the bounding spheres of camera sub-...
Zheden's user avatar
  • 151
5 votes
0 answers
1k views

How to disable Perspective Correction in Texture Coordinates Interpolation in OpenGL(without using shaders)?

I need to do planar reflection mapping in OpenGL. By using a virtual camera (with a reversed camera ray) at the back of reflective plane (a mirror), I rendered the scene to texture, which is then ...
DQLin's user avatar
  • 51
5 votes
0 answers
318 views

How to make double working in OpenGL 4.1 on OS X ( Intel HD Graphics 5000 )?

I've recently rebuild shaders for my program and it stopped "working" ( black screen ) on OS X ( El Capitan ), but it's ok on Linux on GTX 660. I've tested it on another Apple hardware and it worked ...
Marqin's user avatar
  • 151
5 votes
0 answers
335 views

Indexing gl_TessLevelOuter[] with gl_InvocationID on a tessellation control shader

I'm using hardware tessellation to render a terrain mesh with variable LOD. I have this snippet on my tessellation control shader: ...
MadEqua's user avatar
  • 238
5 votes
0 answers
352 views

Incorrect instanced rendering

Previously, to render a bunch of quads, I was simply using a few uniforms (one for a model matrix and another for the texture layer ID). However, I'd rather not have to loop through each quad and set ...
Darkilon's user avatar
5 votes
1 answer
2k views

Manually fetching 8 neighboring texels from 3D texture greatly decreases performance

I'm implementing manual interpolation between texels in a 3D texture to be able to discard some of them when needed. Compared to hardware interpolation, this process takes a lot of time. If I simply ...
Pavlo Muratov's user avatar
4 votes
0 answers
688 views

How to implement PCSS correctly?

I'm trying to implement PCSS in OpenGL/GLSL, but I have problems understanding the details especially the conversions between the coordinate spaces. The existing implementations are so different from ...
racz16's user avatar
  • 41
4 votes
0 answers
193 views

selectively setting stencil value based on vertex property in vertex shader

Just like the question says. Is it possible to selectively set the value of the stencil buffer based on a property of a vertex, like the value of its normal, during its vertex processing phase? ...
cybergla's user avatar
4 votes
0 answers
630 views

OpenGL ES vertex/fragment shaders - Blinn phong

I'm developing a simple educational project to study OpenGL ES. I'm try to render some simple OBJ models using Blinn-Phong. The first version of the of my implementation calculate all the lighting ...
Fabrizio Duroni's user avatar
4 votes
0 answers
1k views

Represent vector with arrow

Another code review question. I am trying to draw an arrow to represent a vector. I have started with an unit arrow with vertices defined as follows: ...
Sayan Pal's user avatar
  • 263
3 votes
0 answers
45 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 ...
leone ruggiero's user avatar
3 votes
0 answers
142 views

What are some good examples of post-processing edge detection?

I'm trying to implement a post-processing pass to detect silhouette-edges from depth data. (by silhouette-edge of a triangles mesh I mean the triangle edges shared by a front and a back-facing ...
leone ruggiero's user avatar
3 votes
0 answers
234 views

Renderdoc reports incorrect OpenGL API usage, can't figure out why

I'm rendering some UI using an immediate-mode UI library, so each frame it produces some meshes, which I then load into buffers and render, only to get some strange errors from Renderdoc: You can see ...
Ivan Ivanov's user avatar
3 votes
0 answers
467 views

Comparing different sampling methods for GGX IBL

I have made a demo that shades a sphere with an environment map. I wanted to compare 3 different ways of sampling the environment. Uniform sampling. Importance sampling with the NDF as suggested in ...
user1754322's user avatar
3 votes
0 answers
172 views

Projective Texture / Shadow Mapping -- Why is the perspective division performed in the fragment shader?

I've just worked my way through this OpenGL shadow mapping tutorial. While I understand the basic algorithm, one thing puzzles me: During the 2nd render pass all vertices are transformed into the clip ...
rapunzel's user avatar
3 votes
0 answers
313 views

Circular pattern aliasing in voxel ray tracer

I am doing a voxel based raytracer. In other words, I first voxelize the scene using rasterization and I proceed to raytrace the volume in a 3D image to generate a final frame. Currently I noticed ...
Makogan's user avatar
  • 1,624
3 votes
0 answers
115 views

How can i achieve reflections like this?

I was in my elevator when i saw this... As you can see here that reflections are kind of stretched. What causes this? And how can we achieve something like this in computer graphics?
Ankit singh kushwah's user avatar
3 votes
0 answers
72 views

Super basic question: OpenGL version/install issue

I'm running a Python program whose GUI uses OpenGL. I'm getting all sorts of graphics error messages. I want to check the OpenGL version to make sure it's all good, but the OpenGL Extensions Viewer ...
sirconnectalot's user avatar
3 votes
0 answers
85 views

What is a good algorithm, and framework, to calculate centres of gravity or mass (cog)?

I'd like to take an photograph, subdivide it into a tesselation, either of squares, or (ideally), hexagons, and then find the centre of gravity (or, if you prefer, centre of mass) of each cell of the ...
Peter Brooks's user avatar
3 votes
0 answers
583 views

Can't render multiple VAO's?

I'm a newbie to OpenGL and I was following a series by "thebennybox" on Youtube. Specifically his series on modern opengl programming. I thought I would try to implement his Mesh wrapper using the ...
Jonathon Blow's user avatar
3 votes
0 answers
176 views

Strange behaviour of glDisableVertexAttribArray() on devices

In my graphics engine, based on OpenGL ES 2.0 I am using standardized name for shader attributes like it is done in libGDX (such as a_position, a_normal, etc.). When 'activating' my vertex buffer for ...
Netherwire's user avatar
3 votes
0 answers
139 views

Shadow Mapping Errors

I recently started to create a shadow mapping system in OpenTK. I ran into a problem: The depthtexture is always completly white -> no depth. Even if the color from the shader is changed (I know it ...
Flamy's user avatar
  • 31
3 votes
0 answers
273 views

Projecting light shapes

I am wondering how professional light visualizer software (like Capture Argo - WYSIWYG - Realizzer - LightConverse) project the lights on the objects (like stage, floor, people), even projecting the ...
Freddy Violato's user avatar
2 votes
0 answers
41 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 ...
J. H's user avatar
  • 21
2 votes
0 answers
94 views

AO Denoise Filter

I'm trying to implement a filter to denoise ambient occlusion data. What kind of filter do you suggest for the purpose? The techniques I've come across are the following: Gaussian filter (doesn't ...
leone ruggiero's user avatar
2 votes
0 answers
80 views

Atmospheric scattering band/seperation artifact

I am currently experimenting with some atmospheric scattering in glsl in my OpenGL engine. I am experiencing a strange phenomena where a strange band / separation artifact appears along the middle of ...
user10037795's user avatar
2 votes
0 answers
425 views

How to retrieve data from Compute Shader to CPU?

I want to retrieve data that has created by the compute shader but have no clue how it works. After researching a few forums and articles on how it should work and this is what I came up with. Compute ...
Ethan Ma's user avatar
2 votes
0 answers
140 views

What is the projection matrix of reverse (Byzantine) perspective?

I would like to construct a projection matrix for reverse perspective. I'm using OpenGL and tried to modify concepts from this excelent tutorial. I came up with: $$ \begin{bmatrix} 2\frac{(near-M)}{...
Peter's user avatar
  • 21
2 votes
0 answers
120 views

Why there are calculation differences in WebGL and OpenGL

I am currently implementing the Mandelbrot fractal on the GPU. I wrote two programs: the first in OpenGL (desktop C++ application) and the second in WebGL (static webpage). The two programs use almost ...
David's user avatar
  • 43
2 votes
0 answers
109 views

GLSL broken access operator

I've been following a guide to learn OpenGL, and I'm now learning how to do post-processing. In particular, I'm trying to apply a blur to my rendering through the following kernel: $\frac{\begin{...
Daus's user avatar
  • 21
2 votes
0 answers
491 views

fragment shader median/weigthed sum of neighbors depth values (optimization)

I've implemented a ping pong rendering that does something according to constraints on the current fragment : (1) The value of the fragment depth is equal to the median of neighbors depth values (2) ...
Raph Schim's user avatar
2 votes
0 answers
145 views

Image Laplacian incomprehension

I am reading and trying to implement a research paper. It uses openGL to define which part of an image to use in order to reconstitute a big image composited of several images. In order to do so, I ...
Raph Schim's user avatar
2 votes
0 answers
95 views

Artifacts (numerical errors?) in rasterisation renderer

This might be not laser precision question but this issue appeared a long time ago when first trying to render some scene with 3D models in rasterisation renderer and apply some lighting, ...
narthex's user avatar
  • 2,079
2 votes
0 answers
164 views

With OpenGL, is it correct to apply model transformation to rotate the camera?

Having taken a basic CG course, I remember that transformations are relative, so rotating the camera is identical to rotating the view in the opposite direction. Right now I want to implement camera ...
iksemyonov's user avatar
2 votes
0 answers
222 views

Is there a difference in how ATI cards draw triangle strips vs Nvidia cards that would cause ATI cards to output nothing?

I have a rendering system that I use for drawing height maps. The system uses triangle strips of indexed verts in a vao. The system has worked fine on the 3 Nvidia cards I have tried it on across ...
Adam Brown's user avatar
1 vote
0 answers
22 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 ...
Goatz's user avatar
  • 11
1 vote
0 answers
50 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 ...
amberbrew's user avatar
1 vote
0 answers
136 views

Silhouette edge detection alternatives to Sobel

I'm trying to implement a silhouette detection algorithm in post-processing. I've come across solutions based on Sobel/Roberts cross/... filters and I was wondering if there are more accurate ...
leone ruggiero's user avatar
1 vote
0 answers
51 views

parallelizing a software rasterizer algorithm using opencl

I've written a small software rasterizer using OpenCL and would like to optimize and parallelize it more, currently I'm scanning the whole screen and see if the triangle overlaps with the pixels.. I ...
andre_lamothe's user avatar
1 vote
0 answers
44 views

Variance Shadow Mapping (Shadow occurs when normal vector is close to light direction)

I am implementing Variance Shadow Mapping from Nvidia GPU Gems 3 Chapter 8: Summed-Area Variance Shadow Maps There they are talking about clamping the minimum variance to a very small value. I did ...
Thomas's user avatar
  • 854
1 vote
0 answers
278 views

Generating cheap perfect outlines for meshes in WebGL

I am tasked with creating an outline shader in WebGL (i'm using WASM/Emscripten, so an OpenGL solution will work too) for meshes that the user can upload into our software (be it .obj, .fbx, .3ds), ...
yosmo78's user avatar
  • 111
1 vote
1 answer
86 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? ...
R34P3R76's user avatar
1 vote
0 answers
114 views

"Interleaved rendering" in fragment shader

Intro I'm trying to render multi-channel images (more than 4 channels, for the purposes of feeding it to a Neural Network). Since OpenGL doesn't support it natively, I have multiple 4-channel render ...
Alexey Larionov's user avatar
1 vote
0 answers
278 views

Is OpenGL to Metal translation layer plausible?

I am not sure if I understood it correctly, but OpenGL is high-level like Java and Metal is low-level like Assembly, aren't they? Apple seems to have abandoned OpenGL in favour of Metal, but there ...
Damn Vegetables's user avatar
1 vote
1 answer
299 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 ...
lealericsson's user avatar
1 vote
0 answers
240 views

OpenGL: "invalid value" error after call to `glGetBufferSubData`

My first question in this community. I have following code.The code is shortened for clarity, error checks skipped: ...
user14063792468's user avatar