Skip to content
Snippets Groups Projects
Commit 9bb5b5b0 authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri :speech_balloon:
Browse files

Add test for FXAA with EDL

parent d6ff8a71
No related branches found
No related tags found
No related merge requests found
......@@ -33,12 +33,13 @@ vtk_add_test_cxx(vtkRenderingOpenGL2CxxTests tests
TestDepthPeelingPassViewport.cxx
TestEDLPass.cxx
TestEquirectangularToCubeMap.cxx
TestFXAAFilter.cxx
TestFXAAPass.cxx
TestFXAAWithEDLPass.cxx
TestFloor.cxx
TestFluidMapper.cxx
TestFramebufferHDR.cxx
TestFramebufferPass.cxx
TestFXAAFilter.cxx
TestFXAAPass.cxx
TestGaussianBlurPass.cxx
TestGlyph3DMapperCellPicking.cxx
TestGlyph3DMapperCulling.cxx
......
/*=========================================================================
Program: Visualization Toolkit
Module: TestFXAAWithEDLPass.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.
=========================================================================*/
// Description
// Test FXAA with EDL pass
#include "vtkActor.h"
#include "vtkCamera.h"
#include "vtkCylinderSource.h"
#include "vtkEDLShading.h"
#include "vtkNew.h"
#include "vtkOpenGLFXAAPass.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderStepsPass.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkTesting.h"
int TestFXAAWithEDLPass(int argc, char* argv[])
{
cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
vtkNew<vtkCylinderSource> cylinder;
vtkNew<vtkPolyDataMapper> mapper;
mapper->SetInputConnection(cylinder->GetOutputPort());
vtkNew<vtkActor> actor;
actor->SetMapper(mapper);
vtkNew<vtkRenderer> ren;
ren->SetBackground(1.0, 1.0, 1.0);
ren->AddActor(actor);
vtkNew<vtkRenderWindow> renWin;
renWin->SetMultiSamples(0);
renWin->AddRenderer(ren);
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow(renWin);
vtkNew<vtkRenderStepsPass> basicPasses;
vtkNew<vtkEDLShading> edl;
edl->SetDelegatePass(basicPasses);
vtkNew<vtkOpenGLFXAAPass> fxaa;
fxaa->SetDelegatePass(edl);
ren->SetPass(fxaa);
ren->ResetCamera();
auto cam = ren->GetActiveCamera();
cam->SetViewUp(-0.45365, 0.78693, -0.418262);
cam->SetPosition(-0.388464, 0.574701, 0.0925649);
cam->SetFocalPoint(-0.50418, 0.453051, -0.0108049);
ren->ResetCameraClippingRange();
return vtkTesting::InteractorEventLoop(argc, argv, iren, nullptr);
}
cc064ca059d2d81b7e182755d20b6cea6c8a186ab120adb7d218430443990b450faef175f1d008a00cd5cd51a0ea0cc65887a97936202bfc5136620b606f51bd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment