From 656762d3e90de70473103308cec9f4947526b276 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Wed, 11 Dec 2019 13:45:45 +0200
Subject: [PATCH] Simple depth test in reproject

---
 components/renderers/cpp/src/reprojection.cu | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/components/renderers/cpp/src/reprojection.cu b/components/renderers/cpp/src/reprojection.cu
index a4b27d475..9c414f892 100644
--- a/components/renderers/cpp/src/reprojection.cu
+++ b/components/renderers/cpp/src/reprojection.cu
@@ -97,7 +97,8 @@ __global__ void reprojection_kernel(
 	const auto input = in.tex2D(screenPos.x, screenPos.y); //generateInput(in.tex2D((int)screenPos.x, (int)screenPos.y), params, worldPos);
 
 	// TODO: Z checks need to interpolate between neighbors if large triangles are used
-	float weight = ftl::cuda::weighting(fabs(camPos.z - d2), params.depthThreshold);
+	//float weight = ftl::cuda::weighting(fabs(camPos.z - d2), params.depthThreshold);
+	float weight = (fabs(camPos.z - d2) <= params.depthThreshold) ? 1.0f : 0.0f;
 
 	/* Buehler C. et al. 2001. Unstructured Lumigraph Rendering. */
 	/* Orts-Escolano S. et al. 2016. Holoportation: Virtual 3D teleportation in real-time. */
-- 
GitLab