Sign in to follow this  
skjinedmjeet

Screen mysteriously turns black

Recommended Posts

Randomly, the display of my game will go completely black, with the exception of a few UI elements that are on-screen all the time. Sometimes this originates at start-up, sometimes it happens after half an hour of gameplay. I can't determine what causes it, although I did have a couple theories: 1 - Textures getting pushed out of video memory This struck me as unlikely, as my game uses approximately 20 megs of textures altogether, but nonetheless needed addressing anyway; To address this, I made my texture manager check to see if glIsTexture was true for a given texture, and if not, reload the texture. In fact, no textures are loaded at startup, textures are streamed on-demand. (i.e. in my texture definition file, there could be a hundred different textures, but only the ones that get references will be loaded, at run-time ) 2 - glDisable( GL_TEXTURE_2D ) was being accidentally called and not rectified before drawing more textured objects I suppose this is still a remote possibility, although I have combed through the rendering subsystem over and over; and can see no situation where this should arise. Aside from that, the randomness of the glitch's appearance doesn't seem to indicate that this would be related. (e.g., sometimes it will happen while flying, sometimes it will happen while hovering, sometimes it will happen while in the UI/menu system) My card is overheating/glitching This is the most realistic explanation I can come up with, I'm using a Radeon X800, and my game's graphics are relatively simple; so I don't see why it would overheat, but some sort of hardware related problem seems likely, simply because when I enable anti-aliasing and anistropic texturing the glitch happens slightly more often. Or at least, that's how I perceive it. I need to test a bit throughouly to actually confirm this, but I'm pretty sure such is the case. Other relevant information I'm using the latest version of GLFW for window management/input, but use my own code for loading textures. edit: What seems especially unusual is that the UI elements will often continue to be drawn (although sometimes this is not the case) - the rendering system makes no distinction between UI elments and non-UI elements; i.e. textures and geometry are all processed in exactly the same way. This is what led me to believe scenario 1 was the cause of my problems, as it would make sense that the larger (512x512 -> 1024x1024) game textures would get pushed out of memory before the smaller (64x64->256x256) textures that are used by the UI.

Share this post


Link to post
Share on other sites
Have you checked for a divide by zero error* somewhere in there, like say calculating a view matrix or calculating the position of an object?

Edit: * or the divide-by-zero's evil twin - uninitialised numeric variables? [wink]

Share this post


Link to post
Share on other sites
Quote:
Original post by deavik
Have you checked for a divide by zero error* somewhere in there, like say calculating a view matrix or calculating the position of an object?

Edit: * or the divide-by-zero's evil twin - uninitialised numeric variables? [wink]


Heh; yeah. I've been pretty thorough. I've never been able to recreate the problem in wireframe mode, so I'm assuming it is somehow connected to texturing, or at least rasterization of filled polygons.

Share this post


Link to post
Share on other sites
could be a bug in GLFW. Doesn't sound like textures at all, and by "at all" I mean not even a little UNLESS (and let me qulaify this): you use only textures (no materials, no colors), && you are not using lighting (the main reason for things going black) && your textures are generally black or have black edges. and even then, it's still not probably textures if you can see anything happening onscreen (no matter how dark).

it's when nothing shows up at all that's hard to fix. the rest is just magic numbers.
-Worst Graphics Programmer Ever

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this