davie
07-15-2010, 05:55 AM
I draw four pictures in the same region(0,0,100,100) with different depth(Z) value on my screen. ie,
Picture A: depth value -30
Picture B: depth value -20
Picture C: depth value -10
Picture D: depth value 0
so picture A is on the bottom and picture D is on the top(picture B, C and D have alpha elements).
I enable the blend function as follow:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
now i found a surprising thing: for the picture D is on the top, of cource i can see it, picture A is on the bottom, i can see it too(i think this is because i enabled the blend function and picture B, C and D are transparent), but i cannt see picture B and C(they are in the middle, between picture A and D). I dont know why, maybe this is because picture B and C have alpha elements?
Can anybody help me? Thanks a lot!
Picture A: depth value -30
Picture B: depth value -20
Picture C: depth value -10
Picture D: depth value 0
so picture A is on the bottom and picture D is on the top(picture B, C and D have alpha elements).
I enable the blend function as follow:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
now i found a surprising thing: for the picture D is on the top, of cource i can see it, picture A is on the bottom, i can see it too(i think this is because i enabled the blend function and picture B, C and D are transparent), but i cannt see picture B and C(they are in the middle, between picture A and D). I dont know why, maybe this is because picture B and C have alpha elements?
Can anybody help me? Thanks a lot!