Archived

This topic is now archived and is closed to further replies.

DirectDraw: previous frame still visible

This topic is 5749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m not sure how to discribe my problem, but here it goes. Right now I am plotting stars on a background by setting pixels on the backbuffer and drawing a small bitmap over top (along with clearing the buffer each frame). I am using DirectDraw in DirectX 7. When I scroll around, a funny thing happens. For each star that I plot, I can see two others right next to it. It is almost like the two previous frames, although faded, are still visible. The same occurs with the bitmap. When I am scrolling I can see the two previous locations as well as the new one. Does this explanation make sense? This problem isn''t really a show stopper, but I''d like to know what is going on in this case. If anyone can enlighten me, I''d feel much better Thanks!

Share this post


Link to post
Share on other sites
EDIT: I think its the CRT monitor, I noticed the same thing too!!

Take a screenshot and see if it is still there

[edited by - Cybertron on March 21, 2002 9:22:18 PM]

Share this post


Link to post
Share on other sites
lock to vsync, make sure your refresh rate is high. most likly you just witnessing tearing or ghosting (maybe even both).
tearing:
updating the visible surface in the middle of a screen refresh. thus you will see the previous frame and current frame intertwined where the upper portion is the old frame (since the screen got refreshed with that) and the new frame is the lower portion (since the video card did not get there yet, so you were able to update it and have it displayed). easy fix is to simply what for vsync when doing your flip or blit and dont draw to the primary surface.

ghosting:
crt or lcd moniter is refreshing too slow. try increasing the refresh rate in your display properties.

WARNING: this can damage your moniter PERMENTLY if you use a value that is higher then what is supported by the moniter. thankfully nowadays windows queries the moniter for its safe refresh rates, though sometimes windows is confused what mointer you are using. if you are unsure if your moniter supports higher refresh rates, pick optimal which will have windows choose the "best" refresh rate (ussually the highest possible).

you can also try slowing the animation down, (ie smooth it out). make sure the things that are moving are not on a black background (since its most noticable on blck backgrounds). since moniters tend to keep the previous pixel state longer then they should, thats just the way they work. lcds screens are even worse with this. though no matter how good the moniter, you will still notice this phenomena. some of it has to do with eye refresh rates (approx 30hz-60hz (going from center of vision to outer edge)).

as a test, just move your mouse around realy fast, you should see some ghosting, even though the mouse is drawn at refresh so no tearing woudl occer, but ghosting will 9and cant be stopped only controlled a bit).

implementing forms of motion blur (ie actually drawing the previous frames with some alphablending) for fast moving objects would help somewhat. you can also when drawing fast moving points, draw a line connecting the previous position and current position (extra points for fading the line). this will help reduce the appearence of ghosting. reduce high contrast since they tend not to exhibt ghosting as much (since colors are closer so the eye is more forgiving as is the moniter, but if the contrast is too low your game becomes unplayable, so i suggest not doing this at all).

EDIT: actually reducing the refresh rate will reduce the number of ghosted images, but increase their brightness. increasing the refresh rate will increase the number of ghosted images, but decrease their brightness. so its a no win situtaion. (btw this test was done using the mouse moving fast, not scientific, but pretty accuarate. i tried 60hz and 100hz (what i ussually run at)). dont worry, as soon as you develop yoru game more, you will notice that the ghosting will be come less apparent (ie when more things are moving the eye tends not to see it as much since you are focusing on multiple objects, with different colors. plus you want to stay away form the enemies and not lose, so the player tends not to notice it as much either).

[edited by - a person on March 22, 2002 3:20:07 AM]

Share this post


Link to post
Share on other sites
Thanks for the tremendous response! It is definitely ghosting. I sort of suspected it had something to do with the pixels turning on and off, but I didn''t know for sure.

I''m not particulary worried about it, because it doesn''t look that bad. And like you said with more objects on the screen you tend not to notice it as much. I just wanted to make sure that it wasn''t a problem that could be solved by setting some DirectX parameter somewhere.

Thanks again, that helps out a great deal.

Cheers!

Share this post


Link to post
Share on other sites