Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Project_Phoenix
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Project_Phoenix
Commits
ee57bbf9
Commit
ee57bbf9
authored
6 years ago
by
Viktor Lopatin
Browse files
Options
Downloads
Patches
Plain Diff
Performance measurements
parent
0f4e29ed
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
demos/pli_demo/src/pli_demo.cpp
+32
-52
32 additions, 52 deletions
demos/pli_demo/src/pli_demo.cpp
demos/pli_demo/src/pli_util.cpp
+2
-2
2 additions, 2 deletions
demos/pli_demo/src/pli_util.cpp
library/phx/core/engine.cpp
+2
-2
2 additions, 2 deletions
library/phx/core/engine.cpp
with
36 additions
and
56 deletions
demos/pli_demo/src/pli_demo.cpp
+
32
−
52
View file @
ee57bbf9
...
...
@@ -51,8 +51,8 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#endif
int
main
(
int
,
char
**
)
{
bool
use_vr
=
fals
e
;
int
main
_real
(
int
,
char
**
)
{
bool
use_vr
=
tru
e
;
auto
cut_plane_point
=
glm
::
vec3
(
1
,
0
,
1
);
auto
cut_plane_norm
=
glm
::
vec3
(
0
,
1
,
0
);
...
...
@@ -266,7 +266,7 @@ int main(int, char**) {
return
EXIT_SUCCESS
;
}
int
main
_bm
(
int
,
char
**
)
{
int
main
(
int
,
char
**
)
{
bool
use_vr
=
true
;
std
::
unique_ptr
<
phx
::
Engine
>
engine
=
...
...
@@ -366,8 +366,8 @@ int main_bm(int, char**) {
nlohmann
::
json
declaration
=
{
{
"from"
,
{{
"X"
,
0.0f
},
{
"Y"
,
0.0f
},
{
"Z"
,
0.0f
}}},
{
"to"
,
{{
"X"
,
50
0.0f
},
{
"Y"
,
500.0f
},
{
"Z"
,
1
50.0f
}}},
{
"stride"
,
{{
"X"
,
1
.0f
},
{
"Y"
,
1
.0f
},
{
"Z"
,
1
.0f
}}}};
{
"to"
,
{{
"X"
,
36
0.0f
},
{
"Y"
,
500.0f
},
{
"Z"
,
50.0f
}}},
{
"stride"
,
{{
"X"
,
3
.0f
},
{
"Y"
,
3
.0f
},
{
"Z"
,
3
.0f
}}}};
nlohmann
::
json
planes_dec
=
{};
...
...
@@ -387,40 +387,37 @@ int main_bm(int, char**) {
auto
pli_resource
=
phx
::
ResourceUtils
::
LoadResourceFromFile
<
phx
::
PLIRegion
>
(
R"(/data/MSA0309_s0536-0695.h5)"
,
declaration
);
auto
session
=
bm
::
run
<
float
,
std
::
milli
>
(
10
,
[
&
](
bm
::
session_recorder
<
float
,
std
::
milli
>&
recorder
)
{
phx
::
PliDemoUtil
::
load
(
scene
,
std
::
vector
<
std
::
pair
<
glm
::
vec3
,
glm
::
vec3
>>
());
for
(
int
i
=
1
;
i
<
11
;
i
++
)
{
declaration
=
{
{
"from"
,
{{
"X"
,
0.0f
},
{
"Y"
,
0.0f
},
{
"Z"
,
0.0f
}}},
{
"to"
,
{{
"X"
,
50.0f
*
i
},
{
"Y"
,
50.0f
*
i
},
{
"Z"
,
15.0f
*
i
}}},
{
"stride"
,
{{
"X"
,
1.0f
},
{
"Y"
,
1.0f
},
{
"Z"
,
1.0f
}}}};
auto
ray
=
phx
::
Ray
(
glm
::
vec3
(
0
,
300
,
-
50
),
glm
::
vec3
(
0
,
0
,
1
));
planes_dec
=
{}
;
entity
->
FindOrAddComponent
<
phx
::
Transform
>
()
;
planes_dec
.
push_back
({
{
"A"
,
0
},
{
"B"
,
-
1
},
{
"C"
,
0
},
{
"D"
,
-
(
1
*
0
+
(
40
*
i
)
*
(
-
1
)
+
1
*
0
)},
});
pli_handle
=
entity
->
GetFirstComponent
<
phx
::
PLIHandle
>
(
true
);
mesh_handle
=
entity
->
GetFirstComponent
<
phx
::
MeshHandle
>
(
true
);
planes_dec
.
push_back
({
{
"A"
,
0
},
{
"B"
,
1
},
{
"C"
,
0
},
{
"D"
,
-
(
1
*
0
+
(
10
*
i
)
*
(
1
)
+
1
*
0
)},
});
pli_handle
->
Activate
();
mesh_handle
->
Activate
();
declaration
[
"cuttingPlane"
]
=
planes_dec
;
pli_resource
=
phx
::
ResourceUtils
::
LoadResourceFromFile
<
phx
::
PLIRegion
>
(
R"(/data/MSA0309_s0536-0695.h5)"
,
declaration
);
std
::
cout
<<
"Load finished"
<<
std
::
endl
;
recorder
.
record
(
"load_"
+
std
::
to_string
((
50
*
50
*
15
*
i
*
i
*
i
)),
if
(
!
use_vr
)
{
raycast
->
SetRay
(
scene
->
GetEntitiesWithComponents
<
phx
::
RenderTarget
>
()[
0
]
->
GetFirstComponent
<
phx
::
Transform
>
());
raycast
->
SetTarget
(
pli_entity
);
raycast
->
SetMarker
(
marker_entity
);
}
auto
session
=
bm
::
run
<
float
,
std
::
milli
>
(
10
,
[
&
](
bm
::
session_recorder
<
float
,
std
::
milli
>&
recorder
)
{
for
(
int
i
=
1
;
i
<
11
;
i
++
)
{
recorder
.
record
(
"trace,"
+
std
::
to_string
(
30
*
i
)
+
"x"
+
std
::
to_string
(
40
*
i
)
+
"x50"
,
[
&
]()
{
phx
::
PliDemoUtil
::
load_surface_representation
(
entity
,
pli_resource
,
false
);
phx
::
PliDemoUtil
::
trace
(
scene
,
glm
::
vec3
(
100.0
,
100.0
,
0
),
glm
::
vec3
(
100
+
30
*
i
,
100
+
40
*
i
,
50
));
});
}
...
...
@@ -434,24 +431,7 @@ int main_bm(int, char**) {
std
::
cout
<<
record_name
<<
" m: "
<<
mean
<<
" v: "
<<
variance
<<
" std: "
<<
standard_deviation
<<
std
::
endl
;
}
session
.
to_csv
(
"loading_stride1_withplanes_sizes.csv"
,
true
);
entity
->
FindOrAddComponent
<
phx
::
Transform
>
();
pli_handle
=
entity
->
GetFirstComponent
<
phx
::
PLIHandle
>
(
true
);
mesh_handle
=
entity
->
GetFirstComponent
<
phx
::
MeshHandle
>
(
true
);
pli_handle
->
Activate
();
mesh_handle
->
Activate
();
std
::
cout
<<
"Load finished"
<<
std
::
endl
;
if
(
!
use_vr
)
{
raycast
->
SetRay
(
scene
->
GetEntitiesWithComponents
<
phx
::
RenderTarget
>
()[
0
]
->
GetFirstComponent
<
phx
::
Transform
>
());
raycast
->
SetTarget
(
pli_entity
);
raycast
->
SetMarker
(
marker_entity
);
}
session
.
to_csv
(
"trace_sizes.csv"
,
true
);
rendering_system
->
SetEnabled
(
true
);
splash
->
SetEnabled
(
false
);
...
...
This diff is collapsed.
Click to expand it.
demos/pli_demo/src/pli_util.cpp
+
2
−
2
View file @
ee57bbf9
...
...
@@ -123,8 +123,8 @@ void PliDemoUtil::load(
nlohmann
::
json
declaration
=
{
{
"from"
,
{{
"X"
,
0.0f
},
{
"Y"
,
0.0f
},
{
"Z"
,
0.0f
}}},
{
"to"
,
{{
"X"
,
50
0.0f
},
{
"Y"
,
500.0f
},
{
"Z"
,
1
50.0f
}}},
{
"stride"
,
{{
"X"
,
1
.0f
},
{
"Y"
,
1
.0f
},
{
"Z"
,
1
.0f
}}}};
{
"to"
,
{{
"X"
,
36
0.0f
},
{
"Y"
,
500.0f
},
{
"Z"
,
50.0f
}}},
{
"stride"
,
{{
"X"
,
3
.0f
},
{
"Y"
,
3
.0f
},
{
"Z"
,
3
.0f
}}}};
if
(
!
cutting_planes
.
empty
())
{
nlohmann
::
json
planes_dec
=
{};
...
...
This diff is collapsed.
Click to expand it.
library/phx/core/engine.cpp
+
2
−
2
View file @
ee57bbf9
...
...
@@ -76,8 +76,8 @@ void Engine::UpdateSystems() {
acc_time
+=
frame_time
;
// Send FPS to cout
if
(
frame_timer_
.
GetTimeInfo
().
frame_count
%
10
==
0
)
{
float
avg_time
=
acc_time
/
10.0f
;
if
(
frame_timer_
.
GetTimeInfo
().
frame_count
%
10
0
==
0
)
{
float
avg_time
=
acc_time
/
10
0
.0f
;
float
frame_rate
=
1000.0f
/
avg_time
;
std
::
cout
<<
"Framerate: "
<<
std
::
to_string
(
frame_rate
)
<<
std
::
endl
;
acc_time
=
0.0f
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment