Page 1 of 2

sphere mapped sky to sky box conversion

Posted: Wed Jul 29, 2009 1:53 am
by jlv
I've been meaning to upload this but never got around to it. Unadilla finally made me do it. :D

You'll need POV-Ray to run this.

Download it from here: skybox.zip

- First edit "spheremap.ppm". The one included is scaled down to keep the zip file small. I'd recommend scaling up to 4096x2048.
- Run "makeskybox.bat". You might have to edit the first line depending on where you have POV-Ray installed.

You should now have sky-n.png, sky-e.png, sky-s.png, sky-w.png, sky-u.png, sky-d.png and sky-env.png.

Re: sphere mapped sky to sky box conversion

Posted: Wed Jul 29, 2009 1:58 am
by DJ99X
Why thank you :D

Re: sphere mapped sky to sky box conversion

Posted: Wed Jul 29, 2009 5:14 am
by ddmx
An excellent addition!

Re: sphere mapped sky to sky box conversion

Posted: Wed Jul 29, 2009 5:31 am
by yzmxer608
Nice! Should open up some more possibilities for already made skies.

Re: sphere mapped sky to sky box conversion

Posted: Wed Jul 29, 2009 5:51 am
by DJ99X
Yeah, works great. I really like the reflection creation, how it puts the sun in the right spot for the reflections.

Image



This will only be good for skyspheres released on the net though, as it would be pretty hard to make a skysphere image.

How will we be able to make the reflections this does if we make a skybox using terragen?

Also, I see you used a field of view of 90.9° for the images. I'll keep that in mind next time I render skyboxes in terragen, as using 90° is probably what causes the seams that I have to fix up in photoshop.

Re: sphere mapped sky to sky box conversion

Posted: Wed Jul 29, 2009 1:34 pm
by staydown
I am a little confused on the operations here.
1: downloaded povray
2: downloaded skybox.zip and extracted to mxsim personal folder
3: opened the ppm, resized it, and saved it
4: Run makeskybox.bat???

When I click on makeskybox.bat, a dos style window flashes on and off within a second. I then right clicked the file and sent it to povray. This is what comes up. What do I do from here?...


set povray="c:\Program Files\POV-Ray for Windows v3.6\bin\pvengine"

%povray% /EXIT +FN +A -D -w1024 -h1024 -k0 -osky-n.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k1 -osky-e.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k2 -osky-s.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k3 -osky-w.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k4 -osky-u.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k5 -osky-d.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k6 -osky-env.png skybox.pov

Re: sphere mapped sky to sky box conversion

Posted: Wed Jul 29, 2009 4:07 pm
by ddmx
Make sure you have the newest pov ray installed, and that the first line of the bat file leads to the install directory for pov ray. I know I had to change mine on vista.

Re: sphere mapped sky to sky box conversion

Posted: Wed Jul 29, 2009 9:07 pm
by jlv
DJ wrote:Yeah, works great. I really like the reflection creation, how it puts the sun in the right spot for the reflections.

This will only be good for skyspheres released on the net though, as it would be pretty hard to make a skysphere image.
I used hugin to make the stock moochsky skybox. I made a 180 spherical map and then used gimp to mirror the other 180 degrees and cover up the nearby objects.
DJ wrote:How will we be able to make the reflections this does if we make a skybox using terragen?
You would have to replace the sphere at the end of the pov file with a skybox.

Re: sphere mapped sky to sky box conversion

Posted: Wed Jul 29, 2009 11:52 pm
by DJ99X
staydown wrote:I am a little confused on the operations here.
1: downloaded povray
2: downloaded skybox.zip and extracted to mxsim personal folder
3: opened the ppm, resized it, and saved it
4: Run makeskybox.bat???

When I click on makeskybox.bat, a dos style window flashes on and off within a second. I then right clicked the file and sent it to povray. This is what comes up. What do I do from here?...


set povray="c:\Program Files\POV-Ray for Windows v3.6\bin\pvengine"

%povray% /EXIT +FN +A -D -w1024 -h1024 -k0 -osky-n.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k1 -osky-e.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k2 -osky-s.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k3 -osky-w.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k4 -osky-u.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k5 -osky-d.png skybox.pov
%povray% /EXIT +FN +A -D -w1024 -h1024 -k6 -osky-env.png skybox.pov
I had the same problem as well. I don't think POVray likes whatever format I save my PPM's in. So, I changed the script so it uses PNG.

In POVray, go Search>Replace, and replace
ppm "spheremap.ppm"
with
png "spheremap.png"
Then save. Should work now.

Re: sphere mapped sky to sky box conversion

Posted: Fri Nov 12, 2010 12:41 am
by jlv
I've uploaded a modified version of this script for converting sky cubes to environment maps: skyenv.zip

Re: sphere mapped sky to sky box conversion

Posted: Tue Nov 16, 2010 3:16 am
by DJ99X
You are a legend! Thanks!

Re: sphere mapped sky to sky box conversion

Posted: Tue Nov 16, 2010 3:18 am
by DJ99X
To anyone who didn't realise, this is the thing used for converting screenshots into an environment map

Re: sphere mapped sky to sky box conversion

Posted: Tue Nov 16, 2010 1:43 pm
by Garasaki
whats an enviroment map? -env???

Re: sphere mapped sky to sky box conversion

Posted: Tue Nov 16, 2010 1:46 pm
by yFMX
this is the picture used for reflections. Now, instead of having only the sky in reflections you have everything you can see on the track.

Re: sphere mapped sky to sky box conversion

Posted: Tue Nov 16, 2010 1:50 pm
by Garasaki
Oh wow, there's a lot more detail in the readme, that is really really cool!!!!!!!!!!