Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

EDIT After Victor T.'s suggestion (ignore seams):

enter image description here

I'm using elastic surface nets to convert a 3D voxels into a nice smooth mesh. The mesh part, is great, however, I can't seem to find a decent looking method of getting proper vertex normals for each voxel. I've been reading a couple of forums, like this one from reddit and this one from Stack OverflowStack Overflow. Using the method described in the stack overflow one, I got normals that looked like this:

(Shaded) enter image description here

(Scaled Normals) enter image description here

While this might seem okay, it doesn't work very well with flat surfaces, and if I try to add methods for dealing with flat surfaces, it messes everything else up. And yet it still doesn't look ideal.

Using cross products of the vertices to get the normal, I was only able to get a hard shaded mesh, that did look decent, however, it can't distinguish up and down, so it doesn't look right in overhangs. It also is hardshaded, and I want smooth shading.

enter image description here

Question : What are ways I can achieve a better looking normal? What techniques are common for this? Is there any way modified methods I can use that are better than the ones I am doing? I am okay if the best looking method is expensive.

I can post source code if needed.

Thanks

UPDATE

After Victor T.'s suggestion, I managed to get great looking surface normals! One problem, the corners don't look right, I was unable to find any correlation between why is the normals on the corners need to be flipped (0 - normal).

Here is a picture : enter image description here

EDIT 2: Managed to particially solve the problem, however, when the vertice is on a 45 degree angle on all axises, it seems to mess up and needs to be flipped:enter image description here

EDIT After Victor T.'s suggestion (ignore seams):

enter image description here

I'm using elastic surface nets to convert a 3D voxels into a nice smooth mesh. The mesh part, is great, however, I can't seem to find a decent looking method of getting proper vertex normals for each voxel. I've been reading a couple of forums, like this one from reddit and this one from Stack Overflow. Using the method described in the stack overflow one, I got normals that looked like this:

(Shaded) enter image description here

(Scaled Normals) enter image description here

While this might seem okay, it doesn't work very well with flat surfaces, and if I try to add methods for dealing with flat surfaces, it messes everything else up. And yet it still doesn't look ideal.

Using cross products of the vertices to get the normal, I was only able to get a hard shaded mesh, that did look decent, however, it can't distinguish up and down, so it doesn't look right in overhangs. It also is hardshaded, and I want smooth shading.

enter image description here

Question : What are ways I can achieve a better looking normal? What techniques are common for this? Is there any way modified methods I can use that are better than the ones I am doing? I am okay if the best looking method is expensive.

I can post source code if needed.

Thanks

UPDATE

After Victor T.'s suggestion, I managed to get great looking surface normals! One problem, the corners don't look right, I was unable to find any correlation between why is the normals on the corners need to be flipped (0 - normal).

Here is a picture : enter image description here

EDIT 2: Managed to particially solve the problem, however, when the vertice is on a 45 degree angle on all axises, it seems to mess up and needs to be flipped:enter image description here

EDIT After Victor T.'s suggestion (ignore seams):

enter image description here

I'm using elastic surface nets to convert a 3D voxels into a nice smooth mesh. The mesh part, is great, however, I can't seem to find a decent looking method of getting proper vertex normals for each voxel. I've been reading a couple of forums, like this one from reddit and this one from Stack Overflow. Using the method described in the stack overflow one, I got normals that looked like this:

(Shaded) enter image description here

(Scaled Normals) enter image description here

While this might seem okay, it doesn't work very well with flat surfaces, and if I try to add methods for dealing with flat surfaces, it messes everything else up. And yet it still doesn't look ideal.

Using cross products of the vertices to get the normal, I was only able to get a hard shaded mesh, that did look decent, however, it can't distinguish up and down, so it doesn't look right in overhangs. It also is hardshaded, and I want smooth shading.

enter image description here

Question : What are ways I can achieve a better looking normal? What techniques are common for this? Is there any way modified methods I can use that are better than the ones I am doing? I am okay if the best looking method is expensive.

I can post source code if needed.

Thanks

UPDATE

After Victor T.'s suggestion, I managed to get great looking surface normals! One problem, the corners don't look right, I was unable to find any correlation between why is the normals on the corners need to be flipped (0 - normal).

Here is a picture : enter image description here

EDIT 2: Managed to particially solve the problem, however, when the vertice is on a 45 degree angle on all axises, it seems to mess up and needs to be flipped:enter image description here

added 146 characters in body
Source Link
J4S
  • 173
  • 1
  • 2
  • 16

EDIT After Victor T.'s suggestion (ignore seams):

enter image description here

I'm using elastic surface nets to convert a 3D voxels into a nice smooth mesh. The mesh part, is great, however, I can't seem to find a decent looking method of getting proper vertex normals for each voxel. I've been reading a couple of forums, like this one from reddit and this one from Stack Overflow. Using the method described in the stack overflow one, I got normals that looked like this:

(Shaded) enter image description here

(Scaled Normals) enter image description here

While this might seem okay, it doesn't work very well with flat surfaces, and if I try to add methods for dealing with flat surfaces, it messes everything else up. And yet it still doesn't look ideal.

Using cross products of the vertices to get the normal, I was only able to get a hard shaded mesh, that did look decent, however, it can't distinguish up and down, so it doesn't look right in overhangs. It also is hardshaded, and I want smooth shading.

enter image description here

Question : What are ways I can achieve a better looking normal? What techniques are common for this? Is there any way modified methods I can use that are better than the ones I am doing? I am okay if the best looking method is expensive.

I can post source code if needed.

Thanks

UPDATE

After Victor T.'s suggestion, I managed to get great looking surface normals! One problem, the corners don't look right, I was unable to find any correlation between why is the normals on the corners need to be flipped (0 - normal).

Here is a picture : enter image description here

EDIT 2: Managed to particially solve the problem, however, when the vertice is on a 45 degree angle on all axises, it seems to mess up and needs to be flipped:enter image description here

I'm using elastic surface nets to convert a 3D voxels into a nice smooth mesh. The mesh part, is great, however, I can't seem to find a decent looking method of getting proper vertex normals for each voxel. I've been reading a couple of forums, like this one from reddit and this one from Stack Overflow. Using the method described in the stack overflow one, I got normals that looked like this:

(Shaded) enter image description here

(Scaled Normals) enter image description here

While this might seem okay, it doesn't work very well with flat surfaces, and if I try to add methods for dealing with flat surfaces, it messes everything else up. And yet it still doesn't look ideal.

Using cross products of the vertices to get the normal, I was only able to get a hard shaded mesh, that did look decent, however, it can't distinguish up and down, so it doesn't look right in overhangs. It also is hardshaded, and I want smooth shading.

enter image description here

Question : What are ways I can achieve a better looking normal? What techniques are common for this? Is there any way modified methods I can use that are better than the ones I am doing? I am okay if the best looking method is expensive.

I can post source code if needed.

Thanks

UPDATE

After Victor T.'s suggestion, I managed to get great looking surface normals! One problem, the corners don't look right, I was unable to find any correlation between why is the normals on the corners need to be flipped (0 - normal).

Here is a picture : enter image description here

EDIT 2: Managed to particially solve the problem, however, when the vertice is on a 45 degree angle on all axises, it seems to mess up and needs to be flipped:enter image description here

EDIT After Victor T.'s suggestion (ignore seams):

enter image description here

I'm using elastic surface nets to convert a 3D voxels into a nice smooth mesh. The mesh part, is great, however, I can't seem to find a decent looking method of getting proper vertex normals for each voxel. I've been reading a couple of forums, like this one from reddit and this one from Stack Overflow. Using the method described in the stack overflow one, I got normals that looked like this:

(Shaded) enter image description here

(Scaled Normals) enter image description here

While this might seem okay, it doesn't work very well with flat surfaces, and if I try to add methods for dealing with flat surfaces, it messes everything else up. And yet it still doesn't look ideal.

Using cross products of the vertices to get the normal, I was only able to get a hard shaded mesh, that did look decent, however, it can't distinguish up and down, so it doesn't look right in overhangs. It also is hardshaded, and I want smooth shading.

enter image description here

Question : What are ways I can achieve a better looking normal? What techniques are common for this? Is there any way modified methods I can use that are better than the ones I am doing? I am okay if the best looking method is expensive.

I can post source code if needed.

Thanks

UPDATE

After Victor T.'s suggestion, I managed to get great looking surface normals! One problem, the corners don't look right, I was unable to find any correlation between why is the normals on the corners need to be flipped (0 - normal).

Here is a picture : enter image description here

EDIT 2: Managed to particially solve the problem, however, when the vertice is on a 45 degree angle on all axises, it seems to mess up and needs to be flipped:enter image description here

added 249 characters in body
Source Link
J4S
  • 173
  • 1
  • 2
  • 16

I'm using elastic surface nets to convert a 3D voxels into a nice smooth mesh. The mesh part, is great, however, I can't seem to find a decent looking method of getting proper vertex normals for each voxel. I've been reading a couple of forums, like this one from reddit and this one from Stack Overflow. Using the method described in the stack overflow one, I got normals that looked like this:

(Shaded) enter image description here

(Scaled Normals) enter image description here

While this might seem okay, it doesn't work very well with flat surfaces, and if I try to add methods for dealing with flat surfaces, it messes everything else up. And yet it still doesn't look ideal.

Using cross products of the vertices to get the normal, I was only able to get a hard shaded mesh, that did look decent, however, it can't distinguish up and down, so it doesn't look right in overhangs. It also is hardshaded, and I want smooth shading.

enter image description here

Question : What are ways I can achieve a better looking normal? What techniques are common for this? Is there any way modified methods I can use that are better than the ones I am doing? I am okay if the best looking method is expensive.

I can post source code if needed.

Thanks

UPDATE

After Victor T.'s suggestion, I managed to get great looking surface normals! One problem, the corners don't look right, I was unable to find any correlation between why is the normals on the corners need to be flipped (0 - normal).

Here is a picture : enter image description here

EDIT 2: Managed to particially solve the problem, however, when the vertice is on a 45 degree angle on all axises, it seems to mess up and needs to be flipped:enter image description here

I'm using elastic surface nets to convert a 3D voxels into a nice smooth mesh. The mesh part, is great, however, I can't seem to find a decent looking method of getting proper vertex normals for each voxel. I've been reading a couple of forums, like this one from reddit and this one from Stack Overflow. Using the method described in the stack overflow one, I got normals that looked like this:

(Shaded) enter image description here

(Scaled Normals) enter image description here

While this might seem okay, it doesn't work very well with flat surfaces, and if I try to add methods for dealing with flat surfaces, it messes everything else up. And yet it still doesn't look ideal.

Using cross products of the vertices to get the normal, I was only able to get a hard shaded mesh, that did look decent, however, it can't distinguish up and down, so it doesn't look right in overhangs. It also is hardshaded, and I want smooth shading.

enter image description here

Question : What are ways I can achieve a better looking normal? What techniques are common for this? Is there any way modified methods I can use that are better than the ones I am doing? I am okay if the best looking method is expensive.

I can post source code if needed.

Thanks

UPDATE

After Victor T.'s suggestion, I managed to get great looking surface normals! One problem, the corners don't look right, I was unable to find any correlation between why is the normals on the corners need to be flipped (0 - normal).

Here is a picture : enter image description here

I'm using elastic surface nets to convert a 3D voxels into a nice smooth mesh. The mesh part, is great, however, I can't seem to find a decent looking method of getting proper vertex normals for each voxel. I've been reading a couple of forums, like this one from reddit and this one from Stack Overflow. Using the method described in the stack overflow one, I got normals that looked like this:

(Shaded) enter image description here

(Scaled Normals) enter image description here

While this might seem okay, it doesn't work very well with flat surfaces, and if I try to add methods for dealing with flat surfaces, it messes everything else up. And yet it still doesn't look ideal.

Using cross products of the vertices to get the normal, I was only able to get a hard shaded mesh, that did look decent, however, it can't distinguish up and down, so it doesn't look right in overhangs. It also is hardshaded, and I want smooth shading.

enter image description here

Question : What are ways I can achieve a better looking normal? What techniques are common for this? Is there any way modified methods I can use that are better than the ones I am doing? I am okay if the best looking method is expensive.

I can post source code if needed.

Thanks

UPDATE

After Victor T.'s suggestion, I managed to get great looking surface normals! One problem, the corners don't look right, I was unable to find any correlation between why is the normals on the corners need to be flipped (0 - normal).

Here is a picture : enter image description here

EDIT 2: Managed to particially solve the problem, however, when the vertice is on a 45 degree angle on all axises, it seems to mess up and needs to be flipped:enter image description here

updated
Source Link
J4S
  • 173
  • 1
  • 2
  • 16
Loading
added 16 characters in body
Source Link
J4S
  • 173
  • 1
  • 2
  • 16
Loading
Source Link
J4S
  • 173
  • 1
  • 2
  • 16
Loading