Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / wave background image

Author
Message
Max Maker
19
Years of Service
User Offline
Joined: 17th May 2007
Location: 4
Posted: 10th Jun 2010 17:53
hello everybody
can any one give me example code for wave image like this

at 0:43

http://www.youtube.com/watch?v=CrqaAidbkfo

thanks

4444444444444444444444
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 10th Jun 2010 18:30 Edited at: 10th Jun 2010 18:31
This would be done through a pixel shader (though it can be achieve via other means, just using a shader for this is far less performance hungry), a sort of post process. Luckily there's tons of stuff on HLSL Pixel effects, you should Goggle it. Unless you don't have knowledge of shaders then I think this would be a great time to learn, just my opinion there.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Max Maker
19
Years of Service
User Offline
Joined: 17th May 2007
Location: 4
Posted: 11th Jun 2010 04:03
thank you Mr.Sasuke
i think to do this using little code
i can do this 3d (using wave effect)
but i need 2d to use it as backdrop. thanks

4444444444444444444444
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 11th Jun 2010 09:30
Maybe you could do an effect 'like' that with sprites. If you had a big background image, then made a grid of sprites you could adjust the UV coordinates of each sprite to suit the position, then interfere with the UV coordinates.

I did this on a smaller scale, a full screen picture of some water with 2 sprites and each vertex UV mapped with sin/cos offsets. It did give a good impression of waves, even with just 2 layers. You could also use a seperate sprite for each piece, like say 1 sprite per bubble. Remember though that there is no reason why you can't make a 3D effect and use it as the backdrop to a 2D game, lots of developers do that.


Health, Ammo, and bacon and eggs!

Login to post a reply

Server time is: 2026-07-25 16:20:11
Your offset time is: 2026-07-25 16:20:11