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

Fixes for point cloud render

parent 7ac4ca1e
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28376 passed
......@@ -184,7 +184,7 @@ void CUDARender::_dibr(ftl::rgbd::Frame &out, const Eigen::Matrix4d &t, cudaStre
auto &f = scene_->frames[i].cast<ftl::rgbd::Frame>();
//auto *s = scene_->sources[i];
if (f.has(Channel::Colour)) {
if (!f.has(Channel::Colour)) {
LOG(ERROR) << "Missing required channel";
continue;
}
......@@ -462,7 +462,7 @@ void CUDARender::_postprocessColours(ftl::rgbd::Frame &out) {
params_.camera,
stream_
);
} else if (out.hasChannel(_getDepthChannel()) && out.hasChannel(out_chan_)) {
} else if (mesh_ && out.hasChannel(_getDepthChannel()) && out.hasChannel(out_chan_)) {
ftl::cuda::fix_bad_colour(
out.getTexture<float>(_getDepthChannel()),
out.getTexture<uchar4>(out_chan_),
......
......@@ -239,7 +239,7 @@ __global__ void reprojection_kernel(
const float d = depth_in.tex2D((int)x, (int)y);
if (d > params.camera.minDepth && d < params.camera.maxDepth) {
//const float2 rpt = convertScreen<VPMODE>(params, x, y);
const float3 camPos = transform * params.camera.project<PROJECT>(make_float3(x, y, d));
const float3 camPos = transform * params.camera.unproject<PROJECT>(make_float3(x, y, d));
if (camPos.z > camera.minDepth && camPos.z < camera.maxDepth) {
const float3 screenPos = camera.project<Projection::PERSPECTIVE>(camPos);
......@@ -250,6 +250,7 @@ __global__ void reprojection_kernel(
// Boolean match (0 or 1 weight). 1.0 if depths are sufficiently close
float weight = depthMatching(params, camPos.z, d2);
if (params.m_flags & ftl::render::kUseWeightsChannel)
weight *= float(weights.tex2D(int(screenPos.x+0.5f), int(screenPos.y+0.5f))) / 32767.0f;
const B output = make<B>(input); // * weight; //weightInput(input, weight);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment