Sign in to follow this  
Eps

Creating water distortions with EMBM

Recommended Posts

I have my terrain rendered onto a pbuffer and am currently projecting that onto a water surface. This works well with no issues. The next step to bringing the water to life is to bump map the surface and distort the reflected texture. The bump mapping i can do, though I havn't implemented it into this project yet. I'm hung up on how to do the water distortions. I've read many threads and articles on this site, and the most popular method seems to be the one proposed by Yann. That is, to displace the vertices in the xy directions to get varying texture coordinates. This appears to work well, but only when done on a grid. For my water system, I have a disk rather than a grid. This means there are more vertices closer to the camera (at the center of the disk) and less when farther away (at the edge of the disk.) So by mearly moving the verts around, I don't believe it would produce the same results although I havn't actually attempted it. What I really want to do is bump map the surface, and have the texture distorted by the bump map itself. As far as I can tell, this is what FarCry is doing with their water. This brings in 2 problems. First of all, how would i distort the texture by using the bump map, and secondly how to do that with the correct perspective. [Edited by - Eps on August 17, 2004 6:18:48 AM]

Share this post


Link to post
Share on other sites
I was just messing with moving the verts around before generating the texture coordinates like Yann had suggested, but got mixed results. Perhaps anyone here who has done this could describe what is happening behind this function call Yann has?

P = position of current vertex
D = DistortByWaterSurface(P); <------
glColour4ub( ... );
glTexCoord3fv(&D);
glVertex3fv(&P);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this