Page 1 of 1

Tutorial - Creating an Environment Map

Posted: Thu Nov 25, 2010 6:24 am
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!

Re: Tutorial - Creating an Environment Map

Posted: Thu Nov 25, 2010 6:27 am
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

Re: Tutorial - Creating an Environment Map

Posted: Thu Nov 25, 2010 10:14 pm
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.

Re: Tutorial - Creating an Environment Map

Posted: Wed Dec 15, 2010 4:00 am
by yzmxer608
Thanks for making this, it works great. Looks tons better than just the sky in the reflection.

Re: Tutorial - Creating an Environment Map

Posted: Tue Apr 19, 2011 7:27 am
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 :)

Re: Tutorial - Creating an Environment Map

Posted: Thu Apr 23, 2015 4:42 pm
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.

Re: Tutorial - Creating an Environment Map

Posted: Thu Apr 23, 2015 4:46 pm
by staydown
^^^please delete previous post^^^ figured it out

Re: Tutorial - Creating an Environment Map

Posted: Wed Sep 28, 2016 1:17 am
by M@xTizZz
thanks for this tutorial !