Advertisement Jump to content


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


Fast 16-Bit Water/Wave Effects.

This topic is 6509 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

Color cycling by definition deals with paletted colors, so I can understand why it wouldn''t work (it seems strange that it works at all) in 16 bit mode. I would recommend this: Perform the color cycling using an 8-bit off-screen surface, and then blit from this to a 16 bit surface. That means that, though your water will be limited to a 256 color palette, the rest of your graphics will not. And even the water will still look fine, because you will only be using 256 shades of blue!

Then again, this is all assuming you''re using DirectDraw. Otherwise, I''m not sure what you should do.

Even if you are, this might not work.

Share this post

Link to post
Share on other sites
I am actually using that method now. Color cycling an 8-bit image
and draw it to a 16-bit surface. It''s just too slow.

I think i better just use a sprite to simulate the effect.
Anyway, thanks for suggestion.

Share this post

Link to post
Share on other sites
Check out this engine:


He has a really nice water animation, and I don''t think the artist minds people using it as long as he gets credit.

Need help? Well, go FAQ yourself.
What a plight we who try to make a story-based game have...writers of conventional media have words, we have but binary numbers

Share this post

Link to post
Share on other sites
In 16-bit color modes and higher, you could use a gamma control to simulate the effects of palette-based color cycling without making it too slow, if you've got the hardware.

In DirectX 7 (I'm assuming this is what you're using, since I don't see a reason to use color cycling on 3-D games =)), you should get an interface to the IID_IDirectDrawGammaControl:

IDirectDrawSurface7 *pDDSPrimary; // your primary surface (assume we already have this)

IDirectDrawGammaControl *pDDGamma; // your gamma control

pDDSPrimary->QueryInterface(IID_IDirectDrawGammaControl, (void **) &pDDGamma);

Then use the DDGAMMARAMP structure to set the colors:

for (int i = 0; i <= 255; i++) {[i] = red value;[i] = green value;[i] = blue value;
pDDGamma->SetGammaRamp(0, &ddGammaRamp);

Each color value expected is a DWORD from 0 to 65535 (NOT just 0 to 255). The gamma should take effect automatically when you set it.

This thing works best in combination with a decent lookup table. I assume that you know how to deal with that already =)

Note: As I mentioned earlier, this thing only works with hardware that supports it. I'm using an NVidia Riva TNT2.

Edited by - ericvids on March 23, 2001 11:17:28 AM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!