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

[FEATURE] - Generate proper Normals and Tangents from the original mesh #4

Closed
DavidArayan opened this issue Jan 23, 2018 · 7 comments
Closed
Assignees

Comments

@DavidArayan
Copy link
Owner

A recent feature request to generate normals and tangents from the original mesh which is being sliced. From observation it seems the final cut meshes do not render properly, this is due to using Mesh.RegenerateNormals() which is too generic.

  • Look into using normals and tangents from the original mesh to ensure the cut mesh renders properly
  • Ensure the generated normals and tangents work properly with the generated cross section
@PotatoBo
Copy link

PotatoBo commented Feb 7, 2018

This would be very useful. Currently when you slice a mesh it loses all the vertex normal data which gives it a faceted look. It makes it pretty jarring when you slice a mesh with carefully crafted smooth groups and it becomes faceted.

@DavidArayan
Copy link
Owner Author

Greetings,

Latest changes to commit 1b5ff49 has added Normal and Tangent interpolation via Barycentric coordinates.

Slicing Meshes will now look at all UV, Normal and Tangent spaces for the Mesh. Please let me know if any bugs arise. I will close this feature.

@PotatoBo
Copy link

PotatoBo commented Feb 9, 2018

I found a small problem. If you try and cut the mesh and only a lower hull is generated due to the mesh being completely on the backside of the plane, it throws an out of range error due to SlicedSubmesh.hasUV trying to access upperHull[0].hasUV on an empty list. Other than that it seems to work very well!

@DavidArayan
Copy link
Owner Author

Greetings,

Thank you for the bug report. I've fixed the problem in commit a00983b. I really need to setup some more testing scripts to catch all these cases!

@PotatoBo
Copy link

I believe I've found another small problem. If you apply a material with a normal map to a cut face it goes completely black. I think the tangents on the cut face are not set.

@DavidArayan
Copy link
Owner Author

Thank you for letting me know, I'll take a look shortly.

@DavidArayan
Copy link
Owner Author

Greetings,

Thank you for your patience. This should be fixed as of commit 45c8363.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants