racer home

Racer How-To: using multiple computers

 

Home Some options using multiple computers are available.


Dolphinity Organiser - free planning, project management and organizing software for all your action lists

Introduction

Multiview is only available to licensed users of Racer. Contact Cruden for more information.

Racer doesn't only run by itself on a single computer; you can use multiple computers in a (LAN) network for some nifty features. Some of these features are available under license only though!

For more information on frame-locking several PC's to each other, check this page.

Network layout

Although not required, it can help to think about your network layout before hooking up other computers. Here is the system we use:

This system becomes extremely useful when you need to combine a multitude of computer to setup a Racer simulation park. The 1st simulator IP's would start at 11, the 2nd simulator at 21 etc.

Spectator view (multiplayer)

To setup an extra computer watching the race, the following needs to be done:

To go from a normal racer.ini to a spectator version, follow these guidelines:

Multiview - side views using extra computers

Multiview is a feature where you add extra views to create left & right views. An alternative is to use 1 computer where a graphics card sends out 3 signals, but multiview is based on using multiple computers for performance.

The main computer is called the master. This master computer runs Racer, does all the physics, controls etc. The side computers are simpler slaves, running the same racer.exe but using different configuration files (racer.ini variants). For simplicity, you can copy the entire Racer directory to the side computers, and use racer_l.ini and racer_r.ini files (these filenames are not hardcoded, they're just common practice) to overrule any settings defined in the regular racer.ini.

On the multiview computer, make a racer_l.ini file (in the installation directory, i.e. c:\sims\racer) and put these settings in it:

multiview
{
; Multiple PC rendering
; Are we a slave computer?
slave=1
; Where is the master?
master=+1
port=25010
; Logical offset with respect to master computer's view
offset_x=-1
offset_y=0
; Track view?
track=0
; Use time of day send/receive?
use_tod=0
; Asym persp
aspect_factor=3.0
angle_factor=0
; Offset wrt center car
project_left=0
project_right=0.33
}

Some information regarding the settings:

Running the left screen is done then by 'racer.exe -f racer_l.ini'. This makes sure any values from racer_l.ini overrule those in racer.ini, but the values from racer.ini are still used for any unspecified keys.

In the same way you create racer_r.ini for the right computer, using project_left=0.67 and project_right=1.0 (or use the values calculated in the Excel sheet for more accurate values).

Multiview and car cameras

Racer currently only supports 1 camera type that is processed correctly for side screens. If the side screens show a quite misaligned view, it may be that you need to modify the car's first camera (in data/cars/<carname>/car.ini, camera0 tree). An example is shown below. You can freely modify FOV, but the src/dst settings indicate an SMD (Spring/Mass/Damper) camera.

camera0
{
offset
{
x=0.34
y=0.65
z=0.42
}
offset_to
{
; Look at offset
x=0.34
y=0.18
z=10.25
}
angle
{
x=0.000000
y=0.000000
z=0.000000
}
; Field of view
fov=55
; Type of model to use; 0=outside, 1=inside, 2=none
model=0
wheels=0
view=0
name=incar
; Source/target inertia
src
{
mass=1.0
k=1000
damping=50
maxdist=0.2
}
dst
{
mass=1.0
k=150
damping=20
maxdist=0.2
}
}

Make sure to synchronize the car on all computers.

MULTIVIEW WITH MIRROR ON 2ND MONITOR

With multiview, you have the option of rendering a mirror view for a 2nd monitor. The idea is to cut the screen in half and to use the right half for the mirror. The mirror is a 180 rotated view plus a small degree to account for rotation of the mirrors. To do this, modify racer.ini's multiview section as follows for versions upto v0.8.6:

Version 0.8.7 improves this somewhat (the FBO was twice as big as it needed to be, resulting in wasted bandwdth). Do this instead of the above:

Using stereo

Stereo multiview is available since v0.8.7. Note that assumes separate PC's to generate the image for each eye. A combined dual-eye solution on one PC will be available in the future.

Add eye separation with multiview.eye_offset (in meters). Use a positive value for the left eye, negative for the right eye (around 0.03 and -0.03). Also set the focus distance using multiview.focus_distance (around 150 for example, this is in meters and represents the eye's distance at which it tries to focus).

Testing can be done with multiview.stereo_test. If set to 1, it will turn the separation on and off every half-second or so (mostly usable for internal development).

Using projectors

If you use the multiview computers to drive projectors, you need 2 more things: edge blending and distortion (click on the corresponding words for more information). You need distortion since the projections can normally not be overlaid without transforming the image. Hardware solutions exist, but with Cg shaders, distortion in fragment shaders is now possible. Racer uses a pixel-accurate map, controlled by splines which can easily be edited to quickly get a visual match.

Edge blending is needed to smoothly cross over from one projected image to the next. Just placing two projections exactly next to eachother is virtually impossible, so a combination of overlap and blending the one image in the other helps to smooth out slightly positional imperfections. Blending is not just a matter of linearly fading (to black), but requires a few parameters (p and gamma) since the properties of light are not linear: simply mixing 2 linearly edge blending images will result in a black dip at the middle. More information can be found in the documentation links presented at the top of this paragraph.

 


Dolphinity Organiser - free planning, project management and organizing software for all your action lists

(last updated March 28, 2013 )