Jump to content
  • Advertisement

Archived

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

MountainLion2

Blending carring over things it shouldn't

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

Ok, I''m sure I''m just missing a command or have something out of order, but my problem is I''m texturing some water, and trying to make it transparent. This all works looks fine, etc. My problem is, it carries over to my models, but not the terrain(?). This what the code looks like, I''ve also tried it inside the class, and didn''t help. glDisable(GL_LIGHTING); glEnable(GL_BLEND); glDepthMask( GL_FALSE ); glDepthFunc( GL_LEQUAL ); glBlendFunc(GL_SRC_ALPHA, GL_ONE); glPushMatrix(); glTranslatef(0.0f, 0.0, -2000.0f); glBindTexture(GL_TEXTURE_2D, g_RiverTex.t_tTex->texID); g_River.CreateSimpleRiver(); glPopMatrix(); glDepthMask(GL_TRUE); glDisable(GL_BLEND); glEnable(GL_LIGHTING); thanks (If I had hair I''d have ripped it all out by now...)

Share this post


Link to post
Share on other sites
Advertisement
What do you mean by its carrying over to your models? You mean its still applying the blending to them? If you have it perfectly in that order, this shouldn''t be happening.

Share this post


Link to post
Share on other sites
Yeah thats whats happening, I''ve been trying to draw them farthest first, terrain, water, models. I''ve tried switching the order, but that didn''t help.

Share this post


Link to post
Share on other sites
Going from what your saying, it sounds impossible. You show in your code above that you are directly calling glDisable(GL_BLEND);. If your not calling glEnable(GL_BLEND); before you draw your other models, there is no way blending is going to take place on the new vertices you render.

Share this post


Link to post
Share on other sites

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