Blending carring over things it shouldn't
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...)
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?
Sander Maréchal
[Lone Wolves][Game Developers Emporium][E-mail]
[Hosting $7,95/mo][Forum FAQ][Google]
Sander Maréchal
[Lone Wolves][Game Developers Emporium][E-mail]
[Hosting $7,95/mo][Forum FAQ][Google]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement