diff --git a/components/renderers/cpp/src/CUDARender.cpp b/components/renderers/cpp/src/CUDARender.cpp index d4f7cb4515ed9514e3f2e0b8abaf683b0c9f53e7..c573d23b1fdcf0f035be865883213b8c842f9a27 100644 --- a/components/renderers/cpp/src/CUDARender.cpp +++ b/components/renderers/cpp/src/CUDARender.cpp @@ -407,22 +407,31 @@ void CUDARender::_mesh(ftl::rgbd::Frame &out, const Eigen::Matrix4d &t, cudaStre value("normal_radius", 1), value("normal_smoothing", 0.02f), params_.camera, pose_.getFloat3x3(), poseInverse_.getFloat3x3(), stream_);*/ - ftl::cuda::normals( - //temp_.createTexture<half4>(Channel::Normals), - out.createTexture<half4>(_getNormalsChannel()), - out.getTexture<float>(_getDepthChannel()), - params_.camera, stream_); + float mls_smoothing = value("mls_smooth", 0.01f); + int mls_radius = value("mls_radius", 0); - /*ftl::cuda::mls_smooth( - temp_.createTexture<half4>(Channel::Normals), - out.createTexture<half4>(_getNormalsChannel()), - out.getTexture<float>(_getDepthChannel()), - //out.getTexture<float>(_getDepthChannel()), - value("mls_smooth", 0.01f), - value("mls_radius", 2), - params_.camera, - stream_ - );*/ + if (mls_radius == 0) { + ftl::cuda::normals( + out.createTexture<half4>(_getNormalsChannel()), + out.getTexture<float>(_getDepthChannel()), + params_.camera, stream_); + } else { + ftl::cuda::normals( + temp_.createTexture<half4>(Channel::Normals), + out.getTexture<float>(_getDepthChannel()), + params_.camera, stream_); + + ftl::cuda::mls_smooth( + temp_.createTexture<half4>(Channel::Normals), + out.createTexture<half4>(_getNormalsChannel()), + out.getTexture<float>(_getDepthChannel()), + //out.getTexture<float>(_getDepthChannel()), + value("mls_smooth", 0.01f), + value("mls_radius", 2), + params_.camera, + stream_ + ); + } ftl::cuda::transform_normals( out.createTexture<half4>(_getNormalsChannel()),