Skip to content
Snippets Groups Projects
Commit b35a7e8b authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Use radius discon

parent 7918f995
No related branches found
No related tags found
1 merge request!165Implements #224 to use discontinuity mask
Pipeline #16321 passed
...@@ -29,19 +29,19 @@ __global__ void discontinuity_kernel(ftl::cuda::TextureObject<int> mask_out, ftl ...@@ -29,19 +29,19 @@ __global__ void discontinuity_kernel(ftl::cuda::TextureObject<int> mask_out, ftl
const uchar4 sup = support.tex2D((int)x, (int)y); const uchar4 sup = support.tex2D((int)x, (int)y);
if (sup.x <= RADIUS) { if (sup.x <= RADIUS) {
float dS = depth.tex2D((int)x - sup.x - 1, (int)y); float dS = depth.tex2D((int)x - sup.x - RADIUS, (int)y);
if (fabs(dS - d) > threshold) mask.isDiscontinuity(true); if (fabs(dS - d) > threshold) mask.isDiscontinuity(true);
} }
if (sup.y <= RADIUS) { if (sup.y <= RADIUS) {
float dS = depth.tex2D((int)x + sup.y + 1, (int)y); float dS = depth.tex2D((int)x + sup.y + RADIUS, (int)y);
if (fabs(dS - d) > threshold) mask.isDiscontinuity(true); if (fabs(dS - d) > threshold) mask.isDiscontinuity(true);
} }
if (sup.z <= RADIUS) { if (sup.z <= RADIUS) {
float dS = depth.tex2D((int)x, (int)y - sup.z - 1); float dS = depth.tex2D((int)x, (int)y - sup.z - RADIUS);
if (fabs(dS - d) > threshold) mask.isDiscontinuity(true); if (fabs(dS - d) > threshold) mask.isDiscontinuity(true);
} }
if (sup.w <= RADIUS) { if (sup.w <= RADIUS) {
float dS = depth.tex2D((int)x, (int)y + sup.w + 1); float dS = depth.tex2D((int)x, (int)y + sup.w + RADIUS);
if (fabs(dS - d) > threshold) mask.isDiscontinuity(true); if (fabs(dS - d) > threshold) mask.isDiscontinuity(true);
} }
} }
......
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