Blending carring over things it shouldn't

Started by
3 comments, last by MountainLion2 20 years ago
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...)
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.
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.
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.
General rule of thumb: Draw opaque objects first and transpatent objects after it. I agree with the others. This should not happen with the code you posted. Can you put up a screenshot perhaps?

Lone Wolves Game Development
Sander Maréchal
[Lone Wolves][Game Developers Emporium][E-mail]
[Hosting $7,95/mo][Forum FAQ][Google]

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

This topic is closed to new replies.

Advertisement