Advertisement

Second rendering window as transparent overlay

Started by April 15, 2005 02:26 PM
3 comments, last by tgraupmann 19 years, 9 months ago
Hi, I would like to acheive the effect drawn below: a second rendering window, smaller than the first, to be overlaid semi-transparently over the first. Its use would be for example to look behind the user in a first person shooter. Any suggestions on how this can be done?
Sheesh, I was only expecting an answer...
Advertisement
You have a few options (here are two off the top of my head):

1. The easiest solution is probably to render the behind scene to the framebuffer, and capture it in a texutre. Once captured you just draw a quad with the texture and give it an alpha value.

2. Another alternative is to basically draw the behind scene overtop the current one. While this saves you the trouble of capturing and rescaling the frame buffer, its presents a whole bunch of technacalities that you'll have to deal with. Your going to have to clear the depth buffer in that area (simple enough; you could just clear the entire depth buffer, but it would be a bit slower than just clearing that area). Your also going to have to clip the viewing region to that square; a scissor test should do it. Your also going to have to make the scene transparent, which should be easy enough to do, unless you have objects in the game that possess transparency. Then it might be a bit tricky.

I'd personally go with the frame buffer capture; you should be able to get faster results that way and you wont have to worry about artifacts popping up when you add something new in.

Cheers,
- llvllatrix
That worked!

Thanks Ivllatrix,

Keer
Can you post your source? I think it would make an interesting tutorial.
*News tagenigma.com is my new domain.

This topic is closed to new replies.

Advertisement