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

Fix normal ray direction

parent 4a68c40a
No related branches found
No related tags found
1 merge request!115Implements #141 normals
Pipeline #14739 failed
...@@ -54,9 +54,11 @@ __global__ void vis_normals_kernel(ftl::cuda::TextureObject<float4> norm, ...@@ -54,9 +54,11 @@ __global__ void vis_normals_kernel(ftl::cuda::TextureObject<float4> norm,
if(x >= norm.width() || y >= norm.height()) return; 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); ray = ray / length(ray);
float3 n = make_float3(norm.tex2D((int)x,(int)y)); float3 n = make_float3(norm.tex2D((int)x,(int)y));
if (n.x == MINF) return;
n /= length(n); n /= length(n);
output(x,y) = fabs(dot(ray, n))*7.0f; output(x,y) = fabs(dot(ray, n))*7.0f;
......
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