SGI Techpubs Library

IRIX 6.5  »  Books  »  Developer  »  
OpenGL Optimizer Programmer's Guide: An Open API for Large-Model Visualization
(document number: 007-2852-002 / published: 1998-06-09)    table of contents  |  additional info  |  download
find in page

Chapter 16. Troubleshooting

This chapter presents some likely compile and run-time warnings with appropriate responses, and provides general approaches to improving your application's performance. The topics covered in this chapter are:

Compiler Warning Messages

  • Error Messages:

    ld: ERROR 33: Unresolved text symbol “cos” -- 1st referenced by repTest.o. 
    ld: ERROR 33: Unresolved text symbol “pow” -- 1st referenced by repTest.o.
    

    Solution: Enter the following command:

    link -lm binary
    

Run-Time Warning Messages

  • Problem: A warning about incompatible versions for libifl.so. This problem should only occur for IRIX 6.2 or earlier.

    Solutions: If you decide you don't want to install IRIX 6.3 or later, install the ifl.eoe subsystem. You have two alternatives:

    Evaluation  

    http://www.sgi.com/Products/Evaluation/...

    Order 

    Image Vision Library 3.2 Runtime CD.

Tuning the Scene Graph Database

If you have a bottleneck on the host, tuning the database will help. This section lists several approaches to tuning a large database. Details for most of the tools and techniques discussed here appear in Part I, “Getting Started,” and Part II, “High-Level Strategic Tools for Fast Rendering.”

These are the approaches discussed in this section:

Reduce the Polygon Count

Analysis:  

Use the application opviewer to read in the dataset. Note how many triangles are in the data set and whether the csGeoSets are in optimal rendering form—csTriStrips or csTriFans. See “Creating OpenGL Connected Primitives” for more information.

Possible solution: 


Use the application opoptimize to convert your scene graph. Go to sample application directory, enter ./opoptimize for options, such as simplifying, and write out the result with the -batch option.

Evaluation:  

Compare the frame speed of the original and resulting dataset by entering s while in opviewer.

Combine Small csGeoSets

Analysis: 

Print the scene hierarchy. Use the application opviewer to read in the dataset and either enter p, which is an opViewer command, or use opPrintScene().

If the csGeoSets have very few triangles, consider combining primitives into one csGeoSet. See the section on “Merging csGeoSets in a Scene Graph: opCombineGeoSets” for more information.

Possible solution:  


Comine normal tolerance. The normal tolerance argument specifies by how much normals of two vertices can differ before they are considred to be two different vertices.

Use the application opoptimize to convert your data. Use the -combine option, which by default traverses the entire scene graph and combines csGeoSets that have the same csAppearance ( color and material.) Look at /usr/include/Cosmo3D/csAppearance.h for the attributes. Write the data into tristrips or trifans by using the -batch option for opoptimize.

Note, however, that you may want to be selective when combining csGeoSets because you lose hierarchy and text information from the original scene graph when you combine. This may not be an option for you, unless you add code to retain information in the node with the combined csGeoSets.

Evaluation:  

Print out hierarchy again with new csGeoSet combinations to verify that csGeoSets are larger. Compare frame speed.

Spatialize to Facilitate View Frustum and Occlusion Culling

Analysis:  

If the database has large occluders or you tend to view the object close to the viewpoint so that many parts are outside the viewing frustum, then your database is a likely candidate for spatialization.

If you do not know if the scene graph is spatially organized, first print the scene hierarchy. A simple way to do this is to use the application opviewer to read in the dataset and either enter p, which is incorporated into opViewer, or use opPrintScene() in your own application.

If you see a very flat structure without many csGroup nodes sectioning off the csGeoSets, the database is probably not spatially organized. See Chapter 6, “Organizing the Scene Graph Spatially,” for more information.

Possible solution: 


Use the application opoptimize with the options -combine and either of the options -spatialize or -geospatialize. These options combine the csGeoSets into larger, similar csGeoSets, and then spatialize the results. With the -spatialize and -geospatialize options, you include hints for the minimum and maximum number of triangles in any leaf node of the new graph.

With the -spatialize option, opoptimize traverses the scene graph looking for nodes that have greater than the maximum number of triangles, and divides them into pieces with numbers of triangles between the minimum and the maximum.

With the -geospatialize option, opoptimize combines all the csGeoSets below a particular node, regardless of csAppearance, then spatializes the result such that the leaf nodes have numbers of triangles between the minimum and the maximum.

Evaluation:  

Print the hierarchy again with the new csGeoSet combinations to verify that csGeoSets have been spatialized. Compare the frame speed.

Use Level-of-Detail Nodes

Analysis:  

If you don't need to see the entire database in fine detail all the time, then use level-of-detail nodes (LODs). Chapter 4, “Rendering Appropriate Levels of Detail” has more information.

Possible solution: 


Simplify the scene graph by controlling the tessellation to produce fewer triangles, by using a simplifier to reduce the number of existing triangles, or by using a combination of the two.

For the tessellation approach, if your database has Inventor NURBS, try different chordal deviation tolerances to control the quality of the tessellation to see how well you can retain the shape, but with fewer triangles. View the object in wireframe to see how well it is tessellated, and look at the polygon count (printed by default). See Chapter 11, “Rendering Higher-Order Primitives: Tessellators,” for more information on controlling tessellation. After tessellating, consider combining, spatializing, then simplifying the scene graph.

For the simplification approach, consider combining and spatializing the scene graph before simplifying it. If you use the opoptimize application with the -geospatialize option, try 5000 and 8000 for the minimum and maximum parameters for this option; they usually give reasonable results. View the object in wireframe to see how well it is tessellated.

Add LODs to scene graph

After obtaining at least two versions of your scene with different levels of detail that you want to view, add LODs to your scene graph.

There are two possible approaches to adding LODs to the scene graph: use the application opoptimize, or create your own traversal. You can use the opoptimize application to generate an LOD node with the roots of the different versions of the scene graph as children. When you create your own traversal to traverse the original scene graph, you must create an LOD, and add the simplified version of the csGeoSet from the simplified scene graph.

You may also want to adjust the LOD selection process by introducing a bias when objects are moving, a feature of opViewer. See “Viewing Class: opViewer”. The application opviewer does this with a command-line argument. See Appendix C, “opviewer Sample Application.”

Evaluation:  

When you are not viewing the highest level of detail on an object, performance should improve to an extent that depends on how much you simplified the scene graph.

Tessellation Problems

Two typical tessellation problems are covered in this section:

No Triangles

Analysis:  

No triangles are generated when you read in Inventor *.iv files.

Solution:  

The tessellator generates triangles only for Inventor NURBS Surfaces. To see if the Inventor models have NURBS surfaces, enter this command: ivcat < filename.iv > /usr/tmp/junk. This gives you an ASCII version of the file. Then enter: grep Surface /usr/tmp/junk.

Evaluation:  

If you still do not see any triangles, you may also have unsupported Inventor primitives in your files.

Slow Processing

Analysis:  

Tessellation takes too long. Surfaces could be over tessellated.

Solution:  

Increase the chordal tolerance parameter for the tessellator.

To diagnose which particular surfaces may be causing problems, adjust the range of the identification numbers of the NURBS objects to be tessellated, or tessellate just one NURBS. The range is controlled by the environment variables OP_TESS_BRANGE and OP_TESS_ERANGE, whose values are inclusive. For tessellating NURBS 0 through 947, enter

setenv OP_TESS_BRANGE 0

setenv OP_TESS_ERANGE 947

Or, to tessellate just NURBS 555, enter

setenv OP_TESS_BRANGE 555

setenv OP_TESS_ERANGE 555

OpenGL Optimizer Programmer's Guide: An Open API for Large-Model Visualization
(document number: 007-2852-002 / published: 1998-06-09)    table of contents  |  additional info  |  download

    Front Matter
    About This Guide
    Part I. Getting Started
    Part II. High-Level Strategic Tools for Fast Rendering
    Part III. Specific Tools for Fast Rendering
    Part IV. Managing and Rendering Higher-Order Geometric Primitives
    Part V. Traversers, Low-Level Geometry Processing, and Multiprocessing
    Part VI. Utilities and Troubleshooting
    Part VII. Appendices
    Glossary
    Index


home/search | what's new | help