|
From: James W. W. <os...@jw...> - 2007-10-09 16:18:51
|
On Oct 9, 2007, at 7:59 AM, Sauro Agostini wrote: >> >> * The original farmhouse ran at about 6 FPS. >> * With extra references removed (the RemoveExtraReferences function), >> the speed was about 60 FPS. >> >> * With some more algorithms, I got the speed up to about 370 FPS. >> The sequence of algorithms I used was: >> >> RemoveExtraReferences >> DecomposeGeometries >> LowerAttributesToGeometries >> FlattenHierarchy >> OptimizeTriMeshes >> MergeTriMeshes > > > Thanks a lot for your algorithms. > > There was a bug in the export 3DMF function of my application, so > there were more submitting of the same models. > > I tried to add all the other optimization functions, but I didn't > get your results. > > > I added the following code to the Geom test example, after > importing a model: > > RemoveExtraReferences(notOptimizedModel); > DecomposeGeometries( notOptimizedModel,theView ); > LowerAttributesToGeometries( notOptimizedModel); > theModel=(TQ3GroupObject) FlattenHierarchy > (notOptimizedModel,0 ); > OptimizeTriMeshes(theModel); > MergeTriMeshes( theModel); > > > Working on the same 3dmf file that I sent you I have the following > results (on an iMac Intel 2 core Duo) > > Without optimization 18 FPS > With extra references removed 155 FPS > With all the algorithms 178 FPS > > Maybe didn't I apply the algorithms correctly? DecomposeGeometries, like Q3Geometry_GetDecomposed, must be called in a submitting loop. When I tried it, I did it like this: Q3View_StartBoundingBox( theView, kQ3ComputeBoundsApproximate ); Qut_SubmitDefaultState(theView); DecomposeGeometries( gSceneGeometry, theView ); Q3View_EndBoundingBox( theView, &dummyBounds ); |