sphere mapped sky to sky box conversion

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

sphere mapped sky to sky box conversion

Postby jlv » Wed Jul 29, 2009 1:53 am

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.

User avatar
DJ99X
Posts: 15461
Joined: Tue Jan 15, 2008 11:36 am
Team: El Chupamobra
Location: Upper Shit Creek, Sans Paddlington

Re: sphere mapped sky to sky box conversion

Postby DJ99X » Wed Jul 29, 2009 1:58 am

Why thank you :D

ddmx
Posts: 5264
Joined: Sun Apr 20, 2008 3:36 pm
Team: Epikmx.com
Location: Midland MI
Contact:

Re: sphere mapped sky to sky box conversion

Postby ddmx » Wed Jul 29, 2009 5:14 am

An excellent addition!
The MXS 1%

User avatar
yzmxer608
Posts: 14987
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: sphere mapped sky to sky box conversion

Postby yzmxer608 » Wed Jul 29, 2009 5:31 am

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.

User avatar
DJ99X
Posts: 15461
Joined: Tue Jan 15, 2008 11:36 am
Team: El Chupamobra
Location: Upper Shit Creek, Sans Paddlington

Re: sphere mapped sky to sky box conversion

Postby DJ99X » Wed Jul 29, 2009 5:51 am

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.

User avatar
staydown
Posts: 557
Joined: Mon Feb 02, 2009 7:53 pm
Team: Building Tracks Only
Location: Lehigh Valley, Pa

Re: sphere mapped sky to sky box conversion

Postby staydown » Wed Jul 29, 2009 1:34 pm

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: 5264
Joined: Sun Apr 20, 2008 3:36 pm
Team: Epikmx.com
Location: Midland MI
Contact:

Re: sphere mapped sky to sky box conversion

Postby ddmx » Wed Jul 29, 2009 4:07 pm

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: 12382
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: sphere mapped sky to sky box conversion

Postby jlv » Wed Jul 29, 2009 9:07 pm

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.

User avatar
DJ99X
Posts: 15461
Joined: Tue Jan 15, 2008 11:36 am
Team: El Chupamobra
Location: Upper Shit Creek, Sans Paddlington

Re: sphere mapped sky to sky box conversion

Postby DJ99X » Wed Jul 29, 2009 11:52 pm

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: 12382
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: sphere mapped sky to sky box conversion

Postby jlv » Fri Nov 12, 2010 12:41 am

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.

User avatar
DJ99X
Posts: 15461
Joined: Tue Jan 15, 2008 11:36 am
Team: El Chupamobra
Location: Upper Shit Creek, Sans Paddlington

Re: sphere mapped sky to sky box conversion

Postby DJ99X » Tue Nov 16, 2010 3:16 am

You are a legend! Thanks!

User avatar
DJ99X
Posts: 15461
Joined: Tue Jan 15, 2008 11:36 am
Team: El Chupamobra
Location: Upper Shit Creek, Sans Paddlington

Re: sphere mapped sky to sky box conversion

Postby DJ99X » Tue Nov 16, 2010 3:18 am

To anyone who didn't realise, this is the thing used for converting screenshots into an environment map

Garasaki
Posts: 1949
Joined: Mon Feb 04, 2008 4:33 pm

Re: sphere mapped sky to sky box conversion

Postby Garasaki » Tue Nov 16, 2010 1:43 pm

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: 311
Joined: Fri May 30, 2008 9:19 pm
Team: Privateer
Location: France

Re: sphere mapped sky to sky box conversion

Postby yFMX » Tue Nov 16, 2010 1:46 pm

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: 1949
Joined: Mon Feb 04, 2008 4:33 pm

Re: sphere mapped sky to sky box conversion

Postby Garasaki » Tue Nov 16, 2010 1:50 pm

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.


Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 1 guest