*blog... kind of... *rss
PV3D Panorama / 360 & How to create your own CubeMap textures with 3D Studio MAX 23.12.2006 | |
| Longest post title in the blog for sure!
So, well.. this is a non-finished work (i'm looking to do something else with this) but I guess I got something interesting to show alredy...
Using Carlos' Panorama as base I've created my own one but also with my own scene and textures.
 View PV3D Panorama with custom 3D scene (It takes a while to load (600kb, 6 x 1024x124 textures there).
In a way, this is just a trick to have a scene of 186.122 polys, 20 lights, raytrace reflection and fog in realtime ;) Well, it's not, but you get it looks like. In a lot of games and demos they use this trick to simulate complex 3Dscenes when in fact they are rendering 6 textures to a cube and having the camera inside it.
So, if you were wondering about how to do this with your 3D scene, here it's a nice and simple how-to.
As some of you know already (and probably hate), I've used the Greeble to create the object (based on a tube). Then a couple of lights to the scene, created a material for the tunnel using raytrace for the Reflection and then adding the fog to the camera.
I'm not going to detail on all this, I would asume you know how to create 3dmodels and texture them... the point of the article if about how to get the 6 textures you need for doing the cube map of your scene.
So, after doing all this I end up with an scene like this:

At this point, what you have to do is create a box on the middle of the scene:

And then, create a new material. We only need to put a Reflect/Refract map on the Reflection slot for this new material.

Going inside the Reflect/Refract parameters we wil find everything that we need there. As you can see, 3D Studio MAX has a batch texture renderer in this section (kind of hidden). If you check the opfion "From file", then you will be able to specify where you want to save the textures and the prefix name (I've used frame01 as a prefix name). Then the last thing you need to do is after clicking on "Pick Object and Render Maps"... well, select the box, and it will generate all the maps for you.

And that's as simple as it's. This will generate these 6 images: frame01_BK.png, frame01_DN.png, frame01_FR.png, frame01_LF.png, frame01_RT.png, frame01_UP.png (which are the Back, Down, Front, Left, Right, Up textures).
Now if you want to see how it looks, here you have the Source Code! (this is just a small modification of Carlos original source code, so say thanks to him! :D Also, these sources doesn't include the PV3D AS3 classes)
You can also check out the .max file.
Enjoy! Doing 360 panoramic views with Flash hasn't ever been that easy! :)
PS: As a side note, one of the things I thought that wasn't doable with PV3D is in fact doable! Amazing! | | posted by mr.doob at 04:32 | | 8 comments written so far |
| holy sh*t! looks terrrrrrrific!
so that's why you were rendering that tunnel :) really it's quite cool! the problem is how to add more objects to the scene which do not look fake after this super trick!
| posted by sole 23.12.2006 , 10:23 |
|
| Yeah well, now what it needs is a realtime update of the cubemap textures, and you'll be able to do pretty nice and reaslistic reflections.
I don't know if you can update the textures for PV3D in realtime (haven't got that far into Flash), but if you can, there's plenty of nifty stuff you can do with it :)
http://jcl.scenesp.org/fi les/meditorsnaps/nvidia_l obby.jpg
This was pretty nice when moving :-)
| posted by Jcl 23.12.2006 , 12:13 |
|
| Cool!
If you can do some Render To Texture (thats it, update a texture, like Jcl said), you will be able to do *true* realtime reflection... with heavy performance penalisation... but, it will reflect almost any object of a scene (even moving ones).
| posted by xphere 23.12.2006 , 21:02 |
|
| I'm not sure that I understand what you guys are talking about. Update the textures? Yes, I was trying to do so, maybe on my next post about this.
But.. to update the reflections? what?! those reflections where done with 3DStudio MAX, and it took 1 minute for each render (6 in total).
This is basicly like one Amiga, PV3D/Flash has more or less (I would say much less) power than a Amiga computer, so, what you guys are saying.. is it possible to do that on an Amiga?
| posted by mr.doob 24.12.2006 , 00:47 |
|
| trickery trickery. not this specific scene, but yes, it would be quite feasible. nevermind the 1 minute mark with max. everything can be worked out, but some eye-candy must be compromised. that's what "heavy performance penalisation" is. i would like to add that flash is esentially a "heavy performance penalisation" per se, but that's your weapon of choice. just remember that, basically, a reflection from some point in the scene is like moving your pov -the center of a cubemap- to that point. and that sometimes, an hemimap is just as handful as a full six-sided-cubemap. just learn to update textures in real-time. one last thing, fwiw: you are getting close to that scene in starstruck we talked about at pmp.
| posted by spite 24.12.2006 , 19:33 |
|
| spite, yes, that's what I am after ;) (starstruck thingie) Atleast the tunel one.
| posted by mr.doob 24.12.2006 , 19:38 |
|
| just wanted to add that rendering to cube-maps doesn't work with some custor renderers in max7. don't know about max8.
| posted by kusma 04.01.2007 , 03:46 |
|
| oh yes, needs to be done with the standard renderer, gorhot mental ray/ vray / brazil...
| posted by trace 04.01.2007 , 08:19 |
|
SORRY! Is not that I don't care about what you have to say, of course I do, but they are speaking louder and I lost my patience :(
|
|
*profile

traditional id: Ricardo Cabello Miguel
based in: London, UK
serving to: Hi-ReS!
contact me: click here
*latest posts
* Showcase is back, now in Javascript (19.11.2008) * Zeh's Fnk (15.11.2008) * Lupen III (Italian Opening) VS Captain... (08.11.2008) * Duuuuude! (31.10.2008) * Pump 'N Seal, Jackie Chan, Manuela and... (26.10.2008) * Ubuntu 8.10 on a Macbook Pro (25.10.2008) * Ubuntu 8.04, Apple Keyboard - Change F... (22.10.2008) * Rules for making the internet a better... (21.10.2008) * The Magic of Viral (10.10.2008) * Jonathan Harris: Beyond Flash, an adde... (06.10.2008) * Zeitgeist: Addendum (05.10.2008) * Crisis (03.10.2008) * Youtube, now in Super HD! (30.09.2008) * Adobe AIR for Linux - Beta (28.09.2008) * What does the Google Chrome logo inspi... (28.09.2008)
*latest comments
* C++, SDL Coding? Maybe.. ;) (Preview) (trace) * C++, SDL Coding? Maybe.. ;) (Preview) (Joey) * La picaresca (spt) * Mr. Slip Up (ricardo) * La picaresca (ricardo) * La picaresca (spt) * La picaresca (sole) * Demoscene @ Cirsa (sml) * La picaresca (humphr3y) * La picaresca (alfio) * fiver2's new baby: debris (Jcl) * Barcelona = full of shit(s) (Soli) * Demoscene @ Cirsa (Scener) * Rar & unrar with Ubuntu (SethPlate) * Mindcandy 2 (Jcl)
*wish list
|