[Plib-users] Translucency solved!
Brought to you by:
sjbaker
From: Martin H. <how...@os...> - 2001-01-18 23:41:45
|
OK, I did a search for "plib" and "transparent" in Google and got the PUI programmer's guide (which I hadn't read: because I don't use it). In there is a heading "Transparent GUI's". It suggests: * pick a default colour with an alpha component of about 0.4f. * call glEnable(GL_BLEND) and set up an appropriate blend function; the author suggests glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and using glAlphaFunc(GL_GREATER, 0.1f) -- the latter translates into using state->setAlphaClamp(0.1f). So, in the *global* set-up portion of my program, I called glBlendFunc() and whadd'ya know: I now have a beautiful semi-transparent plane. In conclusion then: glBlendFunc() is *not* set up to some reasonable default by PLIB -- at least not if you want to have transparent objects in your scene. Putting the glBlendFunc() in a preDraw() or postDraw() callback is *not* sufficient to get the transparency to render correctly. It needs to go into the global set-up just after the call to ssgInit(). Finally, I'd like to extend a warm "thank you" to all who helped and to those who developed and continue to develop PLIB. M. -- Martin Howard | Visiting Scholar, CSEL, OSU | The New Economy: Creating difficulties email: how...@os... | to sell solutions. www: http://mvhoward.i.am/ +---------------------------------------- |