Jump to content
  • Advertisement
Sign in to follow this  
GreenToad

Water reflections and blending

This topic is 5048 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'm trying to do some simple water reflections. I'm drawing the reflected object upsidedown underneath the water plane, then I draw the water plane with blending turned on. It goes like this: DrawObject(); glScalef(0,-1,0); DrawObject(); ... glEnable(GL_BLEND); glBlendFunc( ? , ? ); glColor4f( ? , ? , ? , ? ); DrawWaterPlane(); glDisable(GL_BLEND); glColor4f(1,1,1,1); The trouble is finding a good set of values for the ?'s. I can't seem to find a good set of glBlendFunc() parameters or the appropriate color to set to. Everything I've tried (inluding GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) either shows the reflected object as too light or not at all. Any help is much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
If you call glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), then call

glColor4f(1,1,1,TRANSPARENCY_VALUE)


And set TRANSPARENCY_VALUE to 0.5 or something for how much transparency you want.

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!