Hello first of all to everyone.
I have a Problem: I have a 3D drawing of two (as example) textured quads which cross - seen from the side. This Plates are drawn with the Alpha value as visibility and so I have some stuff of the one quad drawn in front of the other quad and vice versa.
As some of the texture is invisible - as I want it to be for making a different difficult border without many triangles etc. - and that is drawn quite well if the quad is drawn first. But the second quad is not drwn at behind the first one’s unvisible part, 'couse the Z-Buffer is actualised.
As the one Quad is in parts in front of the other and the other quad is in parts in front of the one there are some Possibilities to divide the quads at the border and draw two of them, which can definitely say that one is in front and the other in the Back - not to forget to sort them to draw them in right order. BUT - first of all that takes at only a small amount of quads a high amount of calculation and therefore speed and secondly this is much work to program.
Therefore I search for a possibility to ‘not actualise’ the Z-Buffer if the ALPHA-Values are e.g. Zero.
Does anyone know or have a small kind of Idea how how this can be programmed, installed or realised in an other way? I think this would help more persons than me.
Thank you very much in Progress
Have a look at GL_ALPHA_TEST and glAlphaFunc().
hä? what have I done? That’s it !!!
Thanks very much … Seems I overtook this part allways, `course I that it was about alphaBLENDING … I realy should start reading more carefully … dmd …
Nevertheless thank you very much - after having a try with the GL_BELOW, showing me everything inverse, I tried it with GL_GEAVEN and it works perfectly. My comparasionvalue is .5 - but that should not be as relevant.
CU all - I think we can close this now.
You could also use glDepthMask(0) before drawing your transparent stuff. This will turn off writes to the depth buffer. glDepthMask(1) turns them back on.
The depth test itself, i.e. occlusion of new geometry by previously drawn geometry, will still function as expected. If you don’t want that either you can glDisable(GL_DEPTH_TEST).
Well - that’s what i tried first, and it is not working:
the planes I am drawing are crossing, so I need point per point the information of Z-Buffer and I need an actualisation of it.
if e.g. in the lower part the plane A is in the front and in the upper Part the plane B then I can’t go like this 'course I don’t know in wich order I have to draw them. And for your way of drawing you need the order, otherwise everything written later is overwritten.
I my case I have a straw roof at wich some strow is going through the plane of the opposite side in the top area - so the planes have to cross.
if you put z-Buffer of and I first draw the backside, then this parts are overdrawn with the frontside roof are - eaven if it is lokated behind.
if I draw the front first and the Backside fter that then it looks funny, but not like a house …
I’m Happy with the solution, hope that i t won’t cost too much graphicpower and try to use it.