Weird colors on Clear()

Started by
7 comments, last by DrunkenHyena 19 years, 2 months ago
Hi , In my game , i display a loading screen between levels . The loading screen is basically an animated gif on a screen cleared to 0,0,0 (black). Ive noticed that when the loading screen is up weird colors flash across the screen - this does not happen when a level is active. I've read somewhere that DX will fill vram with garbage values in debug mode. I've built my code in release mode and still notice this behaviour ... is it cos my DX runtime is still the debug version ?? Or is this another problem. ? Thanks
Advertisement
The Debug Runtime of Direct3D will fill the back buffer alternately with 0x00FF00FF and 0x0000FF00 when you call Present() I believe, but it might be on a Clear() to black.

It doesn't matter whether your code is in debug or release.
So this will not happen in the retail version of DX ?
Quote:Original post by species8472
So this will not happen in the retail version of DX ?

Probably not, however - being the debug runtime it's telling you something is wrong. If you can, you're best off fixing it..

I've had the green/pink alternating screens due to bugs before - when I deployed it (having not fixed it), people emailed me back saying they got all sorts of random stuff briefly appearing - copies of the windows desktop, "noise", distorted parts of textures..

On the other side of things - it isn't (that I know of) a fatal error. Your application should carry on just fine so it's more of a presentability problem if anything.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

it sounds like you're not including the D3DCLEAR_TARGET flag.
Quote:Original post by Lee_
it sounds like you're not including the D3DCLEAR_TARGET flag.

It can also occur if you change the D3DPRESENT_PARAMETERS structure used when you create a device. It can affect the way the hw/driver deals with a frame buffer when its done with it, which, if combined with odd D3DCLEAR_TARGET usage can cause problems.

I'm at work right now and a bit busy to check the specifics of it - but the field in that struct thats got _DISCARD, _SWAP etc...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Jollyjeffers ...

Given that u say there may be issues and that DX is warning me - any idea of wot type of issues we're talking abt ???
Quote:any idea of wot type of issues we're talking abt ???

The one I described about the pink/green alternating in debug but giving random garbage for retail is the best example I suppose.

At least for a commercial quality game, its a warning that you're doing something that might look a bit rubbish when your paying customer plays it.

Maybe it won't be a problem - but you can bet that in a serious case where you got lots of garbage appearing between the odd frame it's gonna look bad.

Another, different example, is that you can end up relying on default/undefined values/settings - the debug runtime will explicitly show you this by trying to break your program. The retail runtimes and drivers won't necessarily do this - but it could be the cause of some interesting bugs people will probably blame your software for!

If I were you, get the DX control panel and ramp up the debug output to maximum - see if/what it tells you. Usually its quite helpful!

Cheers,
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

The Forum FAQ has more info on debugging D3D apps if you need more information.
Stay Casual,KenDrunken Hyena

This topic is closed to new replies.

Advertisement