Jump to content
  • Advertisement
Sign in to follow this  
lgcosta

Bump mapping - Water little ripples

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

Hi, I'm working on rendering an ocean scene. I'm having trouble understanding how can I use bump mapping to make the water little ripples. I already have a height map. Can I use it to generate the ripples? Thanks. Leonardo

Share this post


Link to post
Share on other sites
Advertisement
[Off the top of my head]

You could have an animation bump map series where you tick through each one using it as a bump map for the ripples.

ace

[/Off the top of my head]

Share this post


Link to post
Share on other sites
paper

Maybe not what you were looking for, and i haven't read it so i don't know if it answer your question. But you could give it a try though.


Share this post


Link to post
Share on other sites
Well, on the subject of that paper, I'm sure it's possible (and I'd venture not even that hard) to simulate the evolution of arbitrary wave patterns in the pixel shader. The differential equation governing the evolution of waves is pretty simple, you just need a good way of numerically integrating and differentiating in the shader.

The equation in question is:

1/c^2 (d^2 h/dt^2) = d^2 h/dx^2 + d^2 h/dy^2

Sorry it looks bad but typing complex formulae into simple text boxes is not easy. c is the speed of waves in the medium, h is the displacement. The point is you can work out the right hand side using numerical methods to estimate the derivatives. Then, by using the left hand side, along with some information about the position at previous times you can evolve the heightmap by a small time step. (i.e. you're going to need at least 3 heightmaps - one to hold current state, one to hold previous state, and one to hold newly calculated state). Since the shader given by that paper seems to simulate 4 sine and 4 cosine waves (okay I haven't read it that thoroughly...) this could be about as fast. I'd guess it'll involve approximately 6 texture reads per pixel. The rest by my reckoning can probably be done in two dot products and one addition, I'm not quite sure.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!