Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small fix for latest #2

Closed
seichter opened this issue Apr 2, 2012 · 1 comment
Closed

small fix for latest #2

seichter opened this issue Apr 2, 2012 · 1 comment

Comments

@seichter
Copy link
Contributor

seichter commented Apr 2, 2012

diff --git a/kfusion.cu b/kfusion.cu
index 8741b1b..f7cf22f 100644
--- a/kfusion.cu
+++ b/kfusion.cu
@@ -84,9 +84,9 @@ __global__ void vertex2normal( Image<float3> normal, const Image<float3> vertex
     if(pixel.x >= vertex.size.x || pixel.y >= vertex.size.y )
         return;

-    const float3 left = vertex[make_uint2(max(pixel.x-1,0), pixel.y)];
+    const float3 left = vertex[make_uint2(max(int(pixel.x)-1,0), pixel.y)];
     const float3 right = vertex[make_uint2(min(pixel.x+1,vertex.size.x-1), pixel.y)];
-    const float3 up = vertex[make_uint2(pixel.x, max(pixel.y-1,0))];
+    const float3 up = vertex[make_uint2(pixel.x, max(int(pixel.y)-1,0))];
     const float3 down = vertex[make_uint2(pixel.x, min(pixel.y+1,vertex.size.y-1))];

     if(left.z == 0 || right.z == 0 || up.z == 0 || down.z == 0) {
@GerhardR
Copy link
Owner

GerhardR commented Apr 2, 2012

resolved in "fix for overflow"

@GerhardR GerhardR closed this as completed Apr 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants