diff --git a/components/renderers/cpp/src/normals.cu b/components/renderers/cpp/src/normals.cu index 040f761b0f42b92ceacfeeca63be843e55e39ac3..6ea8f7e1c71ce6e2a6d1a4b75b5c5efd8b481792 100644 --- a/components/renderers/cpp/src/normals.cu +++ b/components/renderers/cpp/src/normals.cu @@ -96,7 +96,7 @@ __global__ void vis_normals_kernel(ftl::cuda::TextureObject<float4> norm, if(x >= norm.width() || y >= norm.height()) return; output(x,y) = 0.0f; - float3 ray = make_float3(0.0f, 0.0f, 1.0f); //pose * camera.screenToCam(x,y,1.0f); + float3 ray = pose.getFloat3x3() * camera.screenToCam(x,y,1.0f); ray = ray / length(ray); float3 n = make_float3(norm.tex2D((int)x,(int)y)); float l = length(n); diff --git a/components/renderers/cpp/src/splat_render.cpp b/components/renderers/cpp/src/splat_render.cpp index ceaff532557ee274ebf5ec6390f7110d07a1b961..2d93a6055f191a4293a81b3a70309b0275ff8e1b 100644 --- a/components/renderers/cpp/src/splat_render.cpp +++ b/components/renderers/cpp/src/splat_render.cpp @@ -282,7 +282,7 @@ bool Splatter::render(ftl::rgbd::VirtualSource *src, ftl::rgbd::Frame &out, cuda renderChannel(params, out, Channel::Normals, stream); // Convert normal to single float value - ftl::cuda::normal_visualise(out.getTexture<float4>(Channel::Normals), temp_.getTexture<float>(Channel::Contribution), camera, params.m_viewMatrix, stream); + ftl::cuda::normal_visualise(out.getTexture<float4>(Channel::Normals), temp_.getTexture<float>(Channel::Contribution), camera, params.m_viewMatrixInverse, stream); // Put in output as single float cv::cuda::swap(temp_.get<GpuMat>(Channel::Contribution), out.create<GpuMat>(Channel::Normals));