View Full Version : Partial screen transparency
02-09-2006, 11:52 AM
I need to know how can I draw a screen with a transparent polygon hole in its middle, where I can see the previous scene that was drawn beforehand.
02-09-2006, 12:01 PM
Draw the hole to stencil, when you draw the polygon add a stencil test to avoid writing to the hole.
You may want to draw the occluder to the zbuffer first if it can potentially occlude the hole and use polygon offset to draw the hole to stencil with z testing, then draw the object to the color buffer. This second more advanced approach does imply that the background is all drawn first, if you want to draw the background in any order you can stencil test a z distant polygon to the hole to clear it.
Remember to clear the stencil buffer each frame.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.