Jump to content

View more

Image of the Day

New ninja for my game.
#screenshotsaturday #gamedev #indiedev #IndieDevHour
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.

Sign up now

Bizzare bug with OpenGL

2: Adsense
  • You cannot reply to this topic
3 replies to this topic

#1 GutenTag   Members   


Posted 13 March 2017 - 05:17 PM

So I've been hammering away at my code for a while, trying to resolve this bug, with absolutely no progress being made.

Mostly due to how utterly random and unpredictable this bug is.


So this is how the scene works when everything is working fine



And when the bug kicks in



As you can see, the bug only prevents my cubemap skybox, model, and light source mesh from rendering, but the orthogonally projected 2d elements are just fine.


I've ruled out shaders, as even the simplest of shader programs still experience this problem. I use ASSIMP to load in mesh files and SOIL to load textures, but up until about a day ago they have worked flawlessly.


There is absolutely no pattern to when this happens, the only way to resolve it is to just keep restarting the program until the desired output appears. That is obviously not a good solution. I'm at a complete loss and need help, as opengl doesn't push out an error or anything. I don't know where to even begin looking for a solution. Could EBO's or frame buffers cause this? As I have started implementing those recently.

#2 GutenTag   Members   


Posted 13 March 2017 - 06:31 PM

Never mind, turns out that my mouse look code was running into problems where if delta time was zero it caused all kinds of strange issues.


This has since been fixed.

#3 Navyman   GDNet+   


Posted 13 March 2017 - 08:00 PM

@GutenTag, sometimes the causes are so small. 

Developer with a bit of Kickstarter and business experience.


YouTube Channel: Hostile Viking Studio
Twitter: @Precursors_Dawn



#4 C0lumbo   Members   


Posted 14 March 2017 - 02:44 AM

Whenever I fix a bug, particularly one that takes a lot of time, I spend a moment thinking about how it could be avoided or caught faster in the future. Usually that involves adding some asserts.

In this case, the trick is to enable floating point exceptions - at least on your PC build - with floating point exceptions enabled you'd have crashed immediately on the divide-by-zero and would have fixed the bug in just a few moments : https://randomascii.wordpress.com/2012/04/21/exceptional-floating-point/