What is this Thing Called "Viewperf"?


Viewperf is a portable OpenGL performance benchmark program written in C. It was developed by IBM. Viewperf provides a vast amount of flexibility in benchmarking OpenGL performance. Currently, the program runs on most implementations of UNIX, Windows NT, Windows95, and OS/2.

The OpenGL Performance Characterization (OPC) project group has endorsed Viewperf as its first OpenGL benchmark. Performance numbers based on Viewperf were first published in Q4 1994 issue of The GPC Quarterly.

OPC group member companies have ported the Viewperf code to their operating systems and window environments. The OPC project group maintains a single source code version of the Viewperf code that is available to the public.

Benchmarking with Viewperf

Viewperf parses command lines and data files, sets the rendering state, andconverts data sets to a format which can be traversed using OpenGL rendering calls. It renders the data set for a pre-specified amount of time or number of frames with animation between frames. Finally, it outputs the results.

Viewperf reports performance in frames per second. Other information about the system under test -- all the rendering states, the time to build display lists (if applicable), and the data set used -- are also output in a standardized report.

A "benchmark" using Viewperf is really a single invocation of Viewperf with command line options telling the Viewperf program which data set to read in, which texture file to use, what OpenGL primitive to use to render the data set, which attributes to apply and how frequently, whether or not to use display lists, and so on. One quickly realizes there are an infinite number of Viewperf 'benchmarks' (an infinite number of data setsmultiplied by an almost infinite number of command line states).

Real-World Benchmarking

OPC project group members recognize the importance of real-world benchmarks. From the beginning, the subcommittee has sought benchmarks representative of the OpenGL rendering portion of independent software vendor (ISV) applications. Along these lines, the project group has come up with what it calls a viewset. A viewset is a group of individual runs of Viewperf which attempt to characterize the graphics rendering portion of an ISV's application.

Viewsets are not developed by the OPC project group; they come from the ISV's themselves. Members of OPC project group often 'sponsor' the ISV. Sponsorship entails helping the ISV several areas, including how to obtain the Viewperf code, how to convert data sets to a Viewperf format, how to use Viewperf, how to create Viewperf tests to characterize the application, how to determine weights for each of the individual Viewperf tests based on application usage, and finally to help offer the viewset to the OPC project group for consideration as a standard OPC viewset. Any ISV wishing to develop a Viewset should contact an OPC representative listed on the GPC Organization page .

Currently, there are three standard OPC Viewsets: Parametric Technology's CDRS, which contains seven different Viewperf tests, is a modeling and rendering application for computer-aided industrial design. IBM's Data Explorer (DX), which has 10 different tests, is a visualization application. And, Intergraph's DesignReview, which has 10 different tests, is a 3D computer model review package. All three viewsets represent relatively high-end applications. These type of applications typically render large data sets. They almost always include lighting, smooth shading, blending, line antialiasing, z-buffering, and some texture mapping.

The input to Viewperf is the command line. Here are the current command line options for Viewperf 3.0:

Program options:

-polygon -pg <file>           Viewpoint object to be used in the tests
-triangle -tr <file>          Viewpoint object to be used in the tests
-quad -qd <file>              Viewpoint object to be used in the tests
-mesh -mh <file>              Mesh object to be used in the tests
-rendermode -rm <mode>        POINT, VECTOR, LINE, POLYGON, TMESH, TFAN,
		 	      TRIANGLE, or QUAD - default LINE -vcriteria -vcrit
			      AUX Visual selection criteria - EXACT, MIN - 
			      default MIN
-vid <id>                     Ask AUX for visual with ID = <id>
-vaccum -vac                  Ask AUX for an accumulation buffer visual
-valpha -val                  Ask AUX for an alpha buffer visual
-vdepthbuffer -vz             Ask AUX for a depth buffer visual
-vstencil -vst                Ask AUX for a stencil buffer visual
-indirectrender -ir           Render indirect - default direct
-nodither -ndi                Disable dithering
-ortho -or                    Parallel/Orthographic projection - default Perspective
-displaylist -dl              Render with display list mode
-colorper -cp <mode>          FRAME = Color per Frame,
			      PRIMITIVE = Color per Primitive,
			      VERTEX = Color per Vertex - 
			      default FRAME
-texture -tx <file>           MTV image for texturing
-texgen -txg <file>           MTV image for environment mapping
-magfilter -magf <flt>        NEAREST, LINEAR - default
			      NEAREST
-minfilter -minf <flt>        NEAREST, LINEAR,
			      NEAREST_MIPMAP_NEAREST,
			      LINEAR_MIPMAP_NEAREST,
                              NEAREST_MIPMAP_LINEAR,
			      LINEAR_MIPMAP_LINEAR - 
			      default NEAREST
-texenv -te <env>             Texture environment, MODULATE, 
 			      DECAL, BLEND - default DECAL
-texcomp -tc <num>            Texture components where <num>
			      is 1,2,3, or 4 -default 3
-blend -bl                    Enable Blending
-srcblendfunc -sbf            ZERO, ONE, DST_COLOR, 
			      ONE_MINUS_DST_COLOR, 
		              SRC_ALPHA,
 			      ONE_MINUS_SRC_ALPHA, 
			      DST_ALPHA,
			      ONE_MINUS_DST_ALPHA,
                              SRC_ALPHA_SATURATE - 
	                      default SRC_ALPHA
-dstblendfunc -dbf :          ZERO, ONE, SRC_COLOR,
                              ONE_MINUS_SRC_COLOR, 
                              SRC_ALPHA,
                              ONE_MINUS_SRC_ALPHA,
                              DST_ALPHA,
                              ONE_MINUS_DST_ALPHA,- default
		              ONE_MINUS_SRC_ALPHA
-linewidth -lw <width>        Linewidth for wire/vector tests - 
			      default 1.0 -xwinsize
-xws <side>                   Size of test windows X dimension - 
                              default 700
-ywinsize -yws <side>         Size of test windows Y dimension - 
			      default 700
-numframes -nf <num>          Number of frames to be rendered 
                              during calibration phase - default 2
-numlights -nl <num>          Turns on <num> lights - default 0
-backface -bf                 Cull Backfacing primitives - default off
-frontface -ff                Cull Frontfacing primitives - default off
-singlebuffer -sb             Single buffer mode
-fog -fg                      Enable fog
-linesmooth -ls               Enable line antialiasing
-polysmooth -ps               Enable polygon antialiasing
-facetnormal -fn              Use facet normals when lighting
-linestipple -lp              Enable line stipple
-polystipple -pp              Enable polygon stipple
-toggle -tg <cap>             Toggle per primitive - BLEND, 
			      DEPTH_TEST, DITHER,
                              LIGHTING, LINE_WIDTH, 
                              LINE_STIPPLE, POLYGON_STIPPLE,
                              or MATRIX - multmatrix
-batch -bt <num>              Batch <num> primitives together
                              per glBegin/glEnd Valid with 
			      POINT, VECTOR, TRIANGLE, and QUADS
-polymodefront -pmf           POINT, LINE, or FILL - default FILL
-polymodeback -pmb            POINT, LINE, or FILL - default FILL
-flat -f                      Set shademodel to FLAT - default GOURAUD
-zbuffer -zb                  Enable zbuffer for tests - default off
-clip -c                      Align object on 3D clip boundary
-lighttwoside -l2s            Light both sides of model
-localview -lv                Define local viewer for lit tests
-locallight -ll               Define all lights as local for lit tests
-minperiod -mp <num>          Set minimum testing period in seconds

Here is an example of the command line from test #3 of the CDRS viewset:

viewperf -mh mower-ts.msh -dl -rm TMESH -vz -blend -zb -nl 1 -cp PRIMITIVE -mp 10 -nf 10

This command line is providing the following directions:

The following significant defaults are in effect during this test: direct rendering, perspective viewing, no texture mapping, window size is 700 x 700 pixels, no culling, double buffering, smooth shading, no clipping, and single-sided lighting.

Upon entering the command line, the system under test will run the benchmark for at least 10 seconds or 10 frames. This is to insure a valid test result. During the test, the Viewperf code renders the data set, mower-ts.msh, which is half of the shell of a lawnmower, rotating it about the center of the window with the above specified characteristics.

What follows is the output of Viewperf when this test, CDRS Test #3, is run on an IBM RISC System/6000 Model 3AT with the GXT1000 Model 002 graphics option.

Test 3: Weight 15%> Viewperf Command: /viewperf -mh mower-ts.msh -dl -rm TMESH -vz -blend -zb -nl 1 -cp PRIMITIVE -mp 10 -nf 10 Viewperf Version 3.0 Viewperf Arguments -mh mower-ts.msh -dl -rm TMESH -vz -blend -zb -nl 1 -cp PRIMITIVE -mp 10 -nf 10 Month 3 Day 16 Year 1995 Host shiprock Operating System AIX Operating System Version 4.1 Host Vendor IBM Host Model RISC System/6000 Model 3AT Host CPU POWER2 Host CPU Count 1 Host Memory Size (MB) 0 Host Primary Cache Size (KB) 64/32 (D/I) Host Secondary Cache Size (KB) 0 Window System X Window System V11 Driver Version NA OpenGL Vendor IBM OpenGL Version 1.0.12 OpenGL Extensions OpenGL Renderer GXT 1000 OpenGL Client Vendor IBM OpenGL Client Version 1.0 OpenGL Client Extensions None GLU Version 1.0 GLU Extensions None Direct Rendering False Double Buffer True Stereo False RGBA True Color Index Size -1 Red Size 8 Green Size 8 Blue Size 8 Alpha Size 0 Accum Red Size 0 Accum Green Size 0 Accum Blue Size 0 Accum Alpha Size 0 Depth Size 24 Stencil Size 2 Auxiliary Buffer Count 0 Frame BufferLevel 0 Visual ID 0X2A Visual Class TrueColor Window Width (pixels) 700 Window Height (pixels) 700 Screen Width (pixels) 1280 Screen Height (pixels) 1024 Display :0.0 OpenGL Server Vendor IBM OpenGL Server Version 1.0 OpenGL Server Extensions unknown GLX Server Version 1.0 GLX Server Extensions unknown Screen Number 0 Shared Memory Connection True Visual Selection Criteria MINIMUM Number of Execution Threads 1 Geometry File ./mower-ts.msh Input Mode MESH Minimum Test Period 10.000000 Number of Primitives 71 Number of Vertices per Frame 31380 Number of Vertices per Primitive 441.971831 Toggle Mode NONE Batching Count 0 Render Mode TMESH Color per COLOR_PER_PRIMITIVE

Orthographic Projection FALSE Display List TRUE Clip Geometry FALSE Back Face Cull FALSE Front Face Cull FALSE Front Polygon Mode FILL Back Polygon Mode FILL Polygon Stipple Enable FALSE Polygon Antialiasing Enable FALSE Line Width 1.000000 Line Stipple Enable FALSE Line Antialiasing Enable FALSE Number of Lights 1 Facet Normals FALSE Two Sided Lighting Enable FALSE Local Viewer Enable FALSE Local Light Enable FALSE Flat Shading FALSE Fog Enable FALSE Texture Enable FALSE Texture Generation Enable FALSE Texture File NONE Texture Minification Filter NEAREST Texture Magnification Filter NEAREST Texture Environment Mode DECAL Texture Components 3 Depth Test Enable TRUE Blend Enable TRUE Source Blend Function SRC_ALPHA Destination Blend Function ONE_MINUS_SRC_ALPHA Dithering Enable TRUE 0.300 sec (DL Build) -mh mower-ts.msh -rm TMESH -cp PRIMITIVE -dl -zb -nl 1 -bl -vz Number of Frames 165 Test Period 11.540000 14.3 frames/sec -mh mower-ts.msh -rm TMESH -cp PRIMITIVE -dl -zb -nl 1 -bl -vz

The output provides all the Viewperf state information, as well as the configuration parameters for the system under test. The display list build time was 0.30 seconds, the number of frames was bumped up to 165 frames, and the test time was 11.54 seconds (greater than the minimum of 10 seconds).

Viewperf does a test to see how many frames need to be rendered to meet the minimum time period. In this case, the calibration calculates the number of frames necessary to meet the minimum, bumps up the number of frames if the minimum is not met, then reruns the test.

The last line is the number of frames per second, which is the fundamental metric for each test. This is the result that is printed in the summary and individual report pages within the GPC News OPC section. Also printed in the summary and individual report pages is a single composite number for each viewset. This composite number is derived using a weighted geometric mean methodology.

Rob Putney is an advisory programmer in IBM's RISC System/6000 Division in Austin, Texas. He can be reached by phone at 512-838-3639 or by e-mail to: rputney@vnet.ibm.com.

[GPC Home] [OPC Project] [PLB Project] [XPC Project]