Dynamically generated cubemaps

Started by
6 comments, last by Schrompf 16 years, 3 months ago
I have an environment-mapped Utah Teapot that correctly reflects its environment which is a cubemap. I'm looking to make it reflect other objects as well, such as a second teapot bu the current method doesn't allow that. I was wondering if someone could give me a hand generating a dynamic cubemap (I already know about placing a camera at the object's position and taking a snapshot in all six directions, but I haven't the slightest idea how to do this). If someone could point me to a very detailed tutorial on this, or explain how it is done, I would be very grateful. Cheers.
Advertisement
Haven't done this before but i'd suggest using reflections rather than a cubemap
As seen in the first article here:
http://nehe.gamedev.net/lesson.asp?index=06
____________________________Bjarni Arnasonbjarni.us
* Create an additional rendertarget cubemap.
* For all six sides
..* Retrieve surface of that side
..* Set it as rendertarget
..* Set up camera with 90° fov and a aspect ratio of 1 looking "out" of that side
..* render scene, including background
* Use the dynamic cubemap instead of the background cubemap

There's an example in the DirectX SDK for that. Or at least it was, they keep removing examples and adding new with every revision.

Bye, Thomas
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.
Thanks but I need to reflect stuff in the teapot, not in a surface. That tutorial, (though useful and I'll definitely file it away :) ) shows me how to reflect an object in a static surface such as a wall or floor, but I'm looking to make an object reflect other objects dynamically.
Quote:Original post by Schrompf
* Create an additional rendertarget cubemap.
* For all six sides
..* Retrieve surface of that side
..* Set it as rendertarget
..* Set up camera with 90° fov and a aspect ratio of 1 looking "out" of that side
..* render scene, including background
* Use the dynamic cubemap instead of the background cubemap

There's an example in the DirectX SDK for that. Or at least it was, they keep removing examples and adding new with every revision.

Bye, Thomas


Thanks, that's more like what I'm looking for. Could you break it down a bit more though? I'm not sure how to perform those steps.
What have you tried? And where did you get stuck?
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.
I made an attempt after looking up rendertarget, but I have no idea how to use it.

I found it in the directX SDK and I don't know any DirectX programming (OpenGL and GLUT only, with a little CG) so I don't know what dependencies it requires, what includes I need etc or if I even have them available on my machine (Getting OpenGL and GLUT working without endless "Cannot find glext.h" and so on is frustrating enough).

Having said that, I did try and see if I could use it but to no avail. I need an include somewhere and I don't know what.

Also, I'm not sure how to do this:

Set up camera with 90° fov and a aspect ratio of 1 looking "out" of that side.

I have a vague feeling I know what I need to do: gluLookAt() with the appropriate arguments, but since I can't use rednertarget I can't experiment and see if I'm right.
Now it turns into an OpenGL question, which I'm not familiar with. Maybe start a new thread about rendertargets in the appropriate forum?
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.

This topic is closed to new replies.

Advertisement