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

Fix attrib selection accuracy

parent 4b3bbeec
No related branches found
No related tags found
1 merge request!119Implements #182 splatting
......@@ -268,15 +268,14 @@ __global__ void dibr_attribute_contrib_kernel(
if (screenPos.x >= depth_in.width() || screenPos.y >= depth_in.height()) return;
// Is this point near the actual surface and therefore a contributor?
const float d = ((float)depth_in.tex2D((int)screenPos.x, (int)screenPos.y)/1000.0f);
const int d = depth_in.tex2D((int)screenPos.x, (int)screenPos.y);
const T input = generateInput(in.tex2D(x, y), params, worldPos);
const float3 nearest = params.camera.screenToCam((int)(screenPos.x),(int)(screenPos.y),d);
//const float3 nearest = params.camera.screenToCam((int)(screenPos.x),(int)(screenPos.y),d);
// What is contribution of our current point at this pixel?
const float l = length(nearest - camPos); //ftl::cuda::spatialWeighting(nearest, camPos, 0.002f);
if (screenPos.x < out.width() && screenPos.y < out.height() && l <= 0.002f) {
//const float l = length(nearest - camPos);
if (d == (int)(camPos.z*1000.0f)) {
out(screenPos.x, screenPos.y) = input;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment