sphere mapped sky to sky box conversion

jlv
Site Admin
Posts: 13935
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

sphere mapped sky to sky box conversion

Post 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.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
DJ99X
Posts: 15522
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: sphere mapped sky to sky box conversion

Post by DJ99X »

Why thank you :D
ddmx
Posts: 5298
Joined: Sun Apr 20, 2008 3:36 pm
Location: Midland MI

Re: sphere mapped sky to sky box conversion

Post by ddmx »

An excellent addition!
The MXS 1%
yzmxer608
Posts: 15348
Joined: Mon Dec 29, 2008 4:30 am
Team: SYS
Location: Wisconsin, U.S.A

Re: sphere mapped sky to sky box conversion

Post by yzmxer608 »

Nice! Should open up some more possibilities for already made skies.
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
DJ99X
Posts: 15522
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: sphere mapped sky to sky box conversion

Post 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.
staydown
Posts: 558
Joined: Mon Feb 02, 2009 7:53 pm
Team: Building Tracks Only
Location: Lehigh Valley, Pa

Re: sphere mapped sky to sky box conversion

Post 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
ddmx
Posts: 5298
Joined: Sun Apr 20, 2008 3:36 pm
Location: Midland MI

Re: sphere mapped sky to sky box conversion

Post 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.
The MXS 1%
jlv
Site Admin
Posts: 13935
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: sphere mapped sky to sky box conversion

Post 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.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
DJ99X
Posts: 15522
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: sphere mapped sky to sky box conversion

Post 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.
jlv
Site Admin
Posts: 13935
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: sphere mapped sky to sky box conversion

Post by jlv »

I've uploaded a modified version of this script for converting sky cubes to environment maps: skyenv.zip
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
DJ99X
Posts: 15522
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: sphere mapped sky to sky box conversion

Post by DJ99X »

You are a legend! Thanks!
DJ99X
Posts: 15522
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: sphere mapped sky to sky box conversion

Post by DJ99X »

To anyone who didn't realise, this is the thing used for converting screenshots into an environment map
Garasaki
Posts: 1958
Joined: Mon Feb 04, 2008 4:33 pm

Re: sphere mapped sky to sky box conversion

Post by Garasaki »

whats an enviroment map? -env???
Image
DR.MIZ wrote: Keeping something "secret" so you can be "cool" is not making a flourishing community.
yFMX
Posts: 318
Joined: Fri May 30, 2008 9:19 pm
Team: Privateer
Location: France

Re: sphere mapped sky to sky box conversion

Post 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.
Image
Garasaki
Posts: 1958
Joined: Mon Feb 04, 2008 4:33 pm

Re: sphere mapped sky to sky box conversion

Post by Garasaki »

Oh wow, there's a lot more detail in the readme, that is really really cool!!!!!!!!!!
Image
DR.MIZ wrote: Keeping something "secret" so you can be "cool" is not making a flourishing community.
Post Reply