Ok, the problem is this.
First i have a 3D textured model completely opaque. Second, i want to render a special effect. The sfx is a simple object: two textured plane, one orthogonal to the other (they intersect each other at the middle). They are textured with the same texture. I render this sfx with no backface culling. I want it transparent. I have tried
and it does works. I see the effect rendered in the right way.
If i do not use glDepthMask(GL_FALSE), the effect is not rendered correctley (i do not know how to explain this…).
Suppose that i use glDepthMask(GL_FALSE).
I have some strange effects when i render the 3D model (i want the 3D model to be inside the 3D effect).
The scene is rendered in the following way:
1]draw the background (a static image) in the color buffer
2]render the 3D opaque model
3]render the sfx
All is correct if i do not execute the second step. If, otherwise, i render the 3D opaque model, it is a mess!!!
Instead of seeing the 3D model or some combination of the 3D effect and the 3D model, i see part of the background…
(the 3d opaque model is rendered with the depth test and z-write enabled…)
Suppose that glDepthMask(GL_FALSE) is not executed. The 3D model is rendered correctly inside the sfx, but the sfx, like i said, is not rendered in the right way at 100%.
What can i do?!? What am i doing wrong?
The sfx wants to represent a simple flame. Actually, it is a bit more complex because i use four planes instead of two, but that does not change anything.
I cannot use pixel shader and the hardware i am using is slow…so using textures to make effects (with blending enabled) is the only effective way (some particle effects can be done, but with not too much particles…)