View Full Version : Reflections & off screen rendering
jwrennie
05-15-2001, 01:06 PM
Hi all,
I hope this is suitable for the advacned area.
I need to figure out how to create a refelctive ball in the middle of a room for an assignment at university.
The only problem i have come across is dynamically creating the textures for the ball.
Is it possible in opengl to render an image to an off screen buffer instead of onto the screen ?
If so how ? I've had a look around and cant find anything on it.
A simple link will suffice if i have missed it in my searches.
Thanks in advance
Jason
Olive
05-15-2001, 10:46 PM
If you're hardware supports it, you can use pbuffers and guess what, if you go take a look at opengl.org there's a helper class in C++ and Delphi for creating those !! PBuffers are just offscreen rendering buffers.
Nutty
05-16-2001, 07:08 AM
Reflective as in cube mapping?
Maybe take a look at my real time cube mapping demo. A big ball in a big room, with objects moving around it. Dynamically creates the cube map each frame too.
Should be similar to what you need, perhaps?
Nutty www.nutty.org (http://www.nutty.org)
Instead of using pbuffers, which I believe is "trur" offscreen buffers, you can use the back buffer. It won't show up on screen unless you swap the buffers.
jwrennie
05-16-2001, 05:49 PM
thanks everybody.
With the back buffering option, is there a way to access the pixel information in the buffer, so i can build a texture to map onto the reflecting object.
Jason
jwatte
05-16-2001, 07:02 PM
glCopyTexSubImage()
Also, if you're doing this with GeForce hardware and Release 10 drivers, I would strongly encourage using automatic mipmap generation. It's really simple:
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
Then updates to level 0 automatically update the mipmaps, and mipmapping relection maps is pretty important.
Thanks -
Cass
jwrennie
05-16-2001, 09:50 PM
It has to run under mesa, software rendering on, remotely from a sparc on an Xterminal.
Speed isn't important , as where just rendering a static image.
It just needs to look good, and not use any hardware specific stuff.
Jason
DaViper
05-17-2001, 02:29 AM
Originally posted by cass:
Also, if you're doing this with GeForce hardware and Release 10 drivers, I would strongly encourage using automatic mipmap generation. It's really simple:
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
I would love to use that, but I am still missing Release 10 drivers for Linux... http://www.opengl.org/discussion_boards/ubb/frown.gif
Chris
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.