1 # Simple OpenSG Benchmark
3 from sys
import argv
, exit
, stdout
5 from string
import atof
, atoi
12 # command line handling
14 opts
, args
= getopt
.getopt(argv
[1:], "u:f:h", ["up=", "frames=", "help"])
15 except getopt
.GetoptError
:
19 if opt
in ("-h", "--help"):
20 print "Usage: test_occ up=0,1,0 frames=100 <model file>"
24 print "Up set to ", ups
27 print "Frames set to ", frames
34 print "Loading %s..." % i
,
36 scene
.addChild(loadScene(i
))
40 # Define the Window's parameters
49 test
.setNFrames(frames
)
54 test
.makeOrbit(atof(up
[0]),atof(up
[1]),atof(up
[2]))
55 #test.setIgnoreGeometry(True)
56 test
.useRenderTraversal(True)
61 print "Path took %f seconds: %f fps" % (test
.getTime(), test
.getFPS())
66 for i
in range(0,test
.getNRenderedFrames()):
67 culltested
+= test
.getStatValue("OC-Tests", i
)
68 culled
+= test
.getStatValue("OC-Invisible", i
)
70 print "%d nodes oc-tested, %d nodes invisible.\n" % (culltested
, culled
)