Jump to content
  • Advertisement
Sign in to follow this  
Eps

Creating water distortions with EMBM

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

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
Advertisement
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
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!