Can blending be done with depth test on?
Hi all,
I am trying to do some blending with GL_DEPTH_TEST enabled. However, this does not seem to work. My question is, is there a way to do blending of textures without making the whole thing transparent?
Thanks!
hmm, how exactly do you use this? It gives me an error if I compile the code.
error C3861: 'glDepthWrite': identifier not found, even with argument-dependent lookup
error C3861: 'glDepthWrite': identifier not found, even with argument-dependent lookup
your question of not making textures totally transparent has nothing to do with the depth buffer. to load a texture with only some transparency, use a loading function like in this post
you will want ot leave the depth buffer enabled and set glBelndFunc(GL_SRC_ALPHA, GL_SRC_ALPHA_MINUS_ONE); more than likely. you will want ot draw the transparent parts last, so if you have complicated geometry within the transparent sections you want to sort the triangles drawing furthest to closest.
you will want ot leave the depth buffer enabled and set glBelndFunc(GL_SRC_ALPHA, GL_SRC_ALPHA_MINUS_ONE); more than likely. you will want ot draw the transparent parts last, so if you have complicated geometry within the transparent sections you want to sort the triangles drawing furthest to closest.
Quote:Original post by Megahertz
Should that not be glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ?
whoops. yeah, what he said.
Ok, thx for all the replies. What I am trying to do here is to texture a terrain. I have divided the mesh into pieces so that each one sub-mesh would use a same texture. Now, I need to do the transistion between two different textured meshes. If I enable depth test, then the blending does not seem to happen at all. If I disable the depth test, I can see the blending effect, but the terrain would be see-thru. Btw, my textures do not have alpha channel, could this be why? Thanks again!
I am trying to do multi-texture on a terrain, without using shaders. I read a post here somewhere (but I cant find it now) saying that you can just render the mesh many times with different blending factor to get the transistion effect between different textures. The guy even posted some some ss and looked pretty nice. I am not sure but I could have read it wrong.
EDIT: Yea, I had the terrain working with multi-texture. I am just wondering if I can do it this way using blending. =)
EDIT: Yea, I had the terrain working with multi-texture. I am just wondering if I can do it this way using blending. =)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement