The overall process:
1) Download and install POVray
2) Once installed, set up a new resolution. Go Tools>Edit resolution INI file. Add this to the end of the file:
[2050, AA 0.3]
Width=2050
Height=2050
Antialias=On
Antialias_Threshold=0.3
If you are using a 2049 map, try this one (will take alot longer to render):
[4098, AA 0.3]
Width=4098
Height=4098
Antialias=On
Antialias_Threshold=0.3
You will need to restart the program to use it. Underneath the file/edit menu, set the render preset to [2050, AA 0.3]
3) Open your track in game, go into editor, and hit 'p' to export track.pov.
4) Take track.pov and terrain.png (copy this one) out of the folder. Put track.pov, terrain.png, a copy of your track folder, and this modified shadow.pov file into the same folder (make a new folder on the desktop if you want to). The purpose of having your track folder, is so that POVray can use your object textures. The textures need to be in the same directory as you have them in the statues file. So, if your texture is @tex1.png, you just need to have this in the same folder as the .pov files. If it is @texturefolder/tex2.png, you need to create a folder called texturefolder, and put the textures in this.
This is what you should have so far:
5) Open shadow.pov file in POVray. There will be two lines with the following comments:
// PUT SUN CO-ORDINATE IN THE ARROW BRACKETS
// SCALE x (RESOLUTION - 1) = LENGTH & WIDTH ---> EG. 1.6 x (1025-1) = 1638.4
Follow these instructions. Save the file.
6) You should now be able to render the shadows. Have shadow.pov as the active window in POVray, and click the Run button (located underneath the help menu). After a few seconds, a message will pop up asking about I/O restrictions. Just click OK. You will probably get an error if something is missing. We will get to that later.
After a while, the shadow map will be rendered on screen. Once it is done, it will be saved as shadow.bmp
7) Open shadow.bmp in an image editing program. Resize it to the same size as your terrain.png image. Set it to grayscale, and save it as shadows.pgm (make sure you type in the .pgm part). Put it in your track folder, refresh the shading in game, and voila! Shadows. Make sure you save the track once you refresh. If the shadows seem too dark, make the image brighter in your image software.
---------------------------------------------------------------------------------------------------------
If you got an error:
OK, so I'm gonna guess that you got an error message? This could be caused by one of the following reasons:
- You are missing object textures
- You have used billboards
ppm "blue.ppm"
with
png "dummy.png"
Save it once your done, and try running shadow.pov again.
_________________
The trickiest part of all, is if you need shadows for billboards. If you dont need shadows for billboards, just remove the billboards file before you export track.pov. But if you used billboard trees, this isn't really an option.
The easiest way to render shadows for billboard trees, is not really easy at all. We are going to convert the billboard to a 2 plane model.
You will need to backup your billboards and statues files. Then, you need to take all the billboard tree lines from the billboards file, and put them into the statues file.
A billboard line will be in the format:
[x y z] size aspectratio @trackname/texture.png
but for statues, it needs to be
[x y z] angle @trackname/model.jm @trackname/texture.png null
So, once the lines from the billboard file are in the statues file, just replace
size aspectratio @trackname/texture.png
with
angle @trackname/model.jm @trackname/texture.png null (set the angle to 0)
You will probably need a 2 plane model. Here are a few models at different sizes (the sizes should be similar to the size in the billboards file, ie if your billboard size is 60, use 2plane-60.jm). I've also included the blend file. It is currently on 6ft. Hit 's' to scale it, then go Object>Apply>Apply scale/rotation, then export.
http://www.mediafire.com/?hctvb56cxeob5hc
Once you have done this, save your statues file, delete your billboards file, export the track.pov file, then delete the statues file, and then put the backup statues and billboard files back in.
__________
Thats pretty much it. I think I have covered everything. There are other ways of avoiding the errors, but this is my way of doing things.
If you have any problems (non noobish problems hopefully), just post them here and I'll see if I can help.
Hopefully, people start attempting to render their own shadows instead of pestering me to do it