Commit 2a4edf49 authored by fogal1's avatar fogal1

Squashed commit of the following:

commit 8bd471a0f8af7e932d96d9988f7f118717e397f1
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Fri Jul 18 19:29:32 2008 -0400

    * Utilize AnnotationAttributes::BackgroundMode instead of an integer.

commit 7211351a5d4f3609583816cd03f7b25e691058dd
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Fri Jul 18 18:23:05 2008 -0400

    * Complete a FIXME I had somehow forgotten about..

commit c21d37cfd2384dd20a5fd187f0430446e184d944
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Fri Jul 18 17:49:21 2008 -0400

    * Move viewportedMode calculation to RenderSetup, where it should go logically.
    * Conditionally read back Z; since it comes in a crazy format, we need to
      convert the buffer, which can get pretty expensive.

commit f0ba8d1c04ae2f7718a198dafc36c7ff80d794ad
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Fri Jul 18 15:27:17 2008 -0400

    * Fix unused variable warning in Engine.

commit 30b1d67506411d6a91b2e534d1de94632e47e9c8
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Fri Jul 18 15:26:33 2008 -0400

    * Add predicate methods to determine shadowing, depth cueing.
    * Call new methods as appropriate.

commit ae6409937d78325388da66d7ee2962c8437e2c5b
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Thu Jul 17 14:52:58 2008 -0400

    * Use IceT code to make sure each node has an image.  Obviates the need for my
      hacky image-broadcasting(-ish) code.

commit a154a6ca26ee780203220bff6e67567cc02337c4
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Thu Jul 17 14:42:30 2008 -0400

    * Make a variable definition loop-local.

commit a1519b12c184f5fb647b8352852ddf720f835819
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Thu Jul 17 10:31:04 2008 -0400

    * lerp the depth buffer onto the range [0,1].
      This fixes the ray tracer.

commit 138fecb52f2b8e1422cc17cf1edb2518ea218727
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Wed Jul 16 13:26:50 2008 -0400

    * Generate a graph which shows scaling with cells.

commit ce64b943e69f3406273027ddb6507024729c8bcc
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Wed Jul 16 13:23:14 2008 -0400

    * NM's destructor should be virtual now that we have virtual fqns.
    * IceTNM's destructor should be virtual as well.

commit 0126f95921830b19fa367f010d91ed126e3a3d55
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Tue Jul 15 18:40:12 2008 -0400

    * Scripts to create gnuplot files which make postscripts showing render
      performance.

commit 8b9d39571025fa27b489c22d2041e68f621c77a1
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Tue Jul 15 11:22:57 2008 -0400

    * Note number of processors when timing engine startup.

commit e8598410ce6aa0ff3355c32ed6b3b78ee7ac0775
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Mon Jul 14 18:13:23 2008 -0400

    * Scripts for doing a pixel-scaling study.

commit 3018bd74ac81304030ed5bd00a7eb204525e6974
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Mon Jul 14 13:35:43 2008 -0700

    * Simple filtering for invalid data.

commit 9e56ae8d794536ba7c708dcb6717930ee3a9a610
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Mon Jul 14 12:49:51 2008 -0700

    * Scripts for evaluating SR performance.

commit d60c5829191da0c7fd70e7945bf5eaf7a1a3b1ab
Author: Tom Fogal <tfogal@alumni.unh.edu>
Date:   Mon Jul 14 12:34:34 2008 -0700

    * Some timing infrastructure code for measuring scalable renders.

      This is a bit complicated, but gives us a lot of information in a useful
      format: all the data are on one line.  This makes it convenient/easy to write
      simple scripts to parse out the data we are interested in.  The downside is
      we have a state variable in NetworkManager, and essentially a method copied
      into IceTNetworkManager just to change one string.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@4633 18c085ea-50e0-402c-830e-de6fd14e8384
parent a51f8993
......@@ -257,7 +257,7 @@ VisWindow::Initialize(VisWinRendering *ren)
frameAndState[5] = 0;
frameAndState[6] = 0;
mode = WINMODE_NONE;
backgroundMode = 0;
backgroundMode = AnnotationAttributes::Solid;
gradientBackground[0][0] = 0.;
gradientBackground[0][1] = 0.;
gradientBackground[0][2] = 1.;
......@@ -661,11 +661,14 @@ VisWindow::SetGradientBackgroundColors(int gradStyle,
// Creation: Wed Aug 29 15:28:49 PST 2001
//
// Modifications:
//
// Tom Fogal, Fri Jul 18 18:30:08 EDT 2008
// Change argument to use an enum.
//
// ****************************************************************************
void
VisWindow::SetBackgroundMode(int mode)
VisWindow::SetBackgroundMode(enum AnnotationAttributes::BackgroundMode mode)
{
backgroundMode = mode;
......@@ -684,10 +687,15 @@ VisWindow::SetBackgroundMode(int mode)
//
// Programmer: Brad Whitlock
// Creation: Wed Aug 29 15:31:11 PST 2001
//
// Modifications:
//
// Tom Fogal, Fri Jul 18 18:30:08 EDT 2008
// Change return value to be an enum.
//
// ****************************************************************************
int
enum AnnotationAttributes::BackgroundMode
VisWindow::GetBackgroundMode() const
{
return backgroundMode;
......
......@@ -390,6 +390,9 @@ class VisitInteractor;
// I added const to some methods which were already returning const objects
// anyway.
//
// Tom Fogal, Fri Jul 18 18:28:36 EDT 2008
// Use AnnotationAttributes::BackgroundMode instead of an int-equivalent.
//
// ****************************************************************************
class VISWINDOW_API VisWindow
......@@ -456,8 +459,10 @@ public:
const double * GetBackgroundColor() const;
void SetGradientBackgroundColors(int,double,double,double,
double,double,double);
void SetBackgroundMode(int);
int GetBackgroundMode() const;
void SetBackgroundMode(
enum AnnotationAttributes::BackgroundMode);
enum AnnotationAttributes::BackgroundMode
GetBackgroundMode() const;
void SetForegroundColor(double, double, double);
const double * GetForegroundColor() const;
void InvertBackgroundColor();
......@@ -644,7 +649,8 @@ protected:
double background[3];
double gradientBackground[2][3];
int gradientBackgroundStyle;
int backgroundMode;
enum AnnotationAttributes::BackgroundMode
backgroundMode;
int backgroundNX;
int backgroundNY;
std::string backgroundImage;
......
......@@ -341,6 +341,9 @@ Engine *Engine::Instance()
// Mark C. Miller, Thu Apr 3 14:36:48 PDT 2008
// Moved setting of component name to before Initialize
//
// Tom Fogal, Tue Jul 15 10:02:27 EDT 2008
// Include the # of processors we're running on in the timing message.
//
// ****************************************************************************
void
......@@ -390,7 +393,12 @@ Engine::Initialize(int *argc, char **argv[], bool sigs)
debug1 << "ENGINE started\n";
#ifdef PARALLEL
visitTimer->StopTimer(initTimer, "Initializing the engine (including MPI_Init())");
{
char msg[1024];
SNPRINTF(msg, 1024, "Initializing a %d processor engine "
"(including MPI_Init())", PAR_Size());
visitTimer->StopTimer(initTimer, msg);
}
#else
visitTimer->StopTimer(initTimer, "Initializing the engine");
#endif
......@@ -413,11 +421,16 @@ Engine::Initialize(int *argc, char **argv[], bool sigs)
// Eliminated out call to StopTimer. That call cannot be made after
// Finalize has been called. However, TimingsManager can still log the
// timer as "unknown" when writing timings to files
//
// Tom Fogal, Fri Jul 18 15:09:51 EDT 2008
// Remove the variable which captures the return value of StartTimer. It
// can't be used, and the compiler complains about it.
//
// ****************************************************************************
void
Engine::Finalize(void)
{
int finalizeTimer = visitTimer->StartTimer();
visitTimer->StartTimer();
Init::Finalize();
}
......
......@@ -47,6 +47,7 @@
#include <avtSourceFromImage.h>
#include <DebugStream.h>
#include <Engine.h>
#include <snprintf.h>
#include <StackTimer.h>
#include <UnexpectedValueException.h>
#include <VisWindow.h>
......@@ -89,7 +90,7 @@
ICET(icetGetIntegerv(ICET_RANK, &rank)); \
ICET(icetGetIntegerv(ICET_NUM_PROCESSES, &nproc)); \
ICET(icetGetIntegerv(ICET_NUM_TILES, &ntiles)); \
debug1 << "icet: (rank, procs, tiles): (" << rank << ", " << nproc \
debug1 << "IceT: (rank, procs, tiles): (" << rank << ", " << nproc \
<< ", " << ntiles << ")" << std::endl; \
} while(0)
......@@ -103,6 +104,22 @@
} while(0)
#endif
// ****************************************************************************
// Method: lerp
//
// Purpose: Linearly interpolates a value from one range to another.
//
// Programmer: Tom Fogal
// Creation: July 17, 2008
//
// ****************************************************************************
template <typename in, typename out>
static inline out
lerp(in value, in imin, in imax, out omin, out omax)
{
return omin + (value-imin) * (static_cast<float>(omax-omin) / (imax-imin));
}
// ****************************************************************************
// Method: utofv
//
......@@ -113,14 +130,19 @@
// Programmer: Tom Fogal
// Creation: July 2, 2008
//
// Modifications:
//
// Tom Fogal, Thu Jul 17 10:27:43 EDT 2008
// lerp the IceT buffer onto the range [0,1] as we convert. This seems to
// be what the rest of VisIt expects.
//
// ****************************************************************************
static float *
utofv(const unsigned int * const src, size_t n_elem)
{
size_t i;
float *res = new float[n_elem];
for(i=0; i < n_elem; ++i) {
res[i] = static_cast<float>(src[i]);
for(size_t i=0; i < n_elem; ++i) {
res[i] = lerp(src[i], 0U,UINT_MAX, 0.0f,1.0f);
}
return res;
}
......@@ -185,16 +207,27 @@ IceTNetworkManager::~IceTNetworkManager(void)
// Programmer: Tom Fogal
// Creation: June 17, 2008
//
// Modifications:
//
// Tom Fogal, Thu Jul 17 14:51:09 EDT 2008
// Configure every process to have a tile. This lets us rely on every
// process having an image, later.
//
// ****************************************************************************
void
IceTNetworkManager::TileLayout(size_t width, size_t height) const
{
GLint n_proc;
debug2 << "IceTNM: configuring " << width << "x" << height
<< " single tile display." << std::endl;
ICET(icetResetTiles());
static const int img_stored_on_this_mpi_proc = 0;
ICET(icetAddTile(0,0, width, height, img_stored_on_this_mpi_proc));
ICET(icetGetIntegerv(ICET_NUM_PROCESSES, &n_proc));
for(GLint proc=0; proc < n_proc; ++proc) {
debug3 << "IceTNM: adding " << proc << "/" << n_proc-1 << std::endl;
ICET(icetAddTile(0,0, width, height, proc));
}
}
// ****************************************************************************
......@@ -217,6 +250,9 @@ IceTNetworkManager::TileLayout(size_t width, size_t height) const
// Tom Fogal, Fri Jul 11 19:53:03 PDT 2008
// Added timer analogous to parent's overall render timer.
//
// Tom Fogal, Fri Jul 18 17:32:31 EDT 2008
// Query parent's implementation for rendering features.
//
// ****************************************************************************
avtDataObjectWriter_p
IceTNetworkManager::Render(intVector networkIds, bool getZBuffer,
......@@ -227,13 +263,11 @@ IceTNetworkManager::Render(intVector networkIds, bool getZBuffer,
EngineVisWinInfo &viswinInfo = viswinMap[windowID];
viswinInfo.markedForDeletion = false;
VisWindow *viswin = viswinInfo.viswin;
WindowAttributes &windowAttributes = viswinInfo.windowAttributes;
std::vector<avtPlot_p>& imageBasedPlots =
viswinMap.find(windowID)->second.imageBasedPlots;
std::vector<avtPlot_p>& imageBasedPlots = viswinInfo.imageBasedPlots;
TRY
{
StackTimer t_total("Total time for IceTNetworkManager::Render");
this->StartTimer();
this->RenderSetup(networkIds, getZBuffer, annotMode, windowID, leftEye);
// scalable threshold test (the 0.5 is to add some hysteresus to avoid
......@@ -250,30 +284,10 @@ IceTNetworkManager::Render(intVector networkIds, bool getZBuffer,
<< " primitives. Balanced speedup = "
<< RenderBalance(viswin->GetNumPrimitives()) << "x" << endl;
this->r_mgmt.viewportedMode =
(this->r_mgmt.annotMode != 1) ||
(viswin->GetWindowMode() == WINMODE_2D) ||
(viswin->GetWindowMode() == WINMODE_CURVE) ||
(viswin->GetWindowMode() == WINMODE_AXISARRAY);
int width, height;
viswin->GetSize(width, height);
this->TileLayout(width, height);
//
// Determine if we need to go for two passes
//
bool doShadows = windowAttributes.GetRenderAtts().GetDoShadowing();
bool doDepthCueing =
windowAttributes.GetRenderAtts().GetDoDepthCueing();
// Shadows and depth cueing don't make sense in a non-3D render anyway.
if(viswin->GetWindowMode() != WINMODE_3D)
{
doShadows = false;
doDepthCueing = false;
}
CallInitializeProgressCallback(this->RenderingStages(windowID));
// IceT mode is different from the standard network manager; we don't
......@@ -289,14 +303,19 @@ IceTNetworkManager::Render(intVector networkIds, bool getZBuffer,
// The IceT documentation recommends synchronization after rendering.
MPI_Barrier(VISIT_MPI_COMM);
// Now we're done rendering, we need to post process the image.
GLint rank;
ICET(icetGetIntegerv(ICET_RANK, &rank));
// Now that we're done rendering, we need to post process the image.
debug3 << "IceTNM: Starting readback." << std::endl;
avtDataObject_p dob;
{
avtImage_p img = this->Readback(viswin, this->r_mgmt.viewportedMode);
bool needZB;
needZB = (viswin->GetWindowMode() == WINMODE_3D ||
viswin->GetBackgroundMode() != 0) &&
(this->r_mgmt.getZBuffer ||
this->MultipassRendering(viswin) ||
this->Shadowing(windowID) ||
this->DepthCueing(windowID) ||
!(imageBasedPlots.empty()));
avtImage_p img = this->Readback(viswin, needZB);
CopyTo(dob, img);
}
......@@ -306,12 +325,12 @@ IceTNetworkManager::Render(intVector networkIds, bool getZBuffer,
// post processing
// creating a D.Obj.writer out of all this
if (doShadows)
if (this->Shadowing(windowID))
{
this->RenderShadows(windowID, dob);
}
if (doDepthCueing)
if (this->DepthCueing(windowID))
{
this->RenderDepthCues(windowID, dob);
}
......@@ -333,6 +352,7 @@ IceTNetworkManager::Render(intVector networkIds, bool getZBuffer,
CATCHALL(...)
{
debug5 << "IceTNM::Render exception!" << std::endl;
assert("Exception thrown, bailing out" == (const char*)0x0fa1afe1);
RETHROW;
}
ENDTRY
......@@ -372,11 +392,6 @@ IceTNetworkManager::RealRender()
// Method: Readback
//
// Purpose: Reads back the image buffer from IceT.
// Unfortunately for us, many post processing algorithms in VisIt
// assume they'll have an image available. In IceT, this is only
// true if the node is also a tile node. Most of the complication
// (and the MPI calls) in this method comes from making sure *all*
// nodes have images, whether or not they are driving a tile.
//
// Programmer: Tom Fogal
// Creation: June 20, 2008
......@@ -392,20 +407,25 @@ IceTNetworkManager::RealRender()
// Tom Fogal, Wed Jul 2 11:05:07 EDT 2008
// Readback and send/recv the Z buffer (unconditionally...).
//
// Tom Fogal, Thu Jul 17 14:49:35 EDT 2008
// Rely on the tiles being setup correctly; forget the whole `buddy' system.
//
// Tom Fogal, Thu Jul 17 17:02:40 EDT 2008
// Repurposed viewported argument for a boolean to grab Z.
//
// ****************************************************************************
avtImage_p
IceTNetworkManager::Readback(const VisWindow * const viswin,
bool viewported) const
bool readZ) const
{
assert(viswin);
GLboolean have_image;
GLint n_tiles, n_procs, rank;
ICET(icetGetBooleanv(ICET_COLOR_BUFFER_VALID, &have_image));
ICET(icetGetIntegerv(ICET_NUM_TILES, &n_tiles));
ICET(icetGetIntegerv(ICET_NUM_PROCESSES, &n_procs));
ICET(icetGetIntegerv(ICET_RANK, &rank));
DEBUG_ONLY(
ICET(icetGetBooleanv(ICET_COLOR_BUFFER_VALID, &have_image));
assert(GL_TRUE == have_image);
);
int width=-42, height=-42;
viswin->GetSize(width, height);
......@@ -414,53 +434,15 @@ IceTNetworkManager::Readback(const VisWindow * const viswin,
GLubyte *pixels = NULL;
GLuint *depth = NULL;
// We can't delete pointers IceT gives us. However if we're a receiving
// node, we'll dynamically allocate our buffers and thus need to deallocate
// them.
bool dynamic = false;
if(GL_TRUE == have_image)
{
// We have an image. First read it back from IceT.
pixels = icetGetColorBuffer();
DEBUG_ONLY(ICET_CHECK_ERROR);
depth = icetGetDepthBuffer();
DEBUG_ONLY(ICET_CHECK_ERROR);
// We have an image. First read it back from IceT.
pixels = icetGetColorBuffer();
DEBUG_ONLY(ICET_CHECK_ERROR);
depth = icetGetDepthBuffer();
DEBUG_ONLY(ICET_CHECK_ERROR);
this->VerifyColorFormat(); // Bail out if we don't get GL_RGBA data.
assert(NULL != depth);
for(GLint buddy=rank+1; buddy < n_procs; ++buddy)
{
// Send to machines with ranks a multiple of my own
if((buddy % n_tiles) == rank)
{
// 4: assuming GL_RGBA.
debug2 << "Processor " << rank << " sending to " << buddy
<< std::endl;
MPI_Send(pixels, 4*width*height, MPI_BYTE, buddy, 1,
VISIT_MPI_COMM);
MPI_Send(depth, width*height, MPI_UNSIGNED, buddy, 2,
VISIT_MPI_COMM);
}
}
}
else
{
// We don't have an image -- we need to receive it from our buddy.
GLint source = (rank % n_tiles);
debug2 << "Processor " << rank << " waiting for data from " << source
<< std::endl;
pixels = new GLubyte[4*width*height];
depth = new GLuint[width*height];
dynamic = true;
MPI_Recv(pixels, 4*width*height, MPI_BYTE, source, 1, VISIT_MPI_COMM,
MPI_STATUS_IGNORE);
debug2 << "Received image!" << std::endl;
MPI_Recv(depth, width*height, MPI_UNSIGNED, source, 2, VISIT_MPI_COMM,
MPI_STATUS_IGNORE);
}
debug2 << "Finished pushing buffers out." << std::endl;
this->VerifyColorFormat(); // Bail out if we don't get GL_RGBA data.
assert(NULL != pixels);
assert(NULL != depth);
vtkImageData *image = avtImageRepresentation::NewImage(width, height);
// NewImage assumes we want a 3-component ("GL_RGB") image, but IceT gives
......@@ -475,23 +457,48 @@ IceTNetworkManager::Readback(const VisWindow * const viswin,
memcpy(img_pix, pixels, width*height*4);
}
float *visit_depth_buffer = utofv(depth, width*height);
float *visit_depth_buffer = NULL;
if(readZ) {
debug1 << "converting depth values ..." << std::endl;
visit_depth_buffer = utofv(depth, width*height);
}
avtSourceFromImage screenCapSrc(image, visit_depth_buffer);
avtImage_p visit_img;
visit_img = screenCapSrc.GetTypedOutput();
avtImage_p visit_img = screenCapSrc.GetTypedOutput();
visit_img->Update(screenCapSrc.GetGeneralContract());
visit_img->SetSource(NULL);
image->Delete();
delete[] visit_depth_buffer;
if(dynamic)
{
delete[] pixels;
delete[] depth;
}
debug3 << "Readback complete." << std::endl;
return visit_img;
}
// ****************************************************************************
// Method: StopTimer
//
// Purpose: Time the IceT rendering process.
// IceT includes its own timing code that we might consider using at
// some point ...
//
// Programmer: Tom Fogal
// Creation: July 14, 2008
//
// ****************************************************************************
void
IceTNetworkManager::StopTimer(int windowID)
{
char msg[1024];
const VisWindow *viswin = this->viswinMap.find(windowID)->second.viswin;
int rows,cols;
viswin->GetSize(rows, cols);
SNPRINTF(msg, 1023, "IceTNM::Render %d cells %d pixels",
GetTotalGlobalCellCounts(windowID), rows*cols);
visitTimer->StopTimer(this->r_mgmt.timer, msg);
this->r_mgmt.timer = -1;
}
// ****************************************************************************
// Method: VerifyColorFormat
//
......
......@@ -56,13 +56,19 @@
// Tom Fogal, Tue Jun 24 13:27:48 EDT 2008
// Defined `Readback' function.
//
// Tom Fogal, Mon Jul 14 12:27:23 PDT 2008
// Override parent's timer information.
//
// Tom Fogal, Wed Jul 16 12:59:37 EDT 2008
// Oops, destructor should be virtual.
//
// ****************************************************************************
class IceTNetworkManager: public NetworkManager
{
public:
IceTNetworkManager(void);
~IceTNetworkManager(void);
virtual ~IceTNetworkManager(void);
void TileLayout(size_t width, size_t height) const;
......@@ -74,6 +80,7 @@ class IceTNetworkManager: public NetworkManager
protected:
virtual avtImage_p Readback(const VisWindow * const, bool) const;
virtual void StopTimer(int windowID);
private:
......
......@@ -62,6 +62,7 @@
#include <OperatorPluginManager.h>
#include <OperatorPluginInfo.h>
#include <AnnotationObjectList.h>
#include <AnnotationAttributes.h>
#include <PickAttributes.h>
#include <VisualCueInfo.h>
#include <VisualCueList.h>
......@@ -2052,6 +2053,13 @@ NetworkManager::HasNonMeshPlots(const intVector plotIds)
// had interpreted it wrong in the original implementation (a background
// mode of 0 is /not/ a gradient BG).
//
// Tom Fogal, Mon Jul 14 09:03:18 PDT 2008
// Use StartTimer instead of a StackTimer.
//
// Tom Fogal, Fri Jul 18 15:15:37 EDT 2008
// Use Shadowing and DepthCueing methods instead of querying those modes
// inline.
//
// ****************************************************************************
avtDataObjectWriter_p
......@@ -2063,7 +2071,6 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
EngineVisWinInfo &viswinInfo = viswinMap[windowID];
viswinInfo.markedForDeletion = false;
VisWindow *viswin = viswinInfo.viswin;
WindowAttributes &windowAttributes = viswinInfo.windowAttributes;
std::vector<avtPlot_p>& imageBasedPlots = viswinInfo.imageBasedPlots;
bool dump_renders = avtDebugDumpOptions::DumpEnabled();
......@@ -2071,7 +2078,7 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
TRY
{
avtDataObjectWriter_p writer;
StackTimer t_total("Total time for NetworkManager::Render");
this->StartTimer(); /* stopped in RenderCleanup */
this->RenderSetup(plotIds, getZBuffer, annotMode, windowID, leftEye);
......@@ -2089,28 +2096,8 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
<< " primitives. Balanced speedup = "
<< RenderBalance(viswin->GetNumPrimitives()) << "x" << endl;
//
// Determine if we need to go for two passes
//
bool doShadows = windowAttributes.GetRenderAtts().GetDoShadowing();
bool doDepthCueing =
windowAttributes.GetRenderAtts().GetDoDepthCueing();
// Shadows and depth cueing don't make sense in a non-3D render anyway.
if(viswin->GetWindowMode() != WINMODE_3D)
{
doShadows = false;
doDepthCueing = false;
}
CallInitializeProgressCallback(this->RenderingStages(windowID));
this->r_mgmt.viewportedMode =
(this->r_mgmt.annotMode != 1) ||
(viswin->GetWindowMode() == WINMODE_2D) ||
(viswin->GetWindowMode() == WINMODE_CURVE) ||
(viswin->GetWindowMode() == WINMODE_AXISARRAY);
// render the image and capture it. Relies upon explicit render
int t3 = visitTimer->StartTimer();
......@@ -2130,13 +2117,14 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
avtWholeImageCompositer *imageCompositer;
imageCompositer = MakeCompositer(
viswin->GetWindowMode() == WINMODE_3D,
viswin->GetBackgroundMode() != 0, // == gradient
getZBuffer,
this->MultipassRendering(viswin),
doShadows, doDepthCueing,
!imageBasedPlots.empty()
);
viswin->GetWindowMode() == WINMODE_3D,
viswin->GetBackgroundMode() == AnnotationAttributes::Gradient,
getZBuffer,
this->MultipassRendering(viswin),
this->Shadowing(windowID),
this->DepthCueing(windowID),
!imageBasedPlots.empty()
);
assert(NULL != imageCompositer);
SetCompositerBackground(imageCompositer, viswin);
......@@ -2180,7 +2168,7 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
//
// Do shadows if appropriate.
//
if (doShadows)
if (this->Shadowing(windowID))
{
this->RenderShadows(windowID, compositedImageAsDataObject);
}
......@@ -2188,7 +2176,7 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
//
// Do depth cueing if appropriate.
//
if (doDepthCueing)
if (this->DepthCueing(windowID))
{
this->RenderDepthCues(windowID, compositedImageAsDataObject);
}
......@@ -2292,6 +2280,9 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
// Jeremy Meredith, Thu Jan 31 14:56:06 EST 2008
// Added new axis array window mode.
//
// Tom Fogal, Fri Jul 18 19:10:06 EDT 2008
// Use enum definitions instead of int.
//
// ****************************************************************************
void
NetworkManager::SetWindowAttributes(const WindowAttributes &atts,
......@@ -2410,11 +2401,16 @@ NetworkManager::SetWindowAttributes(const WindowAttributes &atts,
atts.GetForeground()[2]/255.0);
//
// Set the bacbround mode and gradient colors if necessary
// Set the background mode and gradient colors if necessary
//
int bgMode = atts.GetBackgroundMode();