Requirements:
- Toribash
- RenderMan-compliant renderer (preferably
Aqsis, but you may try others such as
Pixie or
jrMan)
- Fast computer OR plenty of patience
- renderman.lua in your Toribash script directory
- create a directory in the script directory called "renderman"
Simple 4-step process to creating your render
1. During any fight or replay, press T to open the text input.
-You should see the line "Say: " and a blinking cursor.
2. Type
/ls renderman.lua
-This will create 2 files in the /data/script/renderman directory, namely main.rib and shadow.rib.
3. Run
aqsis shadow.rib at a command line in the same directory. If you use other renderers, use the equivalent command to produce the shadow map.
-This will create 1 shadow map file, shadow.shd in the directory.
4. Run
aqsis main.rib at a command line in the same directory (or equivalent for other renderers).
-This will create a TIF image in the directory.
renderman.lua, and how you can change it
There are many variables you may change in renderman.lua to affect your render. They are listed near the beginning under the header 'Variables'.
rib: Name of your main RIB file. The default is main.rib.
shadow_rib: Name of your shadow RIB file. The default is shadow.rib.
image_name: Name of your final image. The default is main.tif.
shadow_name: Name of your shadow map. The default is shadow.shd.
shader_joint: Shader used for joints. Shaders will be explained in detail in a later section below.
shader_body: Shader used for body parts.
bgcolor: Background color of the environment.
fps and
frame_len: Affects your motion blur effect; the lower the fps, the longer the frame_len, and the frame_len is the time the camera shutter remains open. High fps = shorter "trails" from motion blur, low fps = longer "trails". Generally, you do not want to set the fps to low values*.
pixel_samples: In layman's terms, this is the quality of your image, the higher, the better, but longer rendering time.
shadow_pixel_samples: Image quality of shadows.
display_mode: Use either "file" or "framebuffer". File creates an image file, while framebuffer renders it to a window (you can see it being rendered).
res_width: The width of your output image.
res_height: The height of your output image. Don't change the value here if you want to maintain the 4:3 screen ratio.
shadow_res: Width AND height of shadow map. This value should be bigger than your actual image's width and height, and must be a value to the power of 2 (i.e. 256, 512, 1024... 2^n). A height value is not required because the shadow map is a square.
fov: Field of view. The default is 49.0.
cam: Should not be changed, this takes the camera position directly from the game. If you want to do it manually, then I won't stop you.
focus: Specifies the position of where the camera is focusing. The default is on the chest of player 0. Changing the first parameter of get_body_info for each axis (x, y, z) from 0 to 1 will focus on player 1.
dof: Calculates the distance of the focal point to the camera to give the
Depth of Field. You may manually specify a distance and ignore the focus variable if you wish.
fstop: What this affects is best explained by the series of pictures
here. It is not too essential, but if you have some experience with cameras, look it up.
*Due to some limitations, the motion blur cannot make an arcing motion, you can either have a straight motion or a rotating motion. The motion blur is created by offsetting the body part from its current position using the velocity.
Lighting and Shadows
light1: Specifies the position of the light source, lookat position and intensity.
If you are more experienced, you can change "shadowdistant" to one of the following for different light sources:
shadowdistant,
shadowspot,
shadowpoint
You may need to change some parameters, too. Read up the Renderman Interface Specification (link below).
Player Colors
In the renderman.lua script, player joint colors are by default orange (RGB: 1, 0.5, 0) and light blue (RGB: 0, 0.25, 1). Body part colors are white (RGB: 1, 1, 1). You may change this manually (they are specified at the beginning of both the Joints and Body sections). If you want to give different colors to different parts, use an if .. else statement to define the colors before the line:
file:write("TransformBegin\n")
Remember to use a default color for the else part, or the color specified will be used for the remaining joints.
Blood
num_segments: This is only used when rendering blood with the Blobby function. This divides the Blobbies into segments, because rendering ALL the Blobbies as a single entity takes very long. Even after dividing, Blobbies generally take long to render. It is currently disabled, because the sphere method is much faster, plus I can motion blur the spheres.
Some new functions relating to blood particles are:
get_active_bloods: Returns a list of active blood particles
get_blood_pos: Returns the coordinates of the blood particle
get_blood_radius: Returns the radius of the blood particle
get_blood_vel: Returns the linear velocity of the blood particle
The following two functions were not used (they aren't particularly useful here, but I shall list them anyway):
get_num_blood_particles: Returns the number of blood particles (active and inactive)
get_blood_age: Returns the age of the blood particle
Floor
The world floor is a 1x1 square scaled to 50 (effectively 50x50). The default color is white (RGB: 1, 1, 1), you may change it however you see fit.
Shaders
If you are using Aqsis, standard shaders (like the ones used in the example, "plastic" and "background") are included in the shaders folder. SL files are the ones for shading language. Running aqsl on an SL file will produce an SLX file, which is needed for the render. Feel free to experiment with the shading language and show the community any interesting results you may have found.
Cheers!
Yunn
P.S. Keep an original copy of renderman.lua and save your experimentation copy as something else just in case you need to refer back to the original.
Useful links:
RenderMan® Interface Specification
The RenderMan Academy
Last edited by Yunn_old; Sep 14, 2007 at 05:16 AM.