Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Maintenance on Tuesday 15.4. at 14:00. ETA 60 - 90 minutes.
Show more breadcrumbs
Nicolas Pope
ftl
Commits
6630c6e3
Commit
6630c6e3
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Tidy render code
parent
496349b4
No related branches found
No related tags found
No related merge requests found
Pipeline
#11764
passed
5 years ago
Stage: all
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/reconstruct/src/ray_cast_sdf.cu
+13
-15
13 additions, 15 deletions
applications/reconstruct/src/ray_cast_sdf.cu
with
13 additions
and
15 deletions
applications/reconstruct/src/ray_cast_sdf.cu
+
13
−
15
View file @
6630c6e3
...
...
@@ -232,9 +232,9 @@ __global__ void nickRenderKernel(ftl::voxhash::HashData hashData, RayCastData ra
// If any weight is 0, skip this voxel
// FIXME(Nick) Unloaded voxels result in random weight values here...
const
bool
missweight
=
voxels
[
ix
[
0
]].
weight
==
0
||
voxels
[
ix
[
1
]].
weight
==
0
||
voxels
[
ix
[
2
]].
weight
==
0
||
voxels
[
ix
[
3
]].
weight
==
0
||
voxels
[
ix
[
4
]].
weight
==
0
||
voxels
[
ix
[
5
]].
weight
==
0
||
voxels
[
ix
[
6
]].
weight
==
0
;
// || voxels[ix[7]].weight == 0;
//
const bool missweight = voxels[ix[0]].weight == 0 || voxels[ix[1]].weight == 0 || voxels[ix[2]].weight == 0 ||
//
voxels[ix[3]].weight == 0 || voxels[ix[4]].weight == 0 || voxels[ix[5]].weight == 0 ||
//
voxels[ix[6]].weight == 0; // || voxels[ix[7]].weight == 0;
//if (missweight) return;
if
(
voxels
[
j
].
weight
==
0
)
return
;
...
...
@@ -262,15 +262,17 @@ __global__ void nickRenderKernel(ftl::voxhash::HashData hashData, RayCastData ra
//return;*/
int
edgeX
=
(
vp
.
x
==
0
||
vp
.
x
==
7
)
?
1
:
0
;
int
edgeY
=
(
vp
.
y
==
0
||
vp
.
y
==
7
)
?
1
:
0
;
int
edgeZ
=
(
vp
.
z
==
0
||
vp
.
z
==
7
)
?
1
:
0
;
int
edgeX
=
(
vp
.
x
==
0
)
?
1
:
0
;
int
edgeY
=
(
vp
.
y
==
0
)
?
1
:
0
;
int
edgeZ
=
(
vp
.
z
==
0
)
?
1
:
0
;
bool
is_surface
=
((
params
.
m_flags
&
kShowBlockBorders
)
&&
edgeX
+
edgeY
+
edgeZ
>=
2
);
if
(
is_surface
)
voxels
[
j
].
color
=
make_uchar3
(
255
,
0
,
0
);
if
(
is_surface
)
voxels
[
j
].
color
=
make_uchar3
(
255
,
(
vp
.
x
==
0
&&
vp
.
y
==
0
&&
vp
.
z
==
0
)
?
255
:
0
,
0
);
if
(
!
is_surface
&&
voxels
[
j
].
sdf
<
0.0
f
)
return
;
//if (vp.z == 7) voxels[j].color = make_uchar3(0,255,(voxels[j].sdf < 0.0f) ? 255 : 0);
// Identify surfaces through sign change. Since we only check in one direction
// it is fine to check for any sign change?
#pragma unroll
...
...
@@ -282,7 +284,8 @@ __global__ void nickRenderKernel(ftl::voxhash::HashData hashData, RayCastData ra
// Skip these cases since we didn't load voxels properly
if
(
uvi
.
x
==
8
&&
uvi
.
y
==
8
&&
uvi
.
z
==
8
)
continue
;
//|| uvi.x == 8 && uvi.z == 8 || uvi.y == 8 && uvi.z == 8) continue;
if
(
voxels
[
plinVoxelPos
(
uvi
)].
sdf
<
0.0
f
)
{
const
auto
&
vox
=
voxels
[
plinVoxelPos
(
uvi
)];
if
(
vox
.
weight
>
0
&&
vox
.
sdf
<
0.0
f
)
{
is_surface
=
true
;
break
;
}
...
...
@@ -331,15 +334,10 @@ __global__ void nickRenderKernel(ftl::voxhash::HashData hashData, RayCastData ra
trilinearInterp(hashData, voxels, ix, pixelWorldPos, depth, col);*/
int
idepth
=
static_cast
<
int
>
(
camPos
.
z
*
100.0
f
);
// TODO (Nick) MAKE THIS ATOMIC!!!!
/*if (screenPos.x+x < params.m_width && screenPos.y+y < params.m_height &&
rayCastData.d_depth_i[(screenPos.y+y)*params.m_width+screenPos.x+x] > idepth) {
rayCastData.d_depth[(screenPos.y+y)*params.m_width+screenPos.x+x] = idepth;
rayCastData.d_colors[(screenPos.y+y)*params.m_width+screenPos.x+x] = voxels[j].color;
}*/
if
(
screenPos
.
x
+
x
<
params
.
m_width
&&
screenPos
.
y
+
y
<
params
.
m_height
)
{
int
index
=
(
screenPos
.
y
+
y
)
*
params
.
m_width
+
screenPos
.
x
+
x
;
// TODO(Nick) Merge colors at "same" depth based upon distance from voxel centre.
// The above may need to be done using shared memory
if
(
rayCastData
.
d_depth_i
[
index
]
>
idepth
&&
atomicMin
(
&
rayCastData
.
d_depth_i
[
index
],
idepth
)
!=
idepth
)
{
//rayCastData.d_depth[index] = idepth;
rayCastData
.
d_colors
[
index
]
=
voxels
[
j
].
color
;
...
...
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