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

Add a test for vtkRenderer::UseOIT

parent 2109b3cf
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,7 @@ vtk_add_test_cxx(vtkRenderingCoreCxxTests tests
TestOffAxisStereo.cxx
TestOnAndOffScreenConeCxx.cxx
TestOpacity.cxx
TestOpacityMSAA.cxx
TestOrderedTriangulator.cxx
TestOSConeCxx.cxx
TestPickingManager.cxx,NO_VALID
......
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**Description
*
*/
#include "vtkActor.h"
#include "vtkCamera.h"
#include "vtkConeSource.h"
#include "vtkNew.h"
#include "vtkPolyDataMapper.h"
#include "vtkProperty.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkTesting.h"
int TestOpacityMSAA(int argc, char* argv[])
{
cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
vtkNew<vtkConeSource> c1;
c1->SetResolution(1);
c1->SetCenter(-0.5, 0, 0);
c1->SetRadius(1.3);
vtkNew<vtkPolyDataMapper> m1;
m1->SetInputConnection(c1->GetOutputPort());
vtkNew<vtkActor> a1;
a1->SetMapper(m1);
vtkNew<vtkConeSource> c2;
c2->SetResolution(1);
c2->SetCenter(0.5, 0, 0);
c2->SetRadius(1.3);
c2->SetDirection(-1, 0, 0);
vtkNew<vtkPolyDataMapper> m2;
m2->SetInputConnection(c2->GetOutputPort());
vtkNew<vtkActor> a2;
a2->SetMapper(m2);
a2->GetProperty()->SetOpacity(0.5);
vtkNew<vtkRenderWindow> renWin;
renWin->SetMultiSamples(8); // enable multisampling
renWin->SetSize(301, 300); // Intentional NPOT size
vtkNew<vtkRenderer> ren;
ren->AddActor(a1);
ren->AddActor(a2);
renWin->AddRenderer(ren);
ren->ResetCamera();
ren->GetActiveCamera()->Roll(4);
ren->SetUseOIT(false); // disable OIT pass
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow(renWin);
renWin->Render();
int retVal = vtkRegressionTestImage(renWin);
if (retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
}
return !retVal;
}
b5dce5a56db0d685c638e3383536bcbb1cbf0b71040989c7fad040f221f4527f761d7cd22c7e4dd63aaf368cc236e366d37c4832b07f59f50b6928d223f7da9e
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