Screen fade out effect problem

Started by
8 comments, last by windleaf 18 years, 10 months ago
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.
Advertisement
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.
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
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

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

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.

Stay Casual,KenDrunken Hyena
I dont really know DDraw (only Direct3D)...i solve this problem with the alpha value of my background vertex-frame.
*Los Brutalos*(Sorry for my brutal english ;)
Have you considered using a polygon that has a solid black texture, place that between the camera and the scene, then adjust it's alpha from transparent to full solid. This should give you full hardware acceleration on just about most hardware.

Cheers,

Bob

[size="3"]Halfway down the trail to Hell...
I'm sure there is a DDraw feature to do this....
(searches folders and racks brain)
...Overlays.
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?
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?

This topic is closed to new replies.

Advertisement