Stretching a big backbuffer to a small texture

Igor Kravtchenko <[email protected]>
Newsgroups gmane.games.devel.opengl
Organization Fat City Network Services, San Diego, California
Message-ID <[email protected]>
Hi all!

I'm currently trying to implement the now well-kown "Tron Glow Effect" 
under OpenGL
(http://www.gamasutra.com/features/20040526/james_01.shtml)

The algorithm is pretty clear, I'm just suffering of a lack of 
functionatilies with GL.
My glowing effect is performed on a small texture of say, 256x256.  
Since it's out of
question to render the scene twice (i.e.: one time for the normal scene, 
second time with
a small viewport of 256x256 for my texture) because it would be too 
slow, I'm trying
to grab the content of the backbuffer and resize it to a small texture 
of 256x256 where
I can perform the glow effect (two 1-D pass to make a Gaussian filter).

My problem is the D3D's StretchRect
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/d3d/interfaces/idirect3ddevice9/StretchRect.asp)
doesn't have any equivalent under GL.

The fallback I've currently found is to make a glCopyTexture2D() of my 
backbuffer to a big texture (big enough to grab the entire backbuffer)
and then draw a small quad of 256x256 on the screen that I 
glCopyTexture2D() back to my 256x256 texture.
Grumpf :-/

Any hint or remark is welcome,

Igor.

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

-- 
Author: Igor Kravtchenko
  INET: [email protected]

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.