Overview
The eqPly example is the reference implementation of an Equalizer application. It does render polygonal data, read from a ply file. It supports all Equalizer compound features, namely 2D (sort-first), DB (sort-last) and Eye (stereo) decompositions. In DB mode, each contributor renders it's part of a model in a different color to illustrate the database decomposition.
The Programming Guide covers the application structure of eqPly extensively. A semester thesis in German (Entwicklung eines parallelen OpenGL Polygon-Renderers) covers the kd-tree implementation for Equalizer 0.4.
Application Structure
As with any Equalizer application, eqPly consists of the main application and the rendering clients. In this simple example, they are both contained in the same executable. The executable can also be run as a resident render client, which is used to pre-launch rendering clients manually.
Application Main Loop
The main application is driving the rendering, that is, it controls the execution flow by receiving events from the render nodes, acting on these events and by issuing the rendering of new frames. It does not execute any rendering code.
Render Nodes
The main function executes first eq::init(), which will not return when the program is launched by the server as a render client. The Equalizer library connects the render client to the server, and receives commands from this server. The individual rendering entities --nodes, pipes, windows, channels-- are created using the NodeFactory. On these entities, various functions, e.g. init, update and exit, are called based on the commands received from the server. These callback functions typically receive an identifier defined by the application to provide contextual information. For example, the node's init method receives the identifier of the InitData object, as defined by the application. It instanciates the object and loads the polygonal model named by the InitData. A seperate document describes all task methods.
Event Processing
Equalizer collects events for all windows asynchronously and sends them to the application thread, where they are processed at the end of the frame by Config::handleEvent. This example implements a trackball, move and zoom mouse interaction, as well as some keystroke commands. A separate document describes the event handling.
Usage
USAGE: ./examples/eqPly/eqPly [-g] [-v] [-w] [-n ] [-r] [-b] [-p ] [-m ] [--] [--version] [-h] Where: -g, --glsl Enable GLSL shaders -v, --vbo Use the new VBO rendering -w , --windowSystem Window System API ( one of: AGL glX ) -n , --numFrames Maximum number of rendered frames -r, --resident Keep client resident (see resident node documentation on website) -b, --bw Don't use colors from ply file -p , --port tracking device port -m , --model ply model file name --, --ignore_rest Ignores the rest of the labeled arguments following this flag. --version Displays version information and exits. -h, --help Displays usage information and exits.
