anachronox-sdk/docs/envmap/step2-povray.html

134 lines
5.4 KiB
HTML
Raw Normal View History

2002-01-21 00:00:00 +00:00
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<META name="generator" content="HTML Tidy, see www.w3.org">
<TITLE>Step 2: Render using POVray</TITLE>
<LINK type="text/css" rel="stylesheet" href="../webdocs.css">
</HEAD>
<BODY>
<P><A href="step1-cube.html">[Previous - Step 1: Cube Map]</A>
<A href="step3-post.html">[Next - Step 3: Post
Processing]</A></P>
<H1>Step 2: Render using POVray.</H1>
<P>At this point you should have your six-sided cube map. If
not, go and do the stuff in <A href="step1-cube.html">step
1</A>. The cube sides should be named <B>env1.tga</B> through
<B>env6.tga</B> and should correspond to the sides shown in the
reference graphic in <A href="step1-cube.html">step 1</A>. From
this point forward we will refer to these six targa files as
your <I>cube map textures</I>. Note that as long as your cube
map textures were generated with equal horizontal and vertial
FOV, it does not matter what their dimensions are. For example,
Anachronox would have written screenshot files at the
resolution of the game, say, 1280x960, and these non-square
images are just fine for use in this step. Do <B>NOT</B> shrink
down these images before using them here because you will
degrade the quality of the environment map. We only shrink down
the image sizes in the last step.</P>
<P>This step involves using POVray to render the cube map onto
two back-to-back parabolic mirrors. If you want to see a
visualization of what these surfaces look like, check out <A
href="joeyparab.m1v">this neato render</A> that I did (1.9 MB
mpeg1 video).</P>
<H4>POVray installation</H4>
<P>POVray 3.1 or higher must be installed on your system. You
can find a copy of POVray for Windows on our PION server. Just
run <B>POVWIN3.EXE</B> from <A target="_blank" href=
"file:////pion/devl/anox/envgen/install">
\\pion\devl\anox\envgen\install</A>. This zip file in that
directory is optional and does not need to be installed.</P>
<P>Once POVray is happily installed, take your cube map
textures and dump them into <A target="_blank" href=
"file:////pion/devl/anox/envgen/input">
\\pion\devl\anox\envgen\input</A>. Note that since this
directory is accessibly by everybody, you should make sure that
nobody else is trying to do this at the same time. Now it's
time to execute a batch file.</P>
<P>Open up a command prompt Window. Lets say you have <B>
\\pion\devl</B> mapped to your <B>V:</B> drive. Go to your <B>
V:</B> drive, then change your current directory to <B>
\anox\envgen</B>. Now run the batch file envgen.bat. Here is a
sample command prompt session:</P>
<PRE class="cmd">
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.
C:\&gt;<B>v:</B>
V:\&gt;<B>cd\anox\envgen</B>
V:\anox\envgen&gt;<B>dir</B>
Volume in drive V is ION_STORM
Volume Serial Number is 0000-0000
Directory of V:\anox\envgen
12/04/2000 02:45p &lt;DIR&gt; .
12/04/2000 02:45p &lt;DIR&gt; ..
12/04/2000 02:08p &lt;DIR&gt; bin
12/04/2000 02:33p &lt;DIR&gt; data
12/04/2000 02:30p &lt;DIR&gt; input
12/04/2000 02:47p &lt;DIR&gt; install
12/04/2000 02:52p &lt;DIR&gt; output
12/04/2000 02:37p 774 envgen.bat
1 File(s) 774 bytes
7 Dir(s) 999,999,999 bytes free
V:\anox\envgen&gt;<B>envgen</B>
Ready to render to .\output\
Press any key to continue . . .
</PRE>
<P>The <B>envgen.bat</B> batch file will check to make sure
that all the necessary binary and data files are in the right
place before proceeding. After pressing a key, POVwin for
Windows should start, and it will render two 1024x1024 Targa
files and place them into output. It takes a while for POVray
to render, so be patient. Here is a sample screenshot of what
you should see while POVray is rendering:</P>
<P><IMG src="povray-screen.gif" alt="POVray screenshot"></P>
<P>Note that you can interrupt the render by clicking "Stop" in
the toolbar. Please do not modify the batch file on the PION
server or any of the POVray scene files, since everybody is
using the same files. You can copy the entire \anox\envgen
directory to your local hard drive if you want to make changes.
When POVray is done, the \anox\envgen\output directory should
contain 1.tga and 2.tga like this:</P>
<PRE class="cmd">
V:\anox\envgen&gt;<B>dir output</B>
Volume in drive V is ION_STORM
Volume Serial Number is CCE1-EA2B
Directory of V:\anox\envgen\output
12/04/2000 09:05p &lt;DIR&gt; .
12/04/2000 09:05p &lt;DIR&gt; ..
12/04/2000 09:04p 2,644,648 1.tga
12/04/2000 09:06p 2,625,045 2.tga
2 File(s) 5,269,693 bytes
2 Dir(s) 1,554,313,216 bytes free
</PRE>
<P>That's it! Now you have two hi-resolution renders to be used
as sources for the parabolic environment map textures. You're
now ready for the next step...</P>
<P><A href="step1-cube.html">[Previous - Step 1: Cube Map]</A>
<A href="step3-post.html">[Next - Step 3: Post
Processing]</A></P>
</BODY>
</HTML>