mouseevent - OpenGl selection -
i'm creating box , placing "magnets" on bottom. sides see through(alpha somewhere between .2 , .5) , bottom solid. i'm trying use gluunproject() select "magnet" placed, when sides of box rendered, can't magnets box.
is there anyway still have sides of wall rendered ignore them sake of mouse clicks?
i've tried gl_cull_face @ first glance doesn't seem i'm looking for.
so if understand correctly, have semi-transparent boxes , when magnet inside boxes want see magnet in according semi-transparency of boxes.
my guess when you're drawing boxes have depth writes turned on, way if boxes happen drawn before magnet, when draw magnet fail depth test , part that's inside won't drawn result.
the easiest way is:
draw solid objects first
disable depth writes:
gldepthmask(gl_false);
use order-independent blending function when drawing semi-transparent objects, example:
glblendfunc(gl_one, gl_one)
draw transparent objects
enable depth writes again
gldepthmask(gl_true);
bear in mind simple method work if can away using commutative blending equation, if not consider using order-independent transparency, article "efficient layered fragment buffer techniques" pyarelal knowles, geoff leach, , fabio zambetta
Comments
Post a Comment