Archived

This topic is now archived and is closed to further replies.

Ocean reflection troubles

This topic is 4956 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, After reading many old threads about water reflection and reading the Virtual Camera Position article (among others), I have water reflection implemented -- for an ocean reflecting boats and other things. But I have a few problems. The reflection looks strange. It appears that for each boat sitting in the ocean there''s an upside-down version of it -- flipped perfectly about the ocean surface. And I guess that''s exactly what I coded... But as the camera gets closer to the water surface, shouldn''t the reflection stretch out towards the viewer? Am I missing a step -- should the projection matrix I use for the texture mapping be sheared/skewed somehow? Eventually I plan to write a pixel shader to do some Fresnel term combination of the base ocean colors and reflection texture, etc. For now I just want to blend it. Having trouble finding a good way to do that and make it look appropriate. My first attempt was setting the clear-color white when rendering to texture, and modulating the produced reflection texture in the second texture stage of the ocean render. But it comes out too sharply contrasted. Is there a way to get a dimmed version of the reflection map blended on in a single pass, or do I need to do a second pass with an alpha-test enabled and blend in the reflection with some constant texture factor? Any ideas? Thanks, Shawn

Share this post


Link to post
Share on other sites
The reflection should look exactly like another copy of the object that''s flipped about the ocean surface if you have a perfectly flat surface. I think you do need to use a lower alpha if you want it to look realistic this way. Also, make sure the water surface has an animated texture and is not perfectly uniform in colour.

Share this post


Link to post
Share on other sites