HP SVA V2.0 Parallel Compositing Reference Guide
provided with the samples, a window manager is explicitly started for the master. It is not
started for the slaves because they do not receive input from input events.
The samples use different techniques for communicating. Several take advantage of the fact
that pcBeginFrame is a natural sync point. Slaves can be free-running and block on this
call. Several take advantage of using the PCcontext to communicate information, such as
the size of the their framelet which matches the size of the frame. The master can set this
before pcFrameBegin and the slaves can get this value after pcFrameBegin. In the
intermediate samples, a socket is introduced for the master to communicate with the slaves.
Relating this back to GLUT, the use of GLUT by the master is very much as you would
expect in a non-distributed application. On the other hand, the slaves use GLUT differently.
The slaves are run in full screen mode. They declare a display function and set their idle
function to post a re-display.
1.7.2 Techniques to Maximize Performance
• Best Pixel Format
The best performance format for depth compositing for this release is
PC_PF_BGR|PC_PF_Z32I.
The best compositing format for alpha compositing is PC_PF_BGRA8.
• Avoid Transferring Unnecessary Data
The Library lets you control what information is transmitted to hosts with outputs: only
color information or both color and depth. Setting the PC_OUTPUT_DEPTH context property
to 0 (the default value) reduces network traffic to the output node by 50% compared to
setting this property to 1.
Do not ask for output on nodes that do not display output.
Minimizing the size of framelets generated by a host is another good way to minimize
network traffic. A technique for doing this is to calculate a bounding rectangle around the
area on the frame where the host has provided no background pixels. The boundingbox
and multiple-framelets samples both do this successfully.
• Use the PC_HP_frame_output Extension Function If Possible
The HP Library provides two functions for returning pixel data:
— pcFrameResultChannel
— pcFrameWaitOutputHP
If you use pcFrameResultChannel to get composited data, then the call blocks until the
pixels for the specified rectangle become available. If the order in which the Library processes
the blocks does not match the order in which you ask for the results, then your code is
blocked. If you really need the pixels in a specific order (say, for writing to a file), then use
this function.
In general, you would just want to display the pixels using glDrawPixels. glDrawPixels
is a costly call. This means that the extra time spent waiting just adds to the latency of an
application. If you use pcFrameWaitOutputHP, then you get blocks of composited pixels
when they become available. This means that the glDrawPixels call proceeds in parallel
with the Library processing the next block. This reduces the overall latency of the application.
Additionally, you may choose to use bounding boxes to minimize data transfer. In this case,
the framelets drawn by the hosts might not cover the entire area of the frame (bounded by
PC_FRAME_WIDTH and PC_FRAME_HEIGHT). In such cases, pcFrameWaitOutputHP only
returns pixels for the regions defined by the framelets. The undefined regions are not
returned. A way to handle the undefined regions is to clear the display with the background
color before drawing the pixels returned by pcFrameWaitOutputHP.
24 Main Areas of the Parallel Compositing Library