Speed Dreams Documentation Wiki
Combine shadow maps and track sources
Step 1: Preparation
- Create your shadow map first: Create a shadow map for tracks in Blender
- Make sure you have installed the optimized AC3D exporter for Speed Dreams
- First check if no mesh of a track object has more than 500 faces, if so try to cut it in two. In Blender you can achieve this:
- By switching to "Edit Mode" via "Tab" key
- Selecting faces you want to seperate
- Press "P > Selected" at the "Seperate" menu in "Edit Mode"
- Now check if every face is triangulated. If you find quad faces you can triangulate them in Blender by:
- Select the object you'd like to triangulate
- Switch to "Edit Mode" via "Tab" key
- Select all faces of the object by pressing "A" key
- Press "CTRL+T" to triangulate the selected faces
- Make sure your meshes have no duplicated vertices, Blender allows you to remove them by:
- Select your object and switch to "Edit Mode" by pressing the "Tab" key
- Press "A" key in "3D View" to select all vertices
- Now press "W" key and select "Remove Doubles" from the context menu
Step 2: Export & Result Check
- After you've exported your track, open it in a text editor and check if there are any faces not triangulated by searching for "refs 4"
- If you found objects with "refs 4" property, triangulate them in Blender by searching them at the "Outliner" module and export your track again
- If you find objects with "refs 2" then duplicate the last vertex point at the source and change "refs 2" to "refs 3"
Step 3: Compiling Shading/shadows with track sources
-
After all checks are done and your track source is error free, try to add shading with:
sd-accc +shad YourTrackSourceAC3D.ac YourTrackSourceAC3D-shade.ac
-
Open the YourTrackSourceAC3D-shade.ac in your favorite text editor and replace "shadow2.rgb" with "shadow2.png"
-
Now combine your track source with track shading:
sd-accc -g YourTrackSourceAC3D.acc -l0 YourTrackSourceAC3D.ac -l1 YourTrackSourceAC3D-shade.ac -d3 1000 -d2 500 -d1 300 -S 300 -es
-
After that you have to modify YourTrack.xml to load YourTrackSourceAC3D.acc instead of YourTrackSourceAC3D.ac:
<attstr name="3d description" val="chemisay.acc"/>
-
Test the shaded track and optimize the shadow2.png if necessary.
- Sometimes trees look much better when you exclude them from shading, change the texture setting from:
texture "chm-trees_n.png" base
texture "shadow2.png" tiled
texture empty_texture_no_mapping skids
texture empty_texture_no_mapping shad
to
texture "chm-trees_n.png"
Stripe
- For the 2nd run of sd2-accc you need a utility called Stripe. It converts a polygonal model into triangle strips.
- For Linux, download stripe.tar.gz from http://www.cs.sunysb.edu/~stripe/stripe.tar.gz and then compile & install the usual way (tar -zxvf stripe.tar.gz ; cd Stripe ; make ; sudo cp stripe /usr/local/bin/).
- If you use Windows, stripe.exe can be donwloaded from Vicente's site - simply unzip and put stripe.exe into the same directory where is sd2-accc.exe is located.