Sign in to follow this  

Screen fade out effect problem

This topic is 4583 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 want to make a fade out effect(image from normal to black gradually) in fullScreen mode by DDraw. I have tried using animate palette technic, but I found it can't directly effect on video buffer.Is it possible to get and edit the pixel of screen buffer? Thanks for any help.

Share this post


Link to post
Share on other sites
Yes you can lock the frame buffer to access the pixels directly, then you can modify the colours of the individual pixels in whatever way you like, check this link out, hopefully it should hope you out.

Share this post


Link to post
Share on other sites
Accessing all individual pixels would, I think, be rather slow. Luckily there are some alternatives.

You could try to bring down the overall gamma (in a fullscreen application). Search the DX SDK documentation for 'Gamma Controls' for a full explanation.

You could also consider rendering all your scene to a quad which is normally shown full bright in ortho mode. This is like rendering your scene on a screen that fills the whole physical screen. Then, on fade, you can simply bring down the material from full bright white downto black.

Greetz,

Illco

Share this post


Link to post
Share on other sites
Quote:
Original post by Illco
Accessing all individual pixels would, I think, be rather slow.

Yes, this is a bit slow - but there are a lot of little tricks you can use to get this working pretty fast. I wrote a pure VB6 version some years back that could fade an 800x600 display between 2 images (or to a colour) in real-time / 30-40fps.

If you go on this route, you need to learn your micro optimizations - do as much outside of the lock as possible, cache data where available, try and work on the primitive data rather than convert it upto 8bit resolution (if you're using 565/555 formats) and "dump" it all in the buffer with one memory copy.

Quote:
Original post by Illco
You could try to bring down the overall gamma (in a fullscreen application). Search the DX SDK documentation for 'Gamma Controls' for a full explanation.

Gamma controls rock - you can do loads of cool things with them. However, hardware/driver support was an issue if I remember correctly. I don't think you can rely on this being there... I know that this messed me around at one point.

Quote:
Original post by Illco
You could also consider rendering all your scene to a quad which is normally shown full bright in ortho mode. This is like rendering your scene on a screen that fills the whole physical screen. Then, on fade, you can simply bring down the material from full bright white downto black.

I don't think this'll work with DirectDraw [smile]

Granted, modern wisdom/advice would be to use Direct3D and ortho projections or TL vertices, the OP seemed to indicate DDraw was the platform of choice.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Gamma controls rock - you can do loads of cool things with them. However, hardware/driver support was an issue if I remember correctly. I don't think you can rely on this being there... I know that this messed me around at one point.

Yup, when they work they're great but I would never use it in production because I know far too much about the evils of drivers.

Quote:
I don't think this'll work with DirectDraw [smile]

Granted, modern wisdom/advice would be to use Direct3D and ortho projections or TL vertices, the OP seemed to indicate DDraw was the platform of choice.

D3D7 can be used with DD7 for things like this. I would generally reccomend switching entirely to D3D, but if a lot of investment has been made in the DD side of things then adding D3D on top is an option.

Share this post


Link to post
Share on other sites
Hi Jollyjeffers

I have tried the individual pixels way, but my arithmetic is too badly. The rate is no more 1 fps. Could you describe your tricks detailedly?

Share this post


Link to post
Share on other sites
Quote:
Original post by d000hg
I'm sure there is a DDraw feature to do this....
(searches folders and racks brain)
...Overlays.


What is the version of DDraw you refer to?

Share this post


Link to post
Share on other sites

This topic is 4583 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.

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