diff --git a/components/renderers/cpp/src/normals.cu b/components/renderers/cpp/src/normals.cu index 1a55322190bc418b83c136581774f4fd0c65f920..2b41c69527e8b5438589b03102f8b95d3512a546 100644 --- a/components/renderers/cpp/src/normals.cu +++ b/components/renderers/cpp/src/normals.cu @@ -54,9 +54,11 @@ __global__ void vis_normals_kernel(ftl::cuda::TextureObject<float4> norm, if(x >= norm.width() || y >= norm.height()) return; - float3 ray = pose * camera.screenToCam(x,y,1.0f); + output(x,y) = 0.0f; + float3 ray = make_float3(0.0f, 0.0f, 1.0f); //pose * camera.screenToCam(x,y,1.0f); ray = ray / length(ray); float3 n = make_float3(norm.tex2D((int)x,(int)y)); + if (n.x == MINF) return; n /= length(n); output(x,y) = fabs(dot(ray, n))*7.0f;