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

Fix for not clearing colour buffer

parent b299908c
No related branches found
No related tags found
1 merge request!119Implements #182 splatting
......@@ -126,6 +126,7 @@ void Splatter::renderChannel(
);
temp_.get<GpuMat>(Channel::Colour).setTo(cv::Scalar(0.0f,0.0f,0.0f,0.0f), cvstream);
temp_.get<GpuMat>(Channel::Colour2).setTo(cv::Scalar(0,0,0,0), cvstream);
temp_.get<GpuMat>(Channel::Contribution).setTo(cv::Scalar(0.0f), cvstream);
// Create colours first
......@@ -157,7 +158,7 @@ void Splatter::renderChannel(
stream
);
out.get<GpuMat>(Channel::Left).setTo(cv::Scalar(0,0,0,0), cvstream);
//out.get<GpuMat>(Channel::Left).setTo(cv::Scalar(0,0,0,0), cvstream);
// Now splat the points
ftl:cuda::splat(
......
......@@ -299,7 +299,7 @@ __global__ void dibr_attribute_contrib_kernel(
const float3 nearest = params.camera.screenToCam((int)(screenPos.x+u),(int)(screenPos.y+v),d);
// What is contribution of our current point at this pixel?
const float weight = ftl::cuda::spatialWeighting(nearest, camPos, 4.0f*(nearest.z/params.camera.fx));
const float weight = ftl::cuda::spatialWeighting(nearest, camPos, 1.0f*(nearest.z/params.camera.fx));
if (screenPos.x+u < colour_out.width() && screenPos.y+v < colour_out.height() && weight > 0.0f) { // TODO: Use confidence threshold here
const float4 wcolour = colour * weight;
//const float4 wnormal = normal * weight;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment