Commit f15f4bfe authored by Ken Martin's avatar Ken Martin

Get render passes working in OpenGL2

Add in a bunch of render pass classes that were previously removed.
At the same time get the GaussianBlurPass and SobelGradientMagnitude
classes to work with the new backend.
This code now exercises a few methods that previously were not
previously exercised. As such I made some significant changes to those
methods to make them fit in better with the new architecture.

In the process of testing I did find a calculation error in the old
code related to cmoputing camera angles. I fixed this issue in both the
old and new rendering backend.

The tests for these passes were modified to not use the DepthPeelingPass
as that pass has not been converted yet.

Change-Id: Ie40231385291aa06848034460817b171e60f7a53
parent d4326fa1
......@@ -172,7 +172,7 @@ vtkIdType vtkOpenGLContextBufferId::GetPickedItem(int x, int y)
this->Texture->Bind();
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);
glEnable(GL_TEXTURE_2D);
this->Texture->CopyToFrameBuffer(x,y,x,y,x,y);
this->Texture->CopyToFrameBuffer(x,y,x,y,x,y,this->Context,NULL,NULL);
glDisable(GL_TEXTURE_2D);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); // restore
......
......@@ -50,10 +50,6 @@
#include "vtkGaussianBlurPass.h"
#include "vtkConeSource.h"
// Make sure to have a valid OpenGL context current on the calling thread
// before calling it. Defined in TestGenericVertexAttributesGLSLAlphaBlending.
bool MesaHasVTKBug8135(vtkRenderWindow *);
int TestGaussianBlurPass(int argc, char* argv[])
{
vtkSmartPointer<vtkRenderWindowInteractor> iren=
......@@ -79,14 +75,14 @@ int TestGaussianBlurPass(int argc, char* argv[])
vtkSmartPointer<vtkSequencePass>::New();
vtkSmartPointer<vtkOpaquePass> opaque=
vtkSmartPointer<vtkOpaquePass>::New();
vtkSmartPointer<vtkDepthPeelingPass> peeling=
vtkSmartPointer<vtkDepthPeelingPass>::New();
peeling->SetMaximumNumberOfPeels(200);
peeling->SetOcclusionRatio(0.1);
// vtkSmartPointer<vtkDepthPeelingPass> peeling=
// vtkSmartPointer<vtkDepthPeelingPass>::New();
// peeling->SetMaximumNumberOfPeels(200);
// peeling->SetOcclusionRatio(0.1);
vtkSmartPointer<vtkTranslucentPass> translucent=
vtkSmartPointer<vtkTranslucentPass>::New();
peeling->SetTranslucentPass(translucent);
// peeling->SetTranslucentPass(translucent);
vtkSmartPointer<vtkVolumetricPass> volume=
vtkSmartPointer<vtkVolumetricPass>::New();
......@@ -101,8 +97,8 @@ int TestGaussianBlurPass(int argc, char* argv[])
passes->AddItem(lights);
passes->AddItem(opaque);
passes->AddItem(peeling);
// passes->AddItem(translucent);
// passes->AddItem(peeling);
passes->AddItem(translucent);
passes->AddItem(volume);
passes->AddItem(overlay);
......@@ -176,36 +172,27 @@ int TestGaussianBlurPass(int argc, char* argv[])
renWin->Render();
int retVal;
if(MesaHasVTKBug8135(renWin))
actor->SetVisibility(1);
coneActor->SetVisibility(1);
renderer->ResetCamera();
vtkCamera *camera=renderer->GetActiveCamera();
camera->Azimuth(-40.0);
camera->Elevation(20.0);
renWin->Render();
if(peeling->GetLastRenderingUsedDepthPeeling())
{
// Mesa will crash if version<7.3
cout<<"This version of Mesa would crash. Skip the test."<<endl;
retVal=vtkRegressionTester::PASSED;
cout<<"depth peeling was used"<<endl;
}
else
{
actor->SetVisibility(1);
coneActor->SetVisibility(1);
renderer->ResetCamera();
vtkCamera *camera=renderer->GetActiveCamera();
camera->Azimuth(-40.0);
camera->Elevation(20.0);
renWin->Render();
if(peeling->GetLastRenderingUsedDepthPeeling())
{
cout<<"depth peeling was used"<<endl;
}
else
{
cout<<"depth peeling was not used (alpha blending instead)"<<endl;
}
retVal = vtkRegressionTestImage( renWin );
if ( retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
}
cout<<"depth peeling was not used (alpha blending instead)"<<endl;
}
retVal = vtkRegressionTestImage( renWin );
if ( retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
}
return !retVal;
}
......@@ -145,7 +145,7 @@ void vtkImageProcessingPass::RenderDelegate(const vtkRenderState *s,
cout << "old angle =" << angle << " rad="<< vtkMath::DegreesFromRadians(angle) << " deg" <<endl;
#endif
angle=atan(tan(angle)*large/static_cast<double>(small));
angle=2.0*atan(tan(angle/2.0)*large/static_cast<double>(small));
#ifdef VTK_IMAGE_PROCESSING_PASS_DEBUG
cout << "new angle =" << angle << " rad="<< vtkMath::DegreesFromRadians(angle) << " deg" <<endl;
......
......@@ -19,7 +19,13 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkTDxConfigure.h.in
set(Module_SRCS
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
vtkCameraPass.cxx
vtkCompositePolyDataMapper2.cxx
vtkDefaultPass.cxx
vtkGaussianBlurPass.cxx
vtkImageProcessingPass.cxx
vtkLightsPass.cxx
vtkOpaquePass.cxx
vtkOpenGLActor.cxx
vtkOpenGLCamera.cxx
vtkOpenGLGlyph3DHelper.cxx
......@@ -35,12 +41,18 @@ set(Module_SRCS
vtkOpenGLRenderer.cxx
vtkOpenGLShaderCache.cxx
vtkOpenGLTexture.cxx
vtkOverlayPass.cxx
vtkRenderPass.cxx
vtkRenderPassCollection.cxx
vtkRenderState.cxx
vtkSequencePass.cxx
vtkShader.cxx
vtkShaderProgram.cxx
vtkSobelGradientMagnitudePass.cxx
vtkTextureObject.cxx
vtkTextureUnitManager.cxx
vtkTranslucentPass.cxx
vtkVolumetricPass.cxx
vtkglBufferObject.cxx
vtkglVBOHelper.cxx
vtkglVertexArrayObject.cxx
......@@ -99,6 +111,15 @@ set(shader_files
glsl/vtkglPolyDataFSPositionalLights.glsl
glsl/vtkglGlyph3DVSFragmentLit.glsl
glsl/vtkTextureObjectVS.glsl
glsl/vtkTextureObjectFS.glsl
glsl/vtkGaussianBlurPassVS.glsl
glsl/vtkGaussianBlurPassFS.glsl
glsl/vtkSobelGradientMagnitudePass1FS.glsl
glsl/vtkSobelGradientMagnitudePass2FS.glsl
)
unset(shader_h_files)
......
......@@ -2,6 +2,9 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
#TestRenderWidget.cxx # Very experimental, fails, does nothing useful yet.
TestVBOPLYMapper.cxx
TestVBOPointsLines.cxx
TestGaussianBlurPass.cxx
TestBlurAndSobelPasses.cxx
TestSobelGradientMagnitudePass.cxx
)
vtk_test_cxx_executable(${vtk-module}CxxTests tests RENDERING_FACTORY)
/*=========================================================================
Program: Visualization Toolkit
Module: TestBlurAndSobelPasses.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This test covers the combination of two post-processing render passes:
// Gaussian blur first, followed by a Sobel detection. It renders of an
// opaque cone.
//
// The command line arguments are:
// -I => run in interactive mode; unless this is used, the program will
// not allow interaction and exit
#include "vtkTestUtilities.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderWindow.h"
#include "vtkOpenGLRenderer.h"
#include "vtkActor.h"
#include "vtkImageSinusoidSource.h"
#include "vtkImageData.h"
#include "vtkImageDataGeometryFilter.h"
#include "vtkDataSetSurfaceFilter.h"
#include "vtkPolyDataMapper.h"
#include "vtkLookupTable.h"
#include "vtkCamera.h"
#include "vtkCameraPass.h"
#include "vtkLightsPass.h"
#include "vtkSequencePass.h"
#include "vtkOpaquePass.h"
//#include "vtkDepthPeelingPass.h"
#include "vtkTranslucentPass.h"
#include "vtkVolumetricPass.h"
#include "vtkOverlayPass.h"
#include "vtkRenderPassCollection.h"
#include "vtkGaussianBlurPass.h"
#include "vtkSobelGradientMagnitudePass.h"
#include "vtkConeSource.h"
int TestBlurAndSobelPasses(int argc, char* argv[])
{
vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->SetMultiSamples(0);
renWin->SetAlphaBitPlanes(1);
iren->SetRenderWindow(renWin);
renWin->Delete();
vtkRenderer *renderer = vtkRenderer::New();
renWin->AddRenderer(renderer);
renderer->Delete();
vtkOpenGLRenderer *glrenderer = vtkOpenGLRenderer::SafeDownCast(renderer);
vtkCameraPass *cameraP=vtkCameraPass::New();
vtkSequencePass *seq=vtkSequencePass::New();
vtkOpaquePass *opaque=vtkOpaquePass::New();
// vtkDepthPeelingPass *peeling=vtkDepthPeelingPass::New();
// peeling->SetMaximumNumberOfPeels(200);
// peeling->SetOcclusionRatio(0.1);
vtkTranslucentPass *translucent=vtkTranslucentPass::New();
// peeling->SetTranslucentPass(translucent);
vtkVolumetricPass *volume=vtkVolumetricPass::New();
vtkOverlayPass *overlay=vtkOverlayPass::New();
vtkLightsPass *lights=vtkLightsPass::New();
vtkRenderPassCollection *passes=vtkRenderPassCollection::New();
passes->AddItem(lights);
passes->AddItem(opaque);
// passes->AddItem(peeling);
passes->AddItem(translucent);
passes->AddItem(volume);
passes->AddItem(overlay);
seq->SetPasses(passes);
cameraP->SetDelegatePass(seq);
vtkGaussianBlurPass *blurP=vtkGaussianBlurPass::New();
blurP->SetDelegatePass(cameraP);
vtkSobelGradientMagnitudePass *sobelP=vtkSobelGradientMagnitudePass::New();
sobelP->SetDelegatePass(blurP);
glrenderer->SetPass(sobelP);
// renderer->SetPass(cameraP);
opaque->Delete();
// peeling->Delete();
translucent->Delete();
volume->Delete();
overlay->Delete();
seq->Delete();
passes->Delete();
cameraP->Delete();
blurP->Delete();
sobelP->Delete();
lights->Delete();
vtkImageSinusoidSource *imageSource=vtkImageSinusoidSource::New();
imageSource->SetWholeExtent(0,9,0,9,0,9);
imageSource->SetPeriod(5);
imageSource->Update();
vtkImageData *image=imageSource->GetOutput();
double range[2];
image->GetScalarRange(range);
vtkDataSetSurfaceFilter *surface=vtkDataSetSurfaceFilter::New();
surface->SetInputConnection(imageSource->GetOutputPort());
imageSource->Delete();
vtkPolyDataMapper *mapper=vtkPolyDataMapper::New();
mapper->SetInputConnection(surface->GetOutputPort());
surface->Delete();
vtkLookupTable *lut=vtkLookupTable::New();
lut->SetTableRange(range);
lut->SetAlphaRange(0.5,0.5);
lut->SetHueRange(0.2,0.7);
lut->SetNumberOfTableValues(256);
lut->Build();
mapper->SetScalarVisibility(1);
mapper->SetLookupTable(lut);
lut->Delete();
vtkActor *actor=vtkActor::New();
renderer->AddActor(actor);
actor->Delete();
actor->SetMapper(mapper);
mapper->Delete();
actor->SetVisibility(0);
vtkConeSource *cone=vtkConeSource::New();
vtkPolyDataMapper *coneMapper=vtkPolyDataMapper::New();
coneMapper->SetInputConnection(cone->GetOutputPort());
coneMapper->SetImmediateModeRendering(1);
cone->Delete();
vtkActor *coneActor=vtkActor::New();
coneActor->SetMapper(coneMapper);
coneActor->SetVisibility(1);
coneMapper->Delete();
renderer->AddActor(coneActor);
coneActor->Delete();
renderer->SetBackground(0.1,0.3,0.0);
renWin->SetSize(400,400);
renWin->Render();
// if(peeling->GetLastRenderingUsedDepthPeeling())
// {
// cout<<"depth peeling was used"<<endl;
// }
// else
// {
// cout<<"depth peeling was not used (alpha blending instead)"<<endl;
// }
vtkCamera *camera=renderer->GetActiveCamera();
camera->Azimuth(-40.0);
camera->Elevation(20.0);
renWin->Render();
int retVal = vtkRegressionTestImage( renWin );
if ( retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
}
iren->Delete();
return !retVal;
}
/*=========================================================================
Program: Visualization Toolkit
Module: TestGaussianBlurPass.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This test covers the gaussian blur post-processing render pass.
// It renders an actor with a translucent LUT and depth
// peeling using the multi renderpass classes. The mapper uses color
// interpolation (poor quality).
//
// The command line arguments are:
// -I => run in interactive mode; unless this is used, the program will
// not allow interaction and exit
#include "vtkTestUtilities.h"
#include "vtkRegressionTestImage.h"
#include "vtkSmartPointer.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderWindow.h"
#include "vtkOpenGLRenderer.h"
#include "vtkActor.h"
#include "vtkImageSinusoidSource.h"
#include "vtkImageData.h"
#include "vtkImageDataGeometryFilter.h"
#include "vtkDataSetSurfaceFilter.h"
#include "vtkPolyDataMapper.h"
#include "vtkLookupTable.h"
#include "vtkCamera.h"
#include "vtkCameraPass.h"
#include "vtkLightsPass.h"
#include "vtkSequencePass.h"
#include "vtkOpaquePass.h"
//#include "vtkDepthPeelingPass.h"
#include "vtkTranslucentPass.h"
#include "vtkVolumetricPass.h"
#include "vtkOverlayPass.h"
#include "vtkRenderPassCollection.h"
#include "vtkGaussianBlurPass.h"
#include "vtkConeSource.h"
int TestGaussianBlurPass(int argc, char* argv[])
{
vtkSmartPointer<vtkRenderWindowInteractor> iren=
vtkSmartPointer<vtkRenderWindowInteractor>::New();
vtkSmartPointer<vtkRenderWindow> renWin =
vtkSmartPointer<vtkRenderWindow>::New();
renWin->SetMultiSamples(0);
renWin->SetAlphaBitPlanes(1);
iren->SetRenderWindow(renWin);
vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
renWin->AddRenderer(renderer);
vtkOpenGLRenderer *glrenderer =
vtkOpenGLRenderer::SafeDownCast(renderer.GetPointer());
vtkSmartPointer<vtkCameraPass> cameraP=
vtkSmartPointer<vtkCameraPass>::New();
vtkSmartPointer<vtkSequencePass> seq=
vtkSmartPointer<vtkSequencePass>::New();
vtkSmartPointer<vtkOpaquePass> opaque=
vtkSmartPointer<vtkOpaquePass>::New();
/*
vtkSmartPointer<vtkDepthPeelingPass> peeling=
vtkSmartPointer<vtkDepthPeelingPass>::New();
peeling->SetMaximumNumberOfPeels(200); // these settings make no sense 200, 0.1?
peeling->SetOcclusionRatio(0.1); // far more reasonable values would be 50, 0.01
*/
vtkSmartPointer<vtkTranslucentPass> translucent=
vtkSmartPointer<vtkTranslucentPass>::New();
//peeling->SetTranslucentPass(translucent);
vtkSmartPointer<vtkVolumetricPass> volume=
vtkSmartPointer<vtkVolumetricPass>::New();
vtkSmartPointer<vtkOverlayPass> overlay=
vtkSmartPointer<vtkOverlayPass>::New();
vtkSmartPointer<vtkLightsPass> lights=
vtkSmartPointer<vtkLightsPass>::New();
vtkSmartPointer<vtkRenderPassCollection> passes=
vtkSmartPointer<vtkRenderPassCollection>::New();
passes->AddItem(lights);
passes->AddItem(opaque);
// passes->AddItem(peeling);
passes->AddItem(translucent);
passes->AddItem(volume);
passes->AddItem(overlay);
seq->SetPasses(passes);
cameraP->SetDelegatePass(seq);
vtkSmartPointer<vtkGaussianBlurPass> blurP=
vtkSmartPointer<vtkGaussianBlurPass>::New();
blurP->SetDelegatePass(cameraP);
glrenderer->SetPass(blurP);
// renderer->SetPass(cameraP);
vtkSmartPointer<vtkImageSinusoidSource> imageSource=
vtkSmartPointer<vtkImageSinusoidSource>::New();
imageSource->SetWholeExtent(0,9,0,9,0,9);
imageSource->SetPeriod(5);
imageSource->Update();
vtkImageData *image=imageSource->GetOutput();
double range[2];
image->GetScalarRange(range);
vtkSmartPointer<vtkDataSetSurfaceFilter> surface=
vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
surface->SetInputConnection(imageSource->GetOutputPort());
vtkSmartPointer<vtkPolyDataMapper> mapper=
vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(surface->GetOutputPort());
vtkSmartPointer<vtkLookupTable> lut=
vtkSmartPointer<vtkLookupTable>::New();
lut->SetTableRange(range);
lut->SetAlphaRange(0.5,0.5);
lut->SetHueRange(0.2,0.7);
lut->SetNumberOfTableValues(256);
lut->Build();
mapper->SetScalarVisibility(1);
mapper->SetLookupTable(lut);
vtkSmartPointer<vtkActor> actor=
vtkSmartPointer<vtkActor>::New();
renderer->AddActor(actor);
actor->SetMapper(mapper);
actor->SetVisibility(1);
vtkSmartPointer<vtkConeSource> cone=
vtkSmartPointer<vtkConeSource>::New();
vtkSmartPointer<vtkPolyDataMapper> coneMapper=
vtkSmartPointer<vtkPolyDataMapper>::New();
coneMapper->SetInputConnection(cone->GetOutputPort());
coneMapper->SetImmediateModeRendering(1);
vtkSmartPointer<vtkActor> coneActor=
vtkSmartPointer<vtkActor>::New();
coneActor->SetMapper(coneMapper);
coneActor->SetVisibility(1);
renderer->AddActor(coneActor);
renderer->SetBackground(0.1,0.3,0.0);
renWin->SetSize(400,400);
// empty scene during OpenGL detection.
actor->SetVisibility(0);
coneActor->SetVisibility(0);
renWin->Render();
int retVal;
actor->SetVisibility(1);
coneActor->SetVisibility(1);
renderer->ResetCamera();
vtkCamera *camera=renderer->GetActiveCamera();
camera->Azimuth(-40.0);
camera->Elevation(20.0);
renWin->Render();
// if(peeling->GetLastRenderingUsedDepthPeeling())
// {
// cout<<"depth peeling was used"<<endl;
// }
// else
// {
// cout<<"depth peeling was not used (alpha blending instead)"<<endl;
// }
retVal = vtkRegressionTestImage( renWin );
if ( retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
}
return !retVal;
}
/*=========================================================================
Program: Visualization Toolkit
Module: TestSobelGradientMagnitudePass.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This test covers the Sobel edge detection post-processing render pass.
// It renders an opaque actor The mapper uses color
// interpolation (poor quality).
//
// The command line arguments are:
// -I => run in interactive mode; unless this is used, the program will
// not allow interaction and exit
#include "vtkTestUtilities.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderWindow.h"
#include "vtkOpenGLRenderer.h"
#include "vtkActor.h"
#include "vtkImageSinusoidSource.h"
#include "vtkImageData.h"
#include "vtkImageDataGeometryFilter.h"
#include "vtkDataSetSurfaceFilter.h"
#include "vtkPolyDataMapper.h"
#include "vtkLookupTable.h"
#include "vtkCamera.h"
#include "vtkCameraPass.h"
#include "vtkLightsPass.h"
#include "vtkSequencePass.h"
#include "vtkOpaquePass.h"
//#include "vtkDepthPeelingPass.h"
#include "vtkTranslucentPass.h"
#include "vtkVolumetricPass.h"
#include "vtkOverlayPass.h"
#include "vtkRenderPassCollection.h"
#include "vtkSobelGradientMagnitudePass.h"
#include "vtkConeSource.h"
int TestSobelGradientMagnitudePass(int argc, char* argv[])
{
vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->SetMultiSamples(0);
renWin->SetAlphaBitPlanes(1);
iren->SetRenderWindow(renWin);
renWin->Delete();
vtkRenderer *renderer = vtkRenderer::New();
renWin->AddRenderer(renderer);
renderer->Delete();
vtkOpenGLRenderer *glrenderer = vtkOpenGLRenderer::SafeDownCast(renderer);
vtkCameraPass *cameraP=vtkCameraPass::New();
vtkSequencePass *seq=vtkSequencePass::New();
vtkOpaquePass *opaque=vtkOpaquePass::New();
// vtkDepthPeelingPass *peeling=vtkDepthPeelingPass::New();
// peeling->SetMaximumNumberOfPeels(200);
// peeling->SetOcclusionRatio(0.1);
vtkTranslucentPass *translucent=vtkTranslucentPass::New();
// peeling->SetTranslucentPass(translucent);
vtkVolumetricPass *volume=vtkVolumetricPass::New();
vtkOverlayPass *overlay=vtkOverlayPass::New();
vtkLightsPass *lights=vtkLightsPass::New();
vtkRenderPassCollection *passes=vtkRenderPassCollection::New();
passes->AddItem(lights);
passes->AddItem(opaque);
// passes->AddItem(peeling);
passes->AddItem(translucent);
passes->AddItem(volume);
passes->AddItem(overlay);
seq->SetPasses(passes);
cameraP->SetDelegatePass(seq);
vtkSobelGradientMagnitudePass *sobelP=vtkSobelGradientMagnitudePass::New();
sobelP->SetDelegatePass(cameraP);
glrenderer->SetPass(sobelP);
// renderer->SetPass(cameraP);
opaque->Delete();
// peeling->Delete();
translucent->Delete();
volume->Delete();
overlay->Delete();
seq->Delete();
passes->Delete();
cameraP->Delete();
sobelP->Delete();
lights->Delete();
vtkImageSinusoidSource *imageSource=vtkImageSinusoidSource::New();
imageSource->SetWholeExtent(0,9,0,9,0,9);
imageSource->SetPeriod(5);
imageSource->Update();
vtkImageData *image=imageSource->GetOutput();
double range[2];
image->GetScalarRange(range);
vtkDataSetSurfaceFilter *surface=vtkDataSetSurfa