Download ParCompMark User Manual

Transcript
69
CHAPTER 3. DETAILED EXAMPLE
defaultValue=1}
{name="glFrameletEXT" type="boolean" description="Use OpenGL framelet
extension"
defaultValue=false}
{name="exportFrameStep" type="integer" defaultValue=0
description="Export every (exportFrameStep)th frame to a png file"}
]; }
Listing 3.13: Improved dynamic script, part I.
In the first part of the createLowLevelScript() function the correctness
of the dynamic script parameters is checked. Then the usual empty script
generation is done. See Listing 3.14.
function createLowLevelScript(clusterStr) {
// Check for enough render hosts
if(!DYNAMICSCRIPTPARAMETERS.rawin("renderHostCount"))
throw "There are no rendering hosts. Please add more hosts to the"+
" framework.";
// Check parameter compatibility
if(DYNAMICSCRIPTPARAMETERS .rawin("minTriangleCount") &&
DYNAMICSCRIPTPARAMETERS.renderMode == "dl")
throw "Display lists are not compatible with incremental triangle"+
" rendering.";
// Convert parameter to table
local cluster = stringToObject(clusterStr);
// Create empty structure
local lowLevelScript = createEmptyLowLevelScript("Triangle renderer",
cluster);
...
Listing 3.14: Improved dynamic script, part II.
Then the compositing context is created and added to the context list. See
Listing 3.15.
...
local nodeCount = 0; // For id generation
local processCount = 0;
local bufferCount = 0;
// Benchmark duration (0 means endless rendering)
local numberOfFrames = DYNAMICSCRIPTPARAMETERS.frameCount;
// Setup context
lowLevelScript.contexts.append({
glFrameletEXT = DYNAMICSCRIPTPARAMETERS.glFrameletEXT
frameWidth = DYNAMICSCRIPTPARAMETERS.frameWidth
frameHeight = DYNAMICSCRIPTPARAMETERS.frameHeight
colourFormat = PC_PF_BGRA8
depthFormat = PC_PF_Z32I