Advertisement

Problems with transparencies

Started by September 16, 2000 03:46 PM
5 comments, last by mckracken 24 years, 2 months ago
I have some problems usign transparencies... Well, the problem is when I want to put two objects with transparent polygons... When one of them is in front of the other, you can see the other object behind.. All worked fine.. But, when the other object is in front of the first, you can´t see the other!! WHY??!!! I´m getting crazy! I supose it is a probelm with the z-depth.... Thanks.. See you!! =)
=====================================Regards,Juan Pablo (McKrackeN) Bettini Psychoban Official Site:http://www.psychoban.comPsychoban on iTunes App Store:http://itunes.apple.com/us/app/psychoban/id378692853?mt=8
Are you absolutely positive that the second is transparent. I mean, is it definately showing the background colour through it? If not you might want to make them both transparent.

If it IS showing the background colour through it at whatever intensity you set in the alpha amount, then if you move the cube that doesn''t show up to the left or right (I''m assuming you''re placing the cubes in a line along the z-axis) does it show up when it should be out from behind the other box?

If it doesn''t show up, your viewing area may be clipped too small and the cube is simply not being drawn because of how you have it clipped.

S.
Advertisement
Well... It seems to be alright...
Both are transparent and the view area is correct, because I can see another object farther in z axis....
I don´t know what is going on...
I guess it´s a problem with z depth....
Thanks

see ya
=====================================Regards,Juan Pablo (McKrackeN) Bettini Psychoban Official Site:http://www.psychoban.comPsychoban on iTunes App Store:http://itunes.apple.com/us/app/psychoban/id378692853?mt=8
I had the same problem with lightmapping on a level in my engine (http://www2.50megs.com/chazz/)

and my code was originally like so:


drawworld();
drawlightmaps();


but I couldn''t see the lightmaps and I was absolutely positive they were being blended correctly.. Here is the NEW WORKING code:


drawworld();

glDepthMask(GL_FALSE);

drawlightmaps();

glDepthMask(GL_TRUE);

try using glDepthMask();

and make sure you are drawing the clear polygon last..
-Chazz
i haven''t tried the gldepthmask myself, but i could sort of explain the cause behind this. obviously, it does have something to do with depth, but let me explain a certain problem that i had that was related to this one. i was drawing a smoke trail to the screen, but when the smoke trail was drawn in the other direction (towards the camera instead of away from the camera) the smoke puffs were not visible. this is because it has something to do with the order of drawing. you have to play around with the order you draw your transparent images too.

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
chazz is right, u have to turn off the depth buffer writes and sort the polys yourself, unfortunately theres no other way
Advertisement
Thank you very much...
With people like you the world is better...

See ya soon, pals...

=====================================Regards,Juan Pablo (McKrackeN) Bettini Psychoban Official Site:http://www.psychoban.comPsychoban on iTunes App Store:http://itunes.apple.com/us/app/psychoban/id378692853?mt=8

This topic is closed to new replies.

Advertisement