transparency

Started by
5 comments, last by LeeDawg 21 years, 5 months ago
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
Advertisement
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.
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?
what about render everything as normal,
then put a quad with color (0,0,0,0.5) on top of them
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.
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
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.

This topic is closed to new replies.

Advertisement