Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1782 - in trunk: StandAlone scenes
- Date: Wed, 17 Oct 2007 13:43:38 -0600 (MDT)
Author: bigler
Date: Wed Oct 17 13:43:38 2007
New Revision: 1782
Modified:
trunk/StandAlone/CMakeLists.txt
trunk/StandAlone/manta.cc
trunk/scenes/teapotRoom.cc
Log:
StandAlone/CMakeLists.txt
Use the new -nodisplaybench-dart command line argument.
StandAlone/manta.cc
Added an enum for the output format of the BenchHelper. Removed
verbose flag and replaced with output_format enum.
Changed BenchHelper's class member variables to correlate to the
coding standard.
Added output that is suitable for Dart server consumption.
scenes/teapotRoom.cc
Comment out unused material. Quiets warning.
Modified: trunk/StandAlone/CMakeLists.txt
==============================================================================
--- trunk/StandAlone/CMakeLists.txt (original)
+++ trunk/StandAlone/CMakeLists.txt Wed Oct 17 13:43:38 2007
@@ -8,7 +8,7 @@
-lm)
IF(BUILD_TESTING)
- ADD_TEST(DefaultSceneNoDisplayBench ${CMAKE_BINARY_DIR}/bin/manta
"-nodisplaybench")
+ ADD_TEST(DefaultSceneNoDisplayBench ${CMAKE_BINARY_DIR}/bin/manta
"-nodisplaybench-dart")
ENDIF(BUILD_TESTING)
Modified: trunk/StandAlone/manta.cc
==============================================================================
--- trunk/StandAlone/manta.cc (original)
+++ trunk/StandAlone/manta.cc Wed Oct 17 13:43:38 2007
@@ -148,37 +148,50 @@
class BenchHelper {
public:
- BenchHelper(MantaInterface* rtrt, long numFrames, bool verbose);
+ BenchHelper(MantaInterface* rtrt, long num_frames, int output_format);
void start(int, int);
void stop(int, int);
+ enum {
+ fps_only,
+ dart_format,
+ default_format // leave me last
+ };
private:
MantaInterface* rtrt;
- double startTime;
- long numFrames;
- bool verbose;
+ double start_time;
+ long num_frames;
+ int output_format;
};
-BenchHelper::BenchHelper(MantaInterface* rtrt, long numFrames, bool verbose)
- : rtrt(rtrt), numFrames(numFrames), verbose(verbose)
+BenchHelper::BenchHelper(MantaInterface* rtrt, long num_frames, int
output_format)
+ : rtrt(rtrt), num_frames(num_frames), output_format(output_format)
{
}
void BenchHelper::start(int, int)
{
- startTime = Time::currentSeconds();
+ start_time = Time::currentSeconds();
}
void BenchHelper::stop(int, int)
{
- double dt = Time::currentSeconds()-startTime;
- double fps = numFrames/dt;
- if(verbose)
+ double dt = Time::currentSeconds()-start_time;
+ double fps = num_frames/dt;
+ switch(output_format) {
+ case fps_only:
+ std::cout << fps << std::endl;
+ break;
+ case dart_format:
+ std::cout << "<DartMeasurement name=\"frames_per_second\"
type=\"numeric/double\">"<<fps<<"</DartMeasurement>\n";
+ std::cout << "<DartMeasurement name=\"total_time\"
type=\"numeric/double\">"<<dt<<"</DartMeasurement>\n";
+ break;
+ case default_format:
+ default:
cout << "Benchmark completed in " << dt
- << " seconds (" << numFrames << " frames, "
+ << " seconds (" << num_frames << " frames, "
<< fps << " frames per second)" << std::endl;
- else
- std::cout << fps << std::endl;
+ }
rtrt->finish();
delete this;
}
@@ -250,19 +263,22 @@
} else if(arg == "-bench" ||
arg == "-quietbench" ||
- arg == "-nodisplaybench") {
+ arg == "-nodisplaybench" ||
+ arg == "-nodisplaybench-dart") {
///////////////////////////////////////////////////////////////////////
// Benchmark Helper.
- bool verbose = true;
+ int output_format = BenchHelper::default_format;
if(arg == "-quietbench")
- verbose = false;
+ output_format = BenchHelper::fps_only;
+ if(arg == "-nodisplaybench-dart")
+ output_format = BenchHelper::dart_format;
long numFrames = 100;
long warmup = 10;
if(getLongArg(i, args, numFrames)){
getLongArg(i, args, warmup);
}
- BenchHelper* b = new BenchHelper(rtrt, numFrames, verbose);
+ BenchHelper* b = new BenchHelper(rtrt, numFrames, output_format);
// Ask for two callbacks, one at frame "warmup", and one at
// frame warmup+numFrames
rtrt->addOneShotCallback(MantaInterface::Absolute, warmup,
@@ -270,7 +286,7 @@
rtrt->addOneShotCallback(MantaInterface::Absolute,
warmup+numFrames,
Callback::create(b, &BenchHelper::stop));
- if (arg == "-nodisplaybench") {
+ if (arg.find("-nodisplaybench") == 0) {
// setup the ui and imagedisplay to both be null
ImageDisplay *display = factory->createImageDisplay( "null" );
rtrt->createChannel(display, currentCamera, stereo, xres, yres);
Modified: trunk/scenes/teapotRoom.cc
==============================================================================
--- trunk/scenes/teapotRoom.cc (original)
+++ trunk/scenes/teapotRoom.cc Wed Oct 17 13:43:38 2007
@@ -191,9 +191,9 @@
2.0, // lacunarity (_s?)
0.5 // gain (_a?)
);
- MarbleTexture<Color>* mtex3=new MarbleTexture<Color>
- (Color(RGB(0.1,0.2,0.5)), Color(RGB(0.7,0.8,1.0)),
- 10.0, 1.0, 15.0, 6, 2.0, 0.6 );
+// MarbleTexture<Color>* mtex3=new MarbleTexture<Color>
+// (Color(RGB(0.1,0.2,0.5)), Color(RGB(0.7,0.8,1.0)),
+// 10.0, 1.0, 15.0, 6, 2.0, 0.6 );
Material* marble1=new Phong(
mtex1,
- [Manta] r1782 - in trunk: StandAlone scenes, bigler, 10/17/2007
Archive powered by MHonArc 2.6.16.