[Plib-devel] ssg, transparent textures, and blending
Brought to you by:
sjbaker
From: Curtis L. O. <cu...@in...> - 2000-03-05 16:15:43
|
Ok, I literally want to cry. :-) I've spent the last 4-5 days struggling with ssg, opengl states, textures with alpha transparency, and blending ... nothing was working right for me. Everything was going screwy at every step of the way. This has to have ranked right up there with the frustration level of sorting out matrix tranformations. You think you know how it works, you've studied it in school, you got A's on your test, you've made this stuff work before, but here's this proof laughing in your face, this piece of non-working code that is saying you are obviously a clueless idiot. Ok, so I could get everything working correctly ... right up to the point where I tried to enable either blending or alpha_test and blam, my object would go away. This morning I said to myself, "you know Curt, it almost looks like opengl/ssg is honoring the alpha of the underlying quad, and completely ignoring the alpha of your perfectly good texture." Hmmm ... interesting thought ... what is the alpha of my underlying quad? I suppose, if I'm GL_MODULATING my texture, the texture's alpha would get modulated with the underlying quad's alpha, just like it is with the RGB values. Hmmm ... but if you build an ssgVtxTable ssgColourArray out of ssgVec3 there would be no way to specify an alpha component. A huge obvious oversite in the design of ssg. If Steve wasn't on vacation I'd tear him to shreds over this ... he just wasted the last week of my life. Quick check the docs so I have some juicy proof for the public lynching ... and sure enough there it is ... you are supposed to build the ssgColourArray out of ssgVec__4__! I'm a complete moron! I've been building my all my color lists out of ssgVec__3__ leaving the alpha to default to 0. Yikes! Did I mention I'm a complete moron. Specifying an alpha of 1.0 in my ssgColourArray makes all my problems go away and suddenly everything works the way it's supposed to. The sun came out, the birds started to sing, yada, yada ... Curt. -- Curtis Olson University of MN, ME Dept. Flight Gear Project Twin Cities cu...@me... cu...@fl... Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org |