Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Michael Migliore
VTK
Commits
f2c3438a
Commit
f2c3438a
authored
Aug 30, 2016
by
David DeMarle
Browse files
update test to allow VTKs own cpu vol renderer
parent
0d69e366
Changes
1
Hide whitespace changes
Inline
Side-by-side
Rendering/OSPRay/Testing/Cxx/TestGPURayCastMapperBenchmark.cxx
View file @
f2c3438a
...
...
@@ -11,11 +11,12 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This test is intended to benchmark render times for the v
tkGPURayCastM
apper
// This test is intended to benchmark render times for the v
olumem
apper
s
#include
"vtkCamera.h"
#include
"vtkColorTransferFunction.h"
#include
"vtkGPUVolumeRayCastMapper.h"
#include
"vtkFixedPointVolumeRayCastMapper.h"
#include
"vtkImageData.h"
#include
"vtkNew.h"
#include
"vtkPiecewiseFunction.h"
...
...
@@ -37,6 +38,7 @@ int TestGPURayCastMapperBenchmark(int argc, char* argv[])
cout
<<
"CTEST_FULL_OUTPUT (Avoid ctest truncation of output)"
<<
endl
;
bool
useOSP
=
true
;
bool
useFP
=
false
;
int
EXT
=
128
;
int
RES
=
900
;
for
(
int
i
=
0
;
i
<
argc
;
i
++
)
...
...
@@ -45,6 +47,10 @@ int TestGPURayCastMapperBenchmark(int argc, char* argv[])
{
useOSP
=
false
;
}
if
(
!
strcmp
(
argv
[
i
],
"-FP"
))
{
useFP
=
true
;
}
if
(
!
strcmp
(
argv
[
i
],
"-EXT"
))
{
EXT
=
atoi
(
argv
[
i
+
1
]);
...
...
@@ -68,7 +74,15 @@ int TestGPURayCastMapperBenchmark(int argc, char* argv[])
double
makeDataTime
=
timer
->
GetElapsedTime
();
cerr
<<
"Make data time: "
<<
makeDataTime
<<
endl
;
vtkNew
<
vtkGPUVolumeRayCastMapper
>
volumeMapper
;
vtkNew
<
vtkGPUVolumeRayCastMapper
>
gpu_volumeMapper
;
vtkNew
<
vtkFixedPointVolumeRayCastMapper
>
cpu_volumeMapper
;
vtkVolumeMapper
*
volumeMapper
=
gpu_volumeMapper
.
GetPointer
();
if
(
useFP
)
{
cerr
<<
"USE FP"
<<
endl
;
volumeMapper
=
cpu_volumeMapper
.
GetPointer
();
}
volumeMapper
->
SetInputConnection
(
wavelet
->
GetOutputPort
());
vtkNew
<
vtkVolumeProperty
>
volumeProperty
;
...
...
@@ -85,7 +99,7 @@ int TestGPURayCastMapperBenchmark(int argc, char* argv[])
volumeProperty
->
SetScalarOpacity
(
pwf
.
GetPointer
());
vtkNew
<
vtkVolume
>
volume
;
volume
->
SetMapper
(
volumeMapper
.
GetPointer
()
);
volume
->
SetMapper
(
volumeMapper
);
volume
->
SetProperty
(
volumeProperty
.
GetPointer
());
vtkNew
<
vtkRenderWindow
>
renderWindow
;
...
...
@@ -99,20 +113,24 @@ int TestGPURayCastMapperBenchmark(int argc, char* argv[])
// Attach OSPRay render pass
vtkNew
<
vtkOSPRayPass
>
osprayPass
;
if
(
useOSP
)
if
(
useOSP
&&
!
useFP
)
{
cerr
<<
"OSP PASS"
<<
endl
;
renderer
->
SetPass
(
osprayPass
.
GetPointer
());
}
vtkNew
<
vtkRenderWindowInteractor
>
iren
;
iren
->
SetRenderWindow
(
renderWindow
.
GetPointer
());
int
valid
=
volumeMapper
->
IsRenderSupported
(
renderWindow
.
GetPointer
(),
volumeProperty
.
GetPointer
());
int
valid
=
true
;
if
(
!
useFP
)
{
valid
=
gpu_volumeMapper
->
IsRenderSupported
(
renderWindow
.
GetPointer
(),
volumeProperty
.
GetPointer
());
}
int
retVal
;
if
(
valid
)
{
timer
->
StartTimer
();
renderWindow
->
Render
();
timer
->
StopTimer
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment