diff --git a/components/renderers/cpp/src/normals.cu b/components/renderers/cpp/src/normals.cu index 0a4c12ae897dcb8990c75a591ffa072d0464191b..ad6c34cf4cadcda6f46fa677f48502099ef1a013 100644 --- a/components/renderers/cpp/src/normals.cu +++ b/components/renderers/cpp/src/normals.cu @@ -20,14 +20,14 @@ __global__ void computeNormals_kernel(ftl::cuda::TextureObject<float4> output, const float3 MC = make_float3(input.tex2D((int)x+0, (int)y-1)); //[(y-1)*width+(x+0)]; const float3 CM = make_float3(input.tex2D((int)x-1, (int)y+0)); //[(y+0)*width+(x-1)]; - //if(CC.x != MINF && PC.x != MINF && CP.x != MINF && MC.x != MINF && CM.x != MINF) { + if(CC.x != MINF) { // && PC.x != MINF && CP.x != MINF && MC.x != MINF && CM.x != MINF) { const float3 n = cross(PC-MC, CP-CM); const float l = length(n); if(l > 0.0f) { output(x,y) = make_float4(n/-l, 1.0f); } - //} + } } } @@ -51,6 +51,7 @@ __global__ void smooth_normals_kernel(ftl::cuda::TextureObject<float4> norms, const float3 p = make_float3(points.tex2D((int)x+u,(int)y+v)); if (p.x == MINF) continue; const float s = ftl::cuda::spatialWeighting(p0, p, smoothing); + //const float s = 1.0f; if (s > 0.0f) { const float4 n = norms.tex2D((int)x+u,(int)y+v);