Skip to content
Snippets Groups Projects

Implements #141 normals

Merged Nicolas Pope requested to merge feature/141/normals into master
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
@@ -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;
Loading