Tutorial - Creating an Environment Map

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

Tutorial - Creating an Environment Map

Postby DJ99X » Thu Nov 25, 2010 6:24 am

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

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

Re: Tutorial - Creating an Environment Map

Postby DJ99X » Thu Nov 25, 2010 6:27 am

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

Re: Tutorial - Creating an Environment Map

Postby jlv » Thu Nov 25, 2010 10:14 pm

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.

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

Re: Tutorial - Creating an Environment Map

Postby yzmxer608 » Wed Dec 15, 2010 4:00 am

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.

User avatar
wheels1758
Posts: 4121
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: Tutorial - Creating an Environment Map

Postby wheels1758 » Tue Apr 19, 2011 7:27 am

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 :)

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

Re: Tutorial - Creating an Environment Map

Postby staydown » Thu Apr 23, 2015 4:42 pm

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.

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

Re: Tutorial - Creating an Environment Map

Postby staydown » Thu Apr 23, 2015 4:46 pm

^^^please delete previous post^^^ figured it out

User avatar
M@xTizZz
Posts: 2041
Joined: Wed Jan 25, 2012 4:20 pm
Team: TizZy-Design
Location: France

Re: Tutorial - Creating an Environment Map

Postby M@xTizZz » Wed Sep 28, 2016 1:17 am

thanks for this tutorial !
Maxime Tison #51 [EMF] | #nonumberanymore [rF]
|EMF Official admin Image| |Tizzy Design Owner Image|
Skype ID : max_tizzz


Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 2 guests