Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r459 - in branches/itanium2: . Core/Color Engine Engine/Control Interface Model/Groups Model/Materials Model/Textures fox scenes
- Date: Fri, 29 Jul 2005 19:36:03 -0600 (MDT)
Author: abe
Date: Fri Jul 29 19:35:54 2005
New Revision: 459
Modified:
branches/itanium2/Core/Color/ColorSpace.h
branches/itanium2/Engine/CMakeLists.txt
branches/itanium2/Engine/Control/RTRT.cc
branches/itanium2/Interface/CMakeLists.txt
branches/itanium2/Model/Groups/VolumeGrid.h
branches/itanium2/Model/Groups/kdtree.cc
branches/itanium2/Model/Materials/CopyColorMaterial.cc
branches/itanium2/Model/Materials/CopyColorMaterial.h
branches/itanium2/Model/Materials/Dielectric.h
branches/itanium2/Model/Textures/Constant.h
branches/itanium2/fox/CMakeLists.txt
branches/itanium2/fox/FMantaWidgets.h
branches/itanium2/fox/FMantaWindow.h
branches/itanium2/fox/dm_demo.cc
branches/itanium2/manta-commands.txt
branches/itanium2/scenes/boeing777.cc
branches/itanium2/scenes/objviewer.cc
branches/itanium2/scenes/volume.cc
Log:
Fix for volume demos.
M Model/Materials/CopyColorMaterial.cc
M Model/Materials/CopyColorMaterial.h
Incremental changes for the demos.
M scenes/objviewer.cc
M scenes/volume.cc
M scenes/boeing777.cc
M Core/Color/ColorSpace.h
M fox/FMantaWidgets.h
M fox/FMantaWindow.h
M fox/dm_demo.cc
M fox/CMakeLists.txt
M Model/Groups/kdtree.cc
M Model/Groups/VolumeGrid.h
M Model/Materials/Dielectric.h
M Model/Textures/Constant.h
M Interface/CMakeLists.txt
M Engine/Control/RTRT.cc
M Engine/CMakeLists.txt
M manta-commands.txt
Modified: branches/itanium2/Core/Color/ColorSpace.h
==============================================================================
--- branches/itanium2/Core/Color/ColorSpace.h (original)
+++ branches/itanium2/Core/Color/ColorSpace.h Fri Jul 29 19:35:54 2005
@@ -13,9 +13,7 @@
typedef typename Traits::ComponentType ComponentType;
enum { NumComponents = Traits::NumComponents};
- ColorSpace()
- {
- }
+ ColorSpace() { }
ColorSpace(const ColorSpace<Traits>& copy)
{
Modified: branches/itanium2/Engine/CMakeLists.txt
==============================================================================
--- branches/itanium2/Engine/CMakeLists.txt (original)
+++ branches/itanium2/Engine/CMakeLists.txt Fri Jul 29 19:35:54 2005
@@ -7,6 +7,7 @@
INCLUDE (PixelSamplers/CMakeLists.txt)
INCLUDE (Renderers/CMakeLists.txt)
INCLUDE (Shadows/CMakeLists.txt)
+INCLUDE (Animators/CMakeLists.txt)
ADD_LIBRARY (Manta_Engine
${Manta_Control_SRCS}
@@ -17,6 +18,7 @@
${Manta_PixelSamplers_SRCS}
${Manta_Renderers_SRCS}
${Manta_Shadows_SRCS}
+ ${Manta_Animators_SRCS}
)
Modified: branches/itanium2/Engine/Control/RTRT.cc
==============================================================================
--- branches/itanium2/Engine/Control/RTRT.cc (original)
+++ branches/itanium2/Engine/Control/RTRT.cc Fri Jul 29 19:35:54 2005
@@ -117,17 +117,20 @@
return workersWanted;
}
-void RTRT::addOneShotCallback(Whence /*whence*/, long frame,
+void RTRT::addOneShotCallback(Whence whence, long frame,
CallbackBase_2Data<int, int>*
callback)
{
#if NOTFINISHED
// What about adding callbacks during anim cycle?
#endif
callbackLock.writeLock();
-#if NOTFINISHED
- if(whence == RTRTInterface::Relative)
- frame += current Fame;
-#endif
+// #if NOTFINISHED
+
+ if(whence == RTRTInterface::Relative) {
+ frame += animFrameState.frameNumber;
+ }
+// #endif
+
oneShots.insert(OneShotMapType::value_type(frame, callback));
callbackLock.writeUnlock();
}
Modified: branches/itanium2/Interface/CMakeLists.txt
==============================================================================
--- branches/itanium2/Interface/CMakeLists.txt (original)
+++ branches/itanium2/Interface/CMakeLists.txt Fri Jul 29 19:35:54 2005
@@ -34,6 +34,7 @@
RayPacket.h
Renderer.h
Renderer.cc
+ RenderParameters.h
RTRTInterface.h
RTRTInterface.cc
SetupCallback.h
Modified: branches/itanium2/Model/Groups/VolumeGrid.h
==============================================================================
--- branches/itanium2/Model/Groups/VolumeGrid.h (original)
+++ branches/itanium2/Model/Groups/VolumeGrid.h Fri Jul 29 19:35:54 2005
@@ -58,7 +58,7 @@
co[3] = co0[3]*(1-a) + co1[3]*a;
}
- int load(char *fn) {
+ int load(const char *fn) {
FILE *f = fopen(fn, "rt");
if (! f) {
fprintf(stderr, "Cannot open: %s\n",
fn);
Modified: branches/itanium2/Model/Groups/kdtree.cc
==============================================================================
--- branches/itanium2/Model/Groups/kdtree.cc (original)
+++ branches/itanium2/Model/Groups/kdtree.cc Fri Jul 29 19:35:54 2005
@@ -41,6 +41,7 @@
#include <SCIRun/Core/Thread/Time.h>
#include <SCIRun/Core/Thread/Thread.h>
#include <SCIRun/Core/Thread/Runnable.h>
+#include <SCIRun/Core/Thread/Barrier.h>
using namespace Manta;
using namespace Manta::Kdtree;
@@ -73,6 +74,8 @@
class V3C1Worker : public Runnable {
public:
BBox &bounds; // Thread specific bounding box.
+ Barrier &v3c1_barrier;
+ int np;
// Target data.
float *rawData;
@@ -85,10 +88,12 @@
/////////////////////////////////////////////////////////////////////////////
// Constructor.
- V3C1Worker( float *rawData_, VArray<Triangle> **tris_, Vectorf
**perVertNormals_,
+ V3C1Worker( Barrier &v3c1_barrier_, int np_, float *rawData_,
VArray<Triangle> **tris_, Vectorf **perVertNormals_,
long begin_offset_, long end_offset_, BBox &bounds_ ) :
Runnable( true ),
bounds( bounds_ ),
+ v3c1_barrier( v3c1_barrier_ ),
+ np( np_ ),
rawData( rawData_ ), tris( tris_ ), perVertNormals(
perVertNormals_ ),
begin_offset( begin_offset_ ), end_offset( end_offset_ ) { }
@@ -96,6 +101,19 @@
// This is the thread method.
virtual void run() {
+ // Touch all of the buffers assigned to this thread.
+ for (int i=begin_offset;i<end_offset;++i) {
+
+ (**tris)[i][0] = Pointf( 0.0, 0.0, 0.0 );
+ (*perVertNormals)[3*i] = Vector( 0.0, 0.0, 0.0 );
+ }
+
+ // Wait for other threads to initialize.
+ v3c1_barrier.wait(np+1);
+
+ // Wait for the io thread to read in the data.
+ v3c1_barrier.wait(np+1);
+
for (long i=begin_offset; i<end_offset; i++) {
// Offset into the data.
@@ -291,56 +309,42 @@
return 0;
}
+ // Determine the input file size.
fseek(f, 0, SEEK_END);
long fileSize = ftell(f);
+ fseek(f, 0, SEEK_SET);
- // One normal followed by 3 vertices
+
/////////////////////////////////////////////////////////////////////////////
+ // Determine the amount of memory needed.
long nTris = fileSize / (12*sizeof(float));
int nFloats = fileSize/4;
- float *rawData = new float [fileSize / 4];
-
- fseek(f, 0, SEEK_SET);
-
- double time_begin = Time::currentSeconds();
-
- // Read in the data.
- long trisRead = fread(rawData, 48, fileSize/48, f);
- if (trisRead != nTris) {
- fprintf(stderr, "Error reading file: %s Tris read: %ld;
expected: %ld\n", filename, trisRead, nTris);
- }
-
- double time_end = Time::currentSeconds();
-
- std::cout << "Time to input triangles: " << (time_end-time_begin)
<< " seconds. " << std::endl
- << "Total file size: " <<
((double)fileSize/1048576.0) << " MB. " << std::endl
- << "IO Performance: " <<
((double)fileSize/1048576.0)/(time_end-time_begin) << " MB/second." <<
std::endl;
- // Allocate a new array for the triangles.
- time_begin = Time::currentSeconds();
+ // Allocate input buffer.
+ float *rawData = new float [fileSize / 4];
+ // Allocate triangles.
*tris = new VArray<Triangle> (nTris);
(*tris)->setLen(nTris);
- *perVertNormals = new Vectorf [nTris*3];
- // Record the time for alloc/dealloc
- double memory_time = (Time::currentSeconds() - time_begin);
+ // Allocate normals.
+ *perVertNormals = new Vectorf [nTris*3];
- // Record the time for the actual preprocess.
- time_begin = Time::currentSeconds();
+
/////////////////////////////////////////////////////////////////////////////
+ // Start up the worker threads and touch the memory to distribute it.
- std::cout << "Creating " << np << " workers." << std::endl;
+ std::cerr << "Creating " << np << " workers." << std::endl;
// Create worker threads to preprocess and bound the data.
Thread **workers = new Thread *[ np ];
-
CacheAlignedBBox *worker_box = new CacheAlignedBBox[ np ];
+ Barrier v3c1_barrier( "v3c1_barrier" );
int work_per_thread = nTris / np;
long begin = 0;
long end = work_per_thread;
- std::cout << "Faces per worker: " << work_per_thread << std::endl;
+ std::cerr << "Faces per worker: " << work_per_thread << std::endl;
char worker_name[32];
@@ -348,22 +352,53 @@
for (int i=0;i<np-1;++i) {
sprintf( worker_name, "V3C1 Worker %d", i );
-
- workers[i] = new Thread( new V3C1Worker( rawData, tris,
perVertNormals, begin, end, worker_box[i].box ), worker_name );
+ workers[i] = new Thread( new V3C1Worker( v3c1_barrier, np,
rawData, tris, perVertNormals, begin, end, worker_box[i].box ), worker_name
);
+
begin = end;
end += work_per_thread;
}
+ // Assign the rest of the work to the last worker.
sprintf( worker_name, "V3C1 Worker %d", np-1 );
+ workers[np-1] = new Thread( new V3C1Worker( v3c1_barrier, np,
rawData, tris, perVertNormals, begin, nTris, worker_box[np-1].box ), "V3C1
Worker" );
- // Assign the rest of the work to the last worker.
- workers[np-1] = new Thread( new V3C1Worker( rawData, tris,
perVertNormals, begin, nTris, worker_box[np-1].box ), "V3C1 Worker" );
+ // Wait for all of workers to initialize.
+ std::cerr << "Waiting for workers to initalize." << std::endl;
+ v3c1_barrier.wait( np+1 );
+
+
/////////////////////////////////////////////////////////////////////////////
+ // Read in the data.
+ double time_begin = Time::currentSeconds();
+
+ long trisRead = fread(rawData, 48, fileSize/48, f);
+ if (trisRead != nTris) {
+ fprintf(stderr, "Error reading file: %s Tris read: %ld;
expected: %ld\n", filename, trisRead, nTris);
+ }
+
+ double time_end = Time::currentSeconds();
+
+ std::cerr << "Time to input triangles: " << (time_end-time_begin)
<< " seconds. " << std::endl
+ << "Total file size: " <<
((double)fileSize/1048576.0) << " MB. " << std::endl
+ << "IO Performance: " <<
((double)fileSize/1048576.0)/(time_end-time_begin) << " MB/second." <<
std::endl;
+
+ // Allocate a new array for the triangles.
+ time_begin = Time::currentSeconds();
+
+ // Record the time for alloc/dealloc
+ double memory_time = (Time::currentSeconds() - time_begin);
+
+
/////////////////////////////////////////////////////////////////////////////
+ // Record the time for the actual preprocess.
+ time_begin = Time::currentSeconds();
+
+ std::cerr << "Beginning preprocess" << std::endl;
+ v3c1_barrier.wait( np+1 );
// Wait for all of the threads to finish.
for (int i=0;i<np;++i) {
workers[i]->join();
- std::cout << "Worker " << i << " finished." << std::endl;
+ std::cerr << "Worker " << i << " finished." << std::endl;
// Enlarge the bounding box.
bounds.extendByBox( worker_box[i].box );
@@ -375,8 +410,8 @@
time_end = Time::currentSeconds();
- std::cout << "Time to parse triangles: " << (time_end - time_begin)
<< " Seconds." << std::endl;
- std::cout << "Triangles loaded: " << nTris << std::endl;
+ std::cerr << "Time to parse triangles: " << (time_end - time_begin)
<< " Seconds." << std::endl;
+ std::cerr << "Triangles loaded: " << nTris << std::endl;
time_begin = Time::currentSeconds();
@@ -384,7 +419,7 @@
memory_time += (Time::currentSeconds() - time_begin);
- std::cout << "Total time for memory allocation/deallocation: " <<
memory_time << " Seconds." << std::endl;
+ std::cerr << "Total time for memory allocation/deallocation: " <<
memory_time << " Seconds." << std::endl;
return 1;
}
@@ -504,7 +539,7 @@
double time_end = Time::currentSeconds();
- std::cout << "Total time for loading triangles: " << (time_end -
time_begin) << std::endl << std::endl;
+ std::cerr << "Total time for loading triangles: " << (time_end -
time_begin) << std::endl << std::endl;
/////////////////////////////////////////////////////////////////////////////
// Load the kd tree.
@@ -533,7 +568,7 @@
time_end = Time::currentSeconds();
- std::cout << "Time to read kdtree: " << (time_end-time_begin) << "
seconds." << std::endl;
+ std::cerr << "Time to read kdtree: " << (time_end-time_begin) << "
seconds." << std::endl;
// Specify the root node loaded from the file.
rootNode = (KDTreeNode*)buffer;
@@ -543,7 +578,7 @@
if (is_big_endian()) {
- std::cout << "NOTE: This system is big endian and the boeing
kdtree files are little, swapping bytes." << std::endl;
+ std::cerr << "NOTE: This system is big endian and the boeing
kdtree files are little, swapping bytes." << std::endl;
rootNode->endian_swap();
@@ -559,7 +594,7 @@
bbox = BBox( bboxf.min, bboxf.max );
// Output bounding box size.
- std::cout << "Model bounds: min: " << bbox[0] << " max: " << bbox[1]
<< std::endl;
+ std::cerr << "Model bounds: min: " << bbox[0] << " max: " << bbox[1]
<< std::endl;
/////////////////////////////////////////////////////////////////////////////
// Load the index file
@@ -590,7 +625,7 @@
time_end = Time::currentSeconds();
- std::cout << "Total time to read in indices: " <<
(time_end-time_begin) << std::endl;
+ std::cerr << "Total time to read in indices: " <<
(time_end-time_begin) << std::endl;
triIndices = indices;
Modified: branches/itanium2/Model/Materials/CopyColorMaterial.cc
==============================================================================
--- branches/itanium2/Model/Materials/CopyColorMaterial.cc (original)
+++ branches/itanium2/Model/Materials/CopyColorMaterial.cc Fri Jul 29
19:35:54 2005
@@ -14,7 +14,7 @@
using namespace Manta;
-void CopyColorMaterial::shade(const RenderContext& context, RayPacket& rays)
const {
+void KDTreeCopyColorMaterial::shade(const RenderContext& context, RayPacket&
rays) const {
for (int i=0;i<rays.getSize();i++) {
RayPacket::Element& e = rays.get(i);
@@ -23,3 +23,23 @@
rays.setResult( i, result );
}
}
+
+void CopyColorMaterial::shade(const RenderContext& context, RayPacket& rays)
const {
+
+ for (int i=0;i<rays.getSize();i++) {
+ RayPacket::Element& e = rays.get(i);
+
+ unsigned int payload = e.hitInfo.scratchpad<unsigned int>();
+ unsigned char *c = (unsigned char *)&payload;
+
+ Color result( RGB((float)c[0]*0.0039f,
+
(float)c[1]*0.0039f,
+
(float)c[2]*0.0039f ));
+
+ rays.setResult( i, result );
+ }
+}
+
+
+
+
Modified: branches/itanium2/Model/Materials/CopyColorMaterial.h
==============================================================================
--- branches/itanium2/Model/Materials/CopyColorMaterial.h (original)
+++ branches/itanium2/Model/Materials/CopyColorMaterial.h Fri Jul 29
19:35:54 2005
@@ -9,7 +9,15 @@
// This material is used with the KDTree's to copy a color out of the
// hit record which was computed during intersection.
- class CopyColorMaterial : public Material {
+ class KDTreeCopyColorMaterial : public Material {
+ public:
+ KDTreeCopyColorMaterial() { }
+ virtual ~KDTreeCopyColorMaterial() { }
+ virtual void preprocess(const PreprocessContext&) { }
+ virtual void shade(const RenderContext& context, RayPacket& rays) const;
+ };
+
+ class CopyColorMaterial : public Material {
public:
CopyColorMaterial() { }
virtual ~CopyColorMaterial() { }
Modified: branches/itanium2/Model/Materials/Dielectric.h
==============================================================================
--- branches/itanium2/Model/Materials/Dielectric.h (original)
+++ branches/itanium2/Model/Materials/Dielectric.h Fri Jul 29 19:35:54
2005
@@ -49,6 +49,7 @@
~Dielectric();
void shade(const RenderContext& context, RayPacket& rays) const;
+
private:
const Texture<double>* n;
const Texture<double>* nt;
Modified: branches/itanium2/Model/Textures/Constant.h
==============================================================================
--- branches/itanium2/Model/Textures/Constant.h (original)
+++ branches/itanium2/Model/Textures/Constant.h Fri Jul 29 19:35:54 2005
@@ -16,9 +16,9 @@
virtual void mapValues(const RenderContext& context, RayPacket& rays,
ValueType results[]) const;
- ValueType getValue() const {
- return value;
- }
+ ValueType getValue() const { return value; }
+ void setValue( const ValueType value_ ) { value = value_; }
+
private:
Constant(const Constant&);
Constant& operator=(const Constant&);
Modified: branches/itanium2/fox/CMakeLists.txt
==============================================================================
--- branches/itanium2/fox/CMakeLists.txt (original)
+++ branches/itanium2/fox/CMakeLists.txt Fri Jul 29 19:35:54 2005
@@ -28,7 +28,11 @@
FMantaUniformNav.h
FMantaUniformNav.cc
FMantaTrackballNav.h
- FMantaTrackballNav.cc )
+ FMantaTrackballNav.cc
+ FMantaTextureChooser.h
+ FMantaTextureChooser.cc
+ FMantaMaterialChooser.h
+ FMantaMaterialChooser.cc)
TARGET_LINK_LIBRARIES(dm_demo Manta_Engine
Modified: branches/itanium2/fox/FMantaWidgets.h
==============================================================================
--- branches/itanium2/fox/FMantaWidgets.h (original)
+++ branches/itanium2/fox/FMantaWidgets.h Fri Jul 29 19:35:54 2005
@@ -79,11 +79,11 @@
/////////////////////////////////////////////////////////////////////////////
class FMantaRealSlider : public FXRealSlider {
FXDECLARE(FMantaRealSlider)
-private:
+ private:
// Setter which binds the spinner to a specific
instance/method.
FMantaSetter<Real> *setter;
-public:
+ public:
enum {
ID_SLIDER_CHANGED = FXRealSlider::ID_LAST,
ID_LAST
Modified: branches/itanium2/fox/FMantaWindow.h
==============================================================================
--- branches/itanium2/fox/FMantaWindow.h (original)
+++ branches/itanium2/fox/FMantaWindow.h Fri Jul 29 19:35:54 2005
@@ -112,7 +112,7 @@
FMantaWindow() : manta_interface( 0 ), fast_quit( false ) {
};
FMantaWindow( FXApp *app, const FXString &name, int width =
512, int height = 512,
FXIcon *ic=NULL,FXIcon *mi=NULL,FXuint
opts=(DECOR_ALL),
- FXint
x=20,FXint y=20,FXint w=512,FXint h=512,FXint pl=0,FXint pr=0,FXint
pt=0,FXint pb=0,FXint hs=0,FXint vs=0);
+ FXint
x=50,FXint y=50,FXint w=512,FXint h=512,FXint pl=0,FXint pr=0,FXint
pt=0,FXint pb=0,FXint hs=0,FXint vs=0);
// Setup
void addCameraBookmark ( const string &description, const
string &camera_text );
Modified: branches/itanium2/fox/dm_demo.cc
==============================================================================
--- branches/itanium2/fox/dm_demo.cc (original)
+++ branches/itanium2/fox/dm_demo.cc Fri Jul 29 19:35:54 2005
@@ -1,3 +1,31 @@
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ Silicon Graphics Inc. Mountain View California.
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ */
+
#include <Interface/RTRTInterface.h>
#include <Core/Color/ColorDB.h>
#include <Core/Util/Args.h>
@@ -59,7 +87,7 @@
DmDemoDialog( FMantaWindow *manta_window_,
KDTree *kdtree_, TransparentKDTree *transparent_kdtree_,
const
FXString &name, FXuint opts=DECOR_ALL,
- FXint x=0,FXint y=0,FXint
w=0,FXint h=0,FXint pl=10,
+ FXint x=50,FXint
y=50,FXint w=0,FXint h=0,FXint pl=10,
FXint
pr=10,FXint pt=10,FXint pb=10,FXint hs=4,FXint vs=4 );
void setKdtrees( KDTree *kdtree_, TransparentKDTree
*transparent_kdtree_ ) {
@@ -305,7 +333,8 @@
std::cout << "Building transparent tree." << std::endl;
// Create a transparent kdtree.
- TransparentKDTree *transparent_kdtree = new
TransparentKDTree( kdtree, new CopyColorMaterial );
+ TransparentKDTree *transparent_kdtree =
+ new TransparentKDTree( kdtree, new
KDTreeCopyColorMaterial );
// Create a new extra options dialog.
manta_window.setExtraOptionsDialog(
Modified: branches/itanium2/manta-commands.txt
==============================================================================
--- branches/itanium2/manta-commands.txt (original)
+++ branches/itanium2/manta-commands.txt Fri Jul 29 19:35:54 2005
@@ -19,3 +19,5 @@
# Fox demo
bin/fox_manta -np 54 -scene "lib/libscene_boeing777.so( -file
/dev/shm/Boeing777.v3c1 -np 32 )"
bin/dm_demo -np 50 -scene "lib/libscene_boeing777.so( -file
/dev/shm/Boeing777.v3c1 -np 50 )" -bookmarks /dev/shm/Boeing777.v3c1.txt
+bin/manta -np 6 -scene "lib/libscene_objviewer.so( -file
/store/abe/models/defender-ext-corrected-mtl.obj -single )" -camera "pinhole(
-eye 0.436687 3.30568 5.27756 -lookat 0.426146 2.44154 5.17692 -up 0 0 1
-fov 60 )" -ui null -imagedisplay null -bench 10 10
+bin/manta -np 32 -scene "lib/libscene_boeing777.so( -file
/dev/shm/Boeing777.v3c1 -np 32 -cutting default )" -camera "pinhole( -eye
312.31 -315.671 199.735 -lookat 280.305 98.0706 184.652 -up 0.0256952
-0.337005 0.941152 -fov 60 )" -ui null -imagedisplay null -bench 20 20
Modified: branches/itanium2/scenes/boeing777.cc
==============================================================================
--- branches/itanium2/scenes/boeing777.cc (original)
+++ branches/itanium2/scenes/boeing777.cc Fri Jul 29 19:35:54 2005
@@ -1,4 +1,30 @@
-
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ Silicon Graphics Inc. Mountain View California.
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ */
// Manta Test Scene for Boeing 777 Dataset.
// Hansong Zhang and Abe Stephens
@@ -36,6 +62,7 @@
#include <Model/Materials/LambertianAlt.h>
#include <Model/Materials/CopyColorMaterial.h>
+#include <Model/Materials/AmbientOcclusion.h>
#include <Model/Textures/Constant.h>
#include <SCIRun/Core/Thread/Time.h>
@@ -102,11 +129,20 @@
// Create a kd tree.
// KDTree *kdtree = new KDTree( new Lambertian( new KDTreeTexture ) );
+
+// #if 0
KDTree *kdtree = new KDTree( new Phong( new KDTreeTexture,
new
Constant<Color>(Color::white()),
-
128,
+
512,
new Constant<double>(0.0) ) );
- //KDTree *kdtree = new KDTree( new LambertianAlt );
+// #endif
+#if 0
+ KDTree *kdtree = new KDTree( new AmbientOcclusion( new KDTreeTexture,
+ new Constant<float>(5.0),
+
32 ) );
+#endif
+
+ // KDTree *kdtree = new KDTree( new LambertianAlt );
double start_time = Time::currentSeconds();
@@ -114,7 +150,7 @@
double end_time = Time::currentSeconds();
- std::cout << "Total load time: " << (end_time-start_time)/60.0 << "
minutes."
+ std::cerr << "Total load time: " << (end_time-start_time)/60.0 << "
minutes."
<< std::endl << std::endl;
// Determine the bounds of the model.
@@ -124,7 +160,7 @@
// Determine if we should start with a transparent kdtree or not.
Primitive *kd_primitive = kdtree;
if (use_transparency) {
- kd_primitive = new TransparentKDTree( kdtree, new
CopyColorMaterial );
+ kd_primitive = new TransparentKDTree( kdtree, new
KDTreeCopyColorMaterial );
}
////////////////////////////////////////////////////////////////////////////
@@ -137,8 +173,8 @@
// Check to see if the model should be cut by a cutting plane.
if ((cutting_type == CUTTING_DEFAULT) || (cutting_type ==
CUTTING_SPECIFIED)) {
- std::cout << "Cutting plane point: " << plane_point <<
std::endl;
- std::cout << "Cutting plane normal: " << plane_normal <<
std::endl;
+ std::cerr << "Cutting plane point: " << plane_point <<
std::endl;
+ std::cerr << "Cutting plane normal: " << plane_normal <<
std::endl;
root_object = new CuttingPlane( plane_point, plane_normal,
kd_primitive );
}
Modified: branches/itanium2/scenes/objviewer.cc
==============================================================================
--- branches/itanium2/scenes/objviewer.cc (original)
+++ branches/itanium2/scenes/objviewer.cc Fri Jul 29 19:35:54 2005
@@ -147,7 +147,7 @@
// Note that the first material added by blender is
always an
// unused default material..
- material_array[i-1] = new Dielectric( 1.3, 1.0,
Color(RGB(0.8,0.8,0.8)));
+ material_array[i-1] = new Dielectric( 1.1, 1.0,
diffuse );
// material_array[i-1] = new Dielectric( diffuse,
Color(RGB(0.6,0.6,0.6)), Color(RGB(log(c0),log(c1),log(c2))), 28, 1.3, 1.0 );
}
else {
Modified: branches/itanium2/scenes/volume.cc
==============================================================================
--- branches/itanium2/scenes/volume.cc (original)
+++ branches/itanium2/scenes/volume.cc Fri Jul 29 19:35:54 2005
@@ -31,6 +31,8 @@
#include <Model/AmbientLights/ConstantAmbient.h>
#include <Model/MiscObjects/CuttingPlane.h>
+#include <Model/Materials/CopyColorMaterial.h>
+
#include <SCIRun/Core/Thread/Time.h>
using namespace Manta;
@@ -82,8 +84,7 @@
else {
cerr << "Valid options for volume:" << endl;
cerr << "-file <filename>" << endl;
- cerr << "-np <num build workers>" << endl;
- cerr << "-cutting [<point> <normal>]" << endl;
+ cerr << "-tf <num build workers>" << endl;
throw IllegalArgument( "volume", i, args );
}
}
@@ -93,49 +94,18 @@
Group *group = new Group();
VolumeGrid<unsigned char> *vg = new VolumeGrid<unsigned char>;
- vg->load(/*file_name.c_str()*/ "brain.dsc", 32, false, 0);
+ vg->load(file_name.c_str(), 32, false, 0);
group->add(vg);
TransferFunction *tf = new TransferFunction();
- tf->load("test8.tf");
+ tf->load( tf_name.c_str() );
+
VolumeRenderingParams *vrp = new VolumeRenderingParams(tf);
vg->setVolumeRenderingParams(vrp);
- /*
- // Compute the middle of the model for a cutting plane.
- if (cutting_type == CUTTING_DEFAULT) {
- plane_point = bounds.center();
- plane_normal = Vector( 0.0, -1.0, 0.0 );
- }
-
- // Check to see if the model should be cut by a cutting plane.
- if ((cutting_type == CUTTING_DEFAULT) || (cutting_type ==
CUTTING_SPECIFIED)) {
-
- std::cout << "Cutting plane point: " << plane_point <<
std::endl;
- std::cout << "Cutting plane normal: " << plane_normal <<
std::endl;
-
- group->add( new CuttingPlane( plane_point, plane_normal,
kdtree ) );
- }
- else {
- group->add( kdtree );
- }
- */
-
LightSet *lights = new LightSet();
- // lights->add( new PointLight( Point(5000,5000,5000),
Color(RGB(1.0,1.0,1.0)) ));
- //lights->add( new HeadLight( 2.0, Color(RGB(1.0,1.0,1.0)) ));
lights->add( new HeadLight( 2.0, Color(RGB(1.0,1.0,1.0)) ));
-
- //lights->add( new PointLight( bounds.center() + Vector
-
- // group->add( new Sphere( new LambertianAlt(), Point(0,0,-11), 0.5 )
);
- // group->add( new Sphere( new LambertianAlt(), Point(0,0,-5 ), 0.25
) );
-
- // Add a light.
- // LightSet* lights = new LightSet();
- // lights->add( new PointLight(light_position,
Color(RGBColor(0.9,0.9,0.9) )));
-
lights->setAmbientLight( new ConstantAmbient(
Color(RGBColor(0.2,0.2,0.2) ) ));
scene->setLights(lights);
- [MANTA] r459 - in branches/itanium2: . Core/Color Engine Engine/Control Interface Model/Groups Model/Materials Model/Textures fox scenes, abe, 07/29/2005
Archive powered by MHonArc 2.6.16.