Game Development Community

Magnifying glass' effect

by Edel · in Torque Game Builder · 12/25/2006 (3:57 pm) · 7 replies

Does anybody have any ideas on how to achieve a 'magnifying glass' effect in TGB? I have seen it done in some online based 'Flash' games. I was just wondering if it was even possible to pull this off? Preferably without having to dig into the engines source code...

#1
12/25/2006 (4:57 pm)
No engine code change? Um... No.
#2
12/25/2006 (5:08 pm)
There goes that concept....LOL
#3
12/25/2006 (5:39 pm)
I still pretty new, and not sure of the exact effect you are striving for, but couldn't this be done with a second camera? Zoom the second camera closer over the area you want to magnify and overlay on top of the bigger camera view.
#4
12/25/2006 (5:59 pm)
Depends on the exact effect you're looking for. I believe clever use of masking and a second scenewindow would give you a pretty convincing effect, a la Harlon Norse's explanation. However, if you're looking for a lens distortion effect as well, you'd need either some pixel-shader work, or a way to distort a subdivided quad at vertex level, both of which would require some engine changes.
#5
12/25/2006 (6:46 pm)
Thanks guys!
#6
12/27/2006 (12:17 pm)
If you're looking for a way to have multiple scene windows in TGB, you can find a very nice resource about split screens right here.

Basically, you would just create that second scene window and set it at a different zoom level.

Then, to get it in a round shape, you would use blending with a mask in the shape of your magnifying glass, to achieve an effect that is similar to the portal described in this other thread.

Not telling you anything very new -- just trying to link you to some code examples.

Cheers!

--clint
#7
12/27/2006 (12:59 pm)
Have a zoom-level layer which is masked by the magnifying lens. Then set the alpha of the lens to look glassy. You won't get distortion, but it will seem glassy. Otherwise, you can add a a couple of layers to the lens with slightly different zoom levels. That way it will distort as you move the lens. It will not be pixel-perfect, but it also won't require any shader tech.