Skip to main content
GameDev.net gamedev.net
🔒 Locked

transparency

Started by LeeDawg Oct 31, 2002 at 3:54 PM 5 replies 1.1k views
Original Post
LeeDawg
LeeDawg
Is there a way to make everything transparent except one image(a dialog image in my case) similar to how windows XP does it when it shuts down? Thanks
Waverider
Waverider
Render everything else transparent or darkened, then render your dialog last, is the most straightforward way.
It's not what you're taught, it's what you learn.
LeeDawg
LeeDawg
That would be kind of a pain in the butt! Isn''t there some function or something that could do this? I need the game to pause as this happens so maybe the solution would be to take a screen shot and seamlessly display it as the background(instead of the actual objects) and make it grayscale. Then I could draw the colored dialog over top of it. I''m not sure how I would do this though. Any other ideas?
iwaskia
iwaskia
what about render everything as normal,
then put a quad with color (0,0,0,0.5) on top of them
LeeDawg
LeeDawg
That brings up another issue. My interface is in ortho mode and the transparent dialogs blend beautifully with the game objects which are drawn in perspective mode. However when two transparent objects in ortho mode cross over each other the one on top cancels out the one on bottom and shows right through to the perspective objects. If I can fix this then the transparent quad idea would be perfect. I''ve spent hours trying different blending functions but nothing seems to fix it.
zedzeek
zedzeek
iwaskia is correct.
draw your sceen normally then
switch to ortho
enable blending with src_alpha -1minus_alpha
(set color to 1,1,1,0.5
turn off lighting etc
draw a fullscreen quad.
then draw the dialog.
u may need to turn off depth testing

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
llvllatrix
llvllatrix
Dont turn off depth testing, just use glDepthMask(GL_FALSE) for transparent objects and glDepthMask(GL_TRUE) when your''re drawing solid ones - it makes the depth buffer read only.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.