# Bump mapping - Water little ripples

This topic is 4968 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
[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 on other sites
Ok. But what about the resolution difference between the heightmap and the normal map?

##### 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 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.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 28
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634103
• Total Posts
3015539
×