Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Bizzare bug with OpenGL

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

#1 GutenTag   Members   

244
Like
1Likes
Like

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

eTrQok0.png

 

And when the bug kicks in

NZ84JpU.png

 

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   

244
Like
2Likes
Like

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   Members   

9546
Like
1Likes
Like

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

 

53852.png

#4 C0lumbo   Members   

4364
Like
3Likes
Like

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/