Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
instant-ngp-tomography
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Pickles
instant-ngp-tomography
Commits
df85fe95
Commit
df85fe95
authored
2 years ago
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
Improve performance in large scene by ~10%
Makes more aggressive use of the occupancy bitfield when rendering
parent
33f1daab
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/testbed_nerf.cu
+12
-4
12 additions, 4 deletions
src/testbed_nerf.cu
with
12 additions
and
4 deletions
src/testbed_nerf.cu
+
12
−
4
View file @
df85fe95
...
...
@@ -376,8 +376,6 @@ __global__ void mark_untrained_density_grid(const uint32_t n_elements, float* _
uint32_t
y
=
tcnn
::
morton3D_invert
(
pos_idx
>>
1
);
uint32_t
z
=
tcnn
::
morton3D_invert
(
pos_idx
>>
2
);
Vector3f
pos
=
((
Vector3f
{(
float
)
x
+
0.5
f
,
(
float
)
y
+
0.5
f
,
(
float
)
z
+
0.5
f
})
/
NERF_GRIDSIZE
()
-
Vector3f
::
Constant
(
0.5
f
))
*
scalbnf
(
1.0
f
,
level
)
+
Vector3f
::
Constant
(
0.5
f
);
float
voxel_radius
=
0.5
f
*
SQRT3
()
*
scalbnf
(
1.0
f
,
level
)
/
NERF_GRIDSIZE
();
int
count
=
0
;
...
...
@@ -643,7 +641,12 @@ __global__ void advance_pos_nerf(
}
dt
=
calc_dt
(
t
,
cone_angle
);
uint32_t
mip
=
max
(
min_mip
,
mip_from_dt
(
dt
,
pos
));
// Use the mip level from the position rather than dt. Unlike training,
// for rendering there's no need to use coarser mip levels when the step
// size is large (rather, it reduces performance, because the network may be queried)
// more frequently than necessary.
uint32_t
mip
=
max
(
min_mip
,
mip_from_pos
(
pos
));
if
(
!
density_grid
||
density_grid_occupied_at
(
pos
,
density_grid
,
mip
))
{
break
;
...
...
@@ -736,7 +739,12 @@ __global__ void generate_next_nerf_network_inputs(
}
dt
=
calc_dt
(
t
,
cone_angle
);
uint32_t
mip
=
max
(
min_mip
,
mip_from_dt
(
dt
,
pos
));
// Use the mip level from the position rather than dt. Unlike training,
// for rendering there's no need to use coarser mip levels when the step
// size is large (rather, it reduces performance, because the network may be queried)
// more frequently than necessary.
uint32_t
mip
=
max
(
min_mip
,
mip_from_pos
(
pos
));
if
(
!
density_grid
||
density_grid_occupied_at
(
pos
,
density_grid
,
mip
))
{
break
;
...
...
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