Reflections & off screen rendering

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

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.

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

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.

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

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

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

Originally posted by cass:
[b]
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);
[/b]

I would love to use that, but I am still missing Release 10 drivers for Linux

Chris