Tutorial - Creating an Environment Map

Post Reply
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Tutorial - Creating an Environment Map

Post by DJ99X »

This tutorial will allow you to create an environment map, which is used for reflections on some models.

This new method was developed by JLV, and allows for much more detailed environment maps, which take into consideration surrounding objects. The following is an example of what can be made using this method. This was created for the 2010 AMA SX tracks.

Image

My tutorial is a modified version of the instructions included by JLV.

Lets begin!


Tools Required: Setting Up:
  • Install POVray
  • Unzip skyenv.zip. A bunch of files will be within the skyenv folder
  • Open makeskybox.bat in a text editor (open makeskybox.sh for Linux). Change the directory in the first line to wherever pvengine.exe or pvengine64.exe is on your computer. Eg, I changed mine from

    set povray="c:\Program Files\POV-Ray for Windows v3.6\bin\pvengine"
    to
    set povray="C:\Users\DJ\AppData\Roaming\POV-Ray\v3.6\bin\pvengine64"

    Save the bat file.
  • Add --width 1024 --height 1024 --hidden-hud to the command line of your game shortcut.

    The game will have to be in windowed mode for this to work. The game should appear as a square box on the screen. DO NOT MAXIMIZE THE WINDOW
  • Change the Field of View to 90 in the graphics menu, or by typing '/fov 90' into the chat.
Taking the Required Screenshots
  • Playback a demo of your track. Use the free-roam camera, and place it somewhere your bike would ride. Ie place it on the track, about 4ft off the ground
  • Type in the following underlined text, one at a time, into the chat. Once the camera has repositioned itself, take a screenshot (by pressing 's' or whatever you have it set to). Do this for all 6 orientations. Take note of what each image is called (eg 'screenshot6.png'). Afterwards, rename it to the corresponding name given with each camera orientation below:

    ss-n.png: /camangle 180 0
    ss-e.png: /camangle 90 0
    ss-s.png: /camangle 0 0
    ss-w.png: /camangle -90 0
    ss-u.png: /camangle 180 90
    ss-d.png: /camangle 180 -90
Creating the Environment Image
  • Place all of the renamed images into the same folder as the makeskybox.bat file
  • Run makeskybox.bat
  • Once sky-env.png is created, feel free to do a little touching up of the colours in an image editing software. Make the colours a little deeper.
Once all of this is done, place sky-env.png into your track folder. Open the 'lighting' file. Add (or edit) the following line:

sky_env @yourtrackfoldername/sky-env.png

Tips
  • Turn flares off when doing this. Draw them in with your image editor.
  • The reflection image will come out too bright most likely. Either change the assumed_gamma from 1 to something like 2 (in the skybox.pov file), or edit the picture in your image editor.

VOILA!
Last edited by jlv on Tue Apr 19, 2011 10:55 pm, edited 2 times in total.
Reason: fixed sky-env typo
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: Tutorial - Creating an Environment Map

Post by DJ99X »

Ah nuts. JLV, can you please unlock that post? I made the mistake of saying POVray.exe insteat of pvengine.exe or pvengine64.exe
jlv
Site Admin
Posts: 14910
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Tutorial - Creating an Environment Map

Post by jlv »

I've unlocked it. You might want to disable the lens flares and manually edit them into the final map since they won't match across screenshots.
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.
yzmxer608
Posts: 15352
Joined: Mon Dec 29, 2008 4:30 am
Team: SYS
Location: Wisconsin, U.S.A

Re: Tutorial - Creating an Environment Map

Post by yzmxer608 »

Thanks for making this, it works great. Looks tons better than just the sky in the reflection.
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
wheels1758
Posts: 4132
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: Tutorial - Creating an Environment Map

Post by wheels1758 »

DJ99X wrote:sky_env @yourtrackfoldername/skyenv.png
Just got around to trying this for the first time. This tutorial is great! Only issue was with this line, should be sky-env.png :)
staydown
Posts: 558
Joined: Mon Feb 02, 2009 7:53 pm
Team: Building Tracks Only
Location: Lehigh Valley, Pa

Re: Tutorial - Creating an Environment Map

Post by staydown »

having an issue, ive used this method many times to create env maps. But for some reason, this time I hit run, and it only renders my north view. Any idea on what is wrong? I re-downloaded the script and updated the target line in the .bat file.
staydown
Posts: 558
Joined: Mon Feb 02, 2009 7:53 pm
Team: Building Tracks Only
Location: Lehigh Valley, Pa

Re: Tutorial - Creating an Environment Map

Post by staydown »

^^^please delete previous post^^^ figured it out
M@xTizZz
Posts: 2753
Joined: Wed Jan 25, 2012 4:20 pm
Team: TizZy-Design
Location: France

Re: Tutorial - Creating an Environment Map

Post by M@xTizZz »

thanks for this tutorial !
Maxime Tison
I AM NOT MXSEMF Official admin ANYMORE | PLEASE DO NOT CONTACT ME ABOUT MXSEMF
Post Reply