Vizard 7 » Reference » Clustering » Cluster masks
7.7

Cluster Masks

Clusters are most often used to share the rendering of a scene across multiple image generators and/or display screens. As such, configuring comes down to mainly specifying what the view of each cluster machine should render.

Using cluster masks

Normally, all commands executed on the master computer are executed on the clients computers. There are times, however, when you will want special commands executed on only the master or only on particular clients. For instance, configuring each computer's view is such a case.

 

The basic structure for executing commands on a certain computer is:

with viz.cluster.MaskedContext(mask):
    # commands ....

The mask commands accept any combination of  viz.MASTER, viz.ALLCLIENTS, or viz.CLIENT1...9 as arguments. So, if you only want the MASTER to execute a given command, then you would do as follows:

with viz.cluster.MaskedContext(viz.MASTER):
    viz.clearcolor(viz.RED)
    viz.fov(60)

This would result in only the master computer changing its clear-color and field-of-view. Likewise, if you only wanted CLIENT2 to do something, you would use with viz.cluster.MaskedContext(viz.CLIENT2).

Specifying views through rotations

Likely, you'll want each client to render unique views to your virtual environment. To do this, you can use rotations as described here or the more general frustum method described in the next section.

 

Rotations are the easiest to implement as all that you need to specify is the angular offset for each separate field of view and assign that to each client using an appropriate mask. Rotations provide the projectively correct solution when the eyepoint is exactly on axis with the screen's principle line-of-sight axis. This is illustrated in the figure by the blue eyepoint. When this is not the case, the more general frustum approach is necessary to get proper projections. Such a situation is shown in the figure by the red eyepoint. Often, however, the differences are subtle and not necessary for casual viewing.

 

The example code below illustrates how to properly specify a 3 screen configuration in which the user's eye will be aligned with the intersection of each screen's principle line-of-site. In the example, as in the figure, the screens are rotated 45 degrees relative to the master view.

# Configure a three screen cluster with 45 deg offset
import viz
viz.go()

# Master's view is straight ahead so no adjustment
# is necessary.

# Modify left client for 45 counter-clockwise rotation
with viz.cluster.MaskedContext(viz.CLIENT1):
    viz.MainWindow.setViewOffset( viz.Matrix.euler(-45,0,0) )

# Modify right client for 45 clock-wise rotation
with viz.cluster.MaskedContext(viz.CLIENT2):
    viz.MainWindow.setViewOffset( viz.Matrix.euler(45,0,0) )

# Set the FOV for all renderers
viz.fov(35, 1.333)

See also

In this section:

Cluster basics

Connecting your cluster

Collaboration

Cluster callbacks

Handling project resources

Clustering Command Table

Other sections:

Vizcave

Networking basics