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

Normalize output MLS normals

parent aa2050bf
No related branches found
No related tags found
1 merge request!158Implements #228 adaptive MLS and smoothing channel
...@@ -247,11 +247,13 @@ static void run(ftl::Configurable *root) { ...@@ -247,11 +247,13 @@ static void run(ftl::Configurable *root) {
bool busy = false; bool busy = false;
// Create the source depth map filters // Create the source depth map pipeline
auto *prefilter = ftl::config::create<ftl::operators::Graph>(root, "pre_filters"); auto *prefilter = ftl::config::create<ftl::operators::Graph>(root, "pre_filters");
prefilter->append<ftl::operators::ColourChannels>("colour"); prefilter->append<ftl::operators::ColourChannels>("colour");
prefilter->append<ftl::operators::HFSmoother>("hfnoise"); prefilter->append<ftl::operators::HFSmoother>("hfnoise");
// Smooth normals
prefilter->append<ftl::operators::SimpleMLS>("mls"); prefilter->append<ftl::operators::SimpleMLS>("mls");
// Alignment
//auto *postfilter = ftl::config::create<ftl::Filters>(root, "post_filters"); //auto *postfilter = ftl::config::create<ftl::Filters>(root, "post_filters");
//postfilter->create<ftl::filters::DepthSmoother>("hfnoise"); //postfilter->create<ftl::filters::DepthSmoother>("hfnoise");
......
...@@ -68,7 +68,7 @@ using ftl::cuda::TextureObject; ...@@ -68,7 +68,7 @@ using ftl::cuda::TextureObject;
// depth_out(screen.x,screen.y) = X.z; // depth_out(screen.x,screen.y) = X.z;
//} //}
depth_out(x,y) = X.z; depth_out(x,y) = X.z;
normals_out(x,y) = make_float4(nX, 0.0f); normals_out(x,y) = make_float4(nX / length(nX), 0.0f);
} }
void ftl::cuda::mls_smooth( void ftl::cuda::mls_smooth(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment