Skip to main content
Share Your Experience: Take the 2024 Developer Survey
13 votes
Accepted

How to do error handling with OpenGL?

Yes, there is a better way! 😊 OpenGL 4.3 and later support the glDebugMessageCallback API, which allows you to specify a function in your app that GL will call to ...
Nathan Reed's user avatar
  • 25.1k
8 votes

How to do error handling with OpenGL?

While Debug Output is good, and manual glGetError usage is adequate, it's often better to employ a more dedicated tool for finding exactly where OpenGL errors came ...
Nicol Bolas's user avatar
  • 9,832
4 votes
Accepted

What is this glitch where objects get stretched to infinity?

Hard to say without seeing a visual of the glitch, but what you describe sounds like one or more vertices of the affected model having bad data, or coming out bad from the vertex shader somehow. The ...
Nathan Reed's user avatar
  • 25.1k
4 votes

Debugging tools for OpenGL on macOS

UPD: Intel GPA dropped macOS support for some reason. Intel GPA Metal support page says Metal is not supported too, maybe that was before they dropped macOS version completely. If you're lucky you can ...
Max Philippov's user avatar
4 votes
Accepted

Debugging tools for OpenGL on macOS

There's nothing like frame capture for OpenGL on macOS, unfortunately. But there are 2 other tools that are useful for GL debugging: OpenGL Profiler and OpenGL Driver Monitor. You can read about them ...
user1118321's user avatar
  • 3,421
3 votes

How can I debug GLSL shaders?

The solution that worked for me is compilation of shader code to C++ - as mentioned by Nobody. It prooved very efficient when working on a complex code even though it requires a bit of setup. I have ...
SpaceKees's user avatar
3 votes

How can I debug GLSL shaders?

This is a copy-paste of my answer to the same question at StackOverflow. At the bottom of this answer is an example of GLSL code which allows to output the full ...
Ruslan's user avatar
  • 416
3 votes
Accepted

Should I prefer an AMD or Nvidia GPU for studying graphics programming, especially with respect to vendor specific debugging tools and ecosystem?

If you want to learn OpenGL X.Y or DirectX A.B then shop for hardware that supports that specification. If you're using other software (Blender, Maya, 3DSMax, etc) you'll want to make sure it's ...
Pikalek's user avatar
  • 377
3 votes

How can I chase down VRAM & GTT memory leaks?

Assuming your code has several locations that can allocate/release GPU memory, but you don't know which one leaks. Maybe you can try to add a GPU memory monitor to that code. When GPU memory is ...
wip's user avatar
  • 1,861
3 votes

How can I chase down VRAM & GTT memory leaks?

Probably not. Most OpenGL resources (framebuffers, vertex buffer objects, textures &c.) are controlled by host code (i.e. your C++ code), but take up GPU memory. OpenGL doesn't make it very easy ...
Dan Hulme's user avatar
  • 6,830
2 votes

Subtle bugs in Fortune's algorithm implementation

This commit contains the fix of the bug. In short, it is wrong to disable event for second edge, during event checking, when first edge may be truncated sooner then stated by its current associated ...
Tomilov Anatoliy's user avatar
2 votes
Accepted

Unexpected behavior when polygon goes off the side of the camera

You need to add clipping. When a vertex goes behind the near plane in camera space, it still gets projected to the screen which leads to these issues. You need to find where the edges of your triangle ...
RKM's user avatar
  • 36
1 vote

BVH uses aabb for a sphere in Ray Tracing: The Next Week

I agree with @xasp's answer, but to understand why you would do it like that: Checking for ray-circle intersections is not the most expensive in terms of cpu-time required, but a ray-aabb intersection ...
AnnoyinC's user avatar
  • 312
1 vote
Accepted

BVH uses aabb for a sphere in Ray Tracing: The Next Week

It does indeed do exactly what you described. Have a close look at how the bvh is constructed, it is a passed a list of concrete shapes that implement hittable, e.g....
xasp's user avatar
  • 26
1 vote

Why does my image has a square pattern in cuda path tracer?

I managed to fix it. It was indeed related to repeating random sequences. The problem was the following. curandState* randState is an array of ...
Kaan E.'s user avatar
  • 461
1 vote

How to do error handling with OpenGL?

If you can't go to OpenGL 4.3 (or your implementation doesn't support glDebugMessageCallbacks), you can simplify your code in a number of ways. The first is to ...
user1118321's user avatar
  • 3,421

Only top scored, non community-wiki answers of a minimum length are eligible