Environment Cubes in Max
by Architecture@Uni Melbourne · 01/25/2002 (2:08 pm) · 2 comments
1: Firstly in photoshop make a reasonably large file that is 1:2 proportions (say 1000px high and 2000px wide)
2: Assemble your panoramic images into this format, trying to keep the horizon vaguely level at the centre of the image.
3: to ensure it will wrap remember to use the offset filter in the horizontal direction. filter>other>offset (1000px in horizontal)
4: to stop the top of the image looking puckerd when it is spherically mapped onto a sphere (more on that soon), we need to apply the polar coordinates filter found: filter>distort>polar coordinates (rectangular to polar), this may appear distressing at first, but at least you are seeing it now, not in game at the top of your sky box!
basically the centre of the image is what you will see if you look straight up, so clone some nice flat sky over the centre, blur smudge, clone, etc (you know the drill).
5: now the same again only the reverse, to get our image looking vaguely logical again. filter>distort>polar coordinates but this time choose (polar to rectangular).
6: save it out in a suitable format for max jpg/tif/png... your call.
now in 3d studio max (or equivlent)
7: make a shere at position 0,0,0
8: make a texture with our image as the diffuse channel. turn off all specural/ gloss/ and abient colouration etc (we dont want it to render like it is actually a sphere) and turn the self illumination right up to 100.
9: apply the texture to the sphere with shpereical uvw mapping.
10: place a dummy at 0,0,0 also (this will be used as the reference point from which the 6 sides of our environment cube will be generated)
11: now this is the tricky bit, in another material slot on the material editor pick any channel and choose the reflect/refract map. in the reflect/refract options turn on from file (top left) and choose the pixel size to be rendered (top right) i am using 512px,
(it may be worth making this and the initial image higher to deliver enough info for the antialiasing calcs...... then reduce later for the game)
12: i will leave the other options for you to explore (atmosphere etc...), now down the bottom choose where to place your rendered out cube files then just select pick object and render maps laugh as it does all the work for you.....
refer to:
holodeck.st.usm.edu/vrcomputing/vrc_t/tutorials/surrounds/ it is for terragen, here is what you will get out of max and its sky order:
max suffix, torque suffix (replace midday)
_bk, midday_1.jpg
_rt, midday_2.jpg
_fr, midday_3.jpg
_lf, midday_4.jpg
_up, midday_5.jpg
black 4px square : midday_6.jpg
sky reflection : midday_7.jpg (wide angle: needs to be flipped horizontal)
issues:
1: remember to turn on render 2 sided in the render options
2: don't have anything in the foreground.
extra:
you could easly place a sun in (light with suitable glow effect,) remember to exclude the sphere from its illunimation otherwise it will get a big ugly hot spot on it..
sounds long winded but it really isn't. once you have done it's "easy money".
good luck
sam
2: Assemble your panoramic images into this format, trying to keep the horizon vaguely level at the centre of the image.
3: to ensure it will wrap remember to use the offset filter in the horizontal direction. filter>other>offset (1000px in horizontal)
4: to stop the top of the image looking puckerd when it is spherically mapped onto a sphere (more on that soon), we need to apply the polar coordinates filter found: filter>distort>polar coordinates (rectangular to polar), this may appear distressing at first, but at least you are seeing it now, not in game at the top of your sky box!
basically the centre of the image is what you will see if you look straight up, so clone some nice flat sky over the centre, blur smudge, clone, etc (you know the drill).
5: now the same again only the reverse, to get our image looking vaguely logical again. filter>distort>polar coordinates but this time choose (polar to rectangular).
6: save it out in a suitable format for max jpg/tif/png... your call.
now in 3d studio max (or equivlent)
7: make a shere at position 0,0,0
8: make a texture with our image as the diffuse channel. turn off all specural/ gloss/ and abient colouration etc (we dont want it to render like it is actually a sphere) and turn the self illumination right up to 100.
9: apply the texture to the sphere with shpereical uvw mapping.
10: place a dummy at 0,0,0 also (this will be used as the reference point from which the 6 sides of our environment cube will be generated)
11: now this is the tricky bit, in another material slot on the material editor pick any channel and choose the reflect/refract map. in the reflect/refract options turn on from file (top left) and choose the pixel size to be rendered (top right) i am using 512px,
(it may be worth making this and the initial image higher to deliver enough info for the antialiasing calcs...... then reduce later for the game)
12: i will leave the other options for you to explore (atmosphere etc...), now down the bottom choose where to place your rendered out cube files then just select pick object and render maps laugh as it does all the work for you.....
refer to:
holodeck.st.usm.edu/vrcomputing/vrc_t/tutorials/surrounds/ it is for terragen, here is what you will get out of max and its sky order:
max suffix, torque suffix (replace midday)
_bk, midday_1.jpg
_rt, midday_2.jpg
_fr, midday_3.jpg
_lf, midday_4.jpg
_up, midday_5.jpg
black 4px square : midday_6.jpg
sky reflection : midday_7.jpg (wide angle: needs to be flipped horizontal)
issues:
1: remember to turn on render 2 sided in the render options
2: don't have anything in the foreground.
extra:
you could easly place a sun in (light with suitable glow effect,) remember to exclude the sphere from its illunimation otherwise it will get a big ugly hot spot on it..
sounds long winded but it really isn't. once you have done it's "easy money".
good luck
sam
About the author
#2
05/03/2005 (5:41 pm)
Thanks San for this very helpful tutorial. It helped me so much to create my own skies, it's simple and objective. Thank you very much. 
Torque 3D Owner Spencer Boomhower
-Spencer