Swiftless
07-01-2005, 12:33 AM
My particles are coded as such:
glDisable (GL_LIGHTING);
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glBlendFunc(GL_DST_COLOR, GL_ZERO);
glBindTexture(GL_TEXTURE_2D, smoketexture[1]);
particles();
glDisable(GL_BLEND);
Now before that code I have code to build the rest of my scene. The problem with this code is that the particle is drawn on top of the whole scene, when I want it to be drawn infront of what is behind it, yet behind what is infront of it. But if I try to reinstate the GL_DEPTH_TEST it messes up my blending. Any ideas?
And also, how would I implement some more blending afterwards, so that the particles seem to fade accourding to my glColor4f function?
glDisable (GL_LIGHTING);
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glBlendFunc(GL_DST_COLOR, GL_ZERO);
glBindTexture(GL_TEXTURE_2D, smoketexture[1]);
particles();
glDisable(GL_BLEND);
Now before that code I have code to build the rest of my scene. The problem with this code is that the particle is drawn on top of the whole scene, when I want it to be drawn infront of what is behind it, yet behind what is infront of it. But if I try to reinstate the GL_DEPTH_TEST it messes up my blending. Any ideas?
And also, how would I implement some more blending afterwards, so that the particles seem to fade accourding to my glColor4f function?