[vtkusers] Inconsistent rendering between debug and release

Tim Soper tim_d_soper at yahoo.com
Tue Nov 6 14:43:39 EST 2007


I wanted to re-reply to my original post when trying to find the cause of slight differences in rendering in debug vs. release. I eventually got everything to work the same by setting the VTK compiler flags for release
using the CMake variable CMAKE_CXX_FLAGS_RELEASE and rebuilding VTK release version. Once I changed the optimization flags  /Op ("Improved Floating Point Consistency") and /Od for (disabled optimizations... rather than /O2) the outputs between the two were the same. It appeaers that these compiler default flags are set in CMAKE rather than being defined explicitly in VTK CMake files. I'm not sure why they are defaulted to these values or what the ramifications are of changing the compile options might be, but at least I can compare performance between the two directly. 



----- Original Message ----
From: Tim Soper <tim_d_soper at yahoo.com>
To: vtkusers at vtk.org
Sent: Friday, November 2, 2007 4:06:03 PM
Subject: [vtkusers] Inconsistent rendering between debug and release


Hi-
   I have an application where I optimize the camera location in a
 scene. At each camera location I convert the rendered scene to an image
 using the vtkWindowToImageFilter and compare it to a reference image. I am
  somewhat troubled in that the output images are not exactly the same
 for debug and release despite the fact that values for the camera (ie
 position, focus, view up, view angle, etc) are all the same. The snippet
 of code getting called by my optimizer is something like:

                        :
    vtkCamera* cam =
 this->renWin->GetRenderers()->GetFirstRenderer()->GetActiveCamera();
    cam->SetPosition( pos );
    cam->SetFocalPoint( focus ); 
    cam->SetViewUp( viewup );

    this->renWin->Render();
    this->w2i->Modified();  //Update the vtkWindowToImageFilter
                    :

The debug and release are exactly the same for several hundred
 iterations before they begin to deviate.
I isolated the iteration where the the release and debug change and
 wrote the images to file using vtkBMPWriter.  

bmpWriter->SetInput( w2i->GetOutput() );
bmpWriter->Write();

There were several pixels in the images that were different despite
 having exactly the same camera position. There was a maximum difference of
 9 on a 256 scale. Is there a reason the rendering would change that
 much between debug and release? Are there compiler options I haven't
 considered? Or could my graphics card (ATI 5100) be the culprit? - As a
 note, I have seen differences in release versions before owing to
 round-off error which  were fixed by setting the compiler optimization flag /Op
 for "Improved Floating Point Consistency". This did not fix the
 problem. 

Any insights would be very, very helpful.
 


 
Tim Soper 
Research Assistant
University of Washington
Department of Bioengineering 
Box 352142




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
 http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the vtkusers mailing list