|
|
| openGL guru needed, masking problem :S. |
|
Albin Engström
Member #8,110
December 2006
|
EDIT: the problem was that i had forgotten to enable alpha testing.. Notice that some invisible quad seems to block out the pixels of those behind it?, this invisible quad is the masked area of the bomb which you should also be able to see, for some reason this happens to objects if they are drawn after and behind a masked quad, as you can see the ground is unaffected because it's drawn before the bomb and the player. I use a custom view port and orthographic view, except from that everything is as it usually is when it works This seems like the kind of problem people know the answer too, so any ideas? Kisses |
|
gnolam
Member #2,030
March 2002
|
Don't ever post screenshots in BMP format. As for the solution: turn off depth writing. -- |
|
Albin Engström
Member #8,110
December 2006
|
EDIT: woops.. forgot to enable alpha testing.... It was so small it thought it wouldn't matter Turning off depth testing would pose another problem.. the depth?! :S But it has to be something about the depth :/ I've used ortho and depth testing before and these problems didn't show up :/. |
|
Arthur Kalliokoski
Member #5,540
February 2005
|
As far as I can get it to work, transparency needs depth testing turned off, and you have to draw all the transparent objects after all the others, and you have to sort the transparent objects by distance. My father used to play with my brother and me in the yard. Mother would come out and say, "You're tearing up the grass"; "We're not raising grass," Dad would reply. "We're raising boys". |
|
Albin Engström
Member #8,110
December 2006
|
You don't have to if you use glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
|
Rash
Member #2,374
May 2002
|
|
BAF
Member #2,981
December 2002
|
It's really easy to save as a png. Chances are, you have to paste your screenshot to save it anyway, even mspaint will save to a png quick and easy. |
|
Tobias Dammers
Member #2,604
August 2002
|
Haven't bothered looking at the screenshot, but here's the thing. You may want to enable alpha blending on masked polygons; this will give you smoother edges where a masked pixel and a non-masked one are next to each other, but because the alpha test can only ever result in "accept" or "reject", the depth testing that happens afterwards will lead to slightly incorrect results (halfway masked pixels obscuring solid pixels from other polygons). So I'd suggest you turn off blending for these, and let the graphic driver's scene anti-aliasing handle this for you. |
|
|