Home Technical Talk

Re-exporting mesh gives shading issues (n-gon to tris)

3D4Eva
polycounter lvl 4
Offline / Send Message
3D4Eva polycounter lvl 4
I have a CAD mesh that I exported from MOI3D, and when I bring it into Marmoset it seems to have no shading problems which is nice. My problem is when I import that mesh and re-export it out I'll get certain issues that wasn't present before.



The left is my re-exported version and the right is what directly came out of MOI3D. I used marmoset toolbag for this test. Both versions are only tris. These are from long thin tris, but I thought you wouldn't get issues on flat surfaces.

I also don't know re-exporting is giving me a different result. This is a concern because if someone reexports the mesh there will be shading problems.

Here are my two files, the MOI3D one and the reexported one.

https://www.dropbox.com/s/ck8ev7uqpz4f7dq/MOI3D.obj?dl=0
https://www.dropbox.com/s/vrwp5ktlarrbyhk/Reexport.obj?dl=0

I also tried to export the n-gon version and convert to tris then export it out then into marmoset, which has issues. I couldn't resolve it using any weighted normals or anything.



I'm a bit confused because I was always told you can use ngons on flat surfaces, but make them tris first and everything will work out perfect. 

Is there some custom normal data I'm not aware of in the MOI3D version? I cannot see any difference when I reviewed the OBJ files. :anguished:

I did notice that the OBJ for MOI3D has smoothing groups, but not the re-exported one. I did a test in Blender quickly, but not Maya yet. When I do export with smoothing groups it still gives the same issue sadly, and the exported one has different s # values.

https://www.dropbox.com/s/5tzyjt1147ymb26/rexportsmoothg.obj?dl=0

I'll do my Maya check now and edit this post.

Maya seems fine https://www.dropbox.com/s/gxj3212en0ereqa/mayaexport.obj?dl=0

I'm worried that this mesh could give off mixed results depending on where it goes. Or is there something with the normals I need to correct?

Toolbag 4 and Viewer files

https://www.dropbox.com/s/c0q9wib6o0tsola/ToolbagScene.tbscene?dl=0 (Toolbag 4)
https://www.dropbox.com/s/joih9fcnkxec6z9/Viewer.mview?dl=0

Replies

  • Ghogiel
    Offline / Send Message
    Ghogiel greentooth
    I got the same shading on all of those in both Max and marmoset3. I can't see what the issue is :s .
  • 3D4Eva
    Offline / Send Message
    3D4Eva polycounter lvl 4
    Ghogiel said:
    I got the same shading on all of those in both Max and marmoset3. I can't see what the issue is :s .
    Here is the Toolbag file and the Viewer. The problem shows on any file other than the MOI3D one.



    https://www.dropbox.com/s/c0q9wib6o0tsola/ToolbagScene.tbscene?dl=0 (Toolbag 4)
    https://www.dropbox.com/s/joih9fcnkxec6z9/Viewer.mview?dl=0


    If I remove custom split normals data it will show like this



    Then if I average the normals



    Something has to be causing the normals to get messed up on export. The problem is I cannot be sure someone wont take my MOI3D export and re-export it then they will have these problems as well.
  • Ghogiel
    Offline / Send Message
    Ghogiel greentooth
    Ah I see the difference now. I can't replicate the issue, using the moi exported one and taking it into and out of it from max it was fine


    I'm guessing you are modifying the normals in some way with import or export settings, or having unlocked normals or maybe allowing Maya to use it's custom normal settings which is on by default, which would bork normals.
  • 3D4Eva
    Offline / Send Message
    3D4Eva polycounter lvl 4
    Ghogiel said:
    Ah I see the difference now. I can't replicate the issue, using the moi exported one and taking it into and out of it from max it was


    I'm guessing you are modifying the normals in some way with import or export settings, or having unlocked normals or maybe allowing Maya to use it's custom normal settings which is on by default, which would bork normals.
    Sadly I re-imported the MOI3D into another real-time engine and I  get the problem on other spots. So it seems it has to do with importing causing something to change, then when I export it retains that issue.

    I tried using Eevee to just check the MOI3D on import



    If I clear custom split normals



    It fixes that part, but then introduces new problems.

    But if I was polymodel this same piece would I also  get those errors due to the tris on the flat surface? Is there something I'm missing? I don't recall having any issues with ngons on a flat surface once converted to tris before.

    This is really confusing. I even did a few tests with a rectangle and cuts on a flat surface and even converting to tris has these long thin tris, but no shading issues. If I slightly change the shape to make the surface not flat it introduces such problems, but I think the above is an issue related to mesh normals, but I cannot track it.
  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    It looks like some of the tris have zero surface area or are overlapping (because of the automatic triangulation) 

    This causes visible edges like you have - because you have two edges right next to each other. Or even overlapping. This is not uncommon with N-gons - which is why people say to avoid them. 

    You need to edit the mesh to get rid of the long, thin, and closely spaced, triangles. 

    Obviously you can see where the bad triangulation is but you can also use the cleanup tool in Maya to check for this. (Mesh>Cleanup)



    this is an exaggerated example of what I think you'll see if you zoom in on the closely spaced edges

  • 3D4Eva
    Offline / Send Message
    3D4Eva polycounter lvl 4
    It looks like some of the tris have zero surface area or are overlapping (because of the automatic triangulation) 

    This causes visible edges like you have - because you have two edges right next to each other. Or even overlapping. This is not uncommon with N-gons - which is why people say to avoid them. 

    You need to edit the mesh to get rid of the long, thin, and closely spaced, triangles. 

    Obviously you can see where the bad triangulation is but you can also use the cleanup tool in Maya to check for this. (Mesh>Cleanup)
    Since this is a CAD mesh, ngons are unavoidable. 

    I'll run it through a mesh clean up just as a test, but yes I could also redirect it better by just exporting the ngon version from MOI3D and then doing some manual work. It just becomes a lot of work when dealing with any boolean cuts as I have so many vertices to manage 

    I'll post back when I've finished. :)

    Thank you!

  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    3D4Eva said:
    It looks like some of the tris have zero surface area or are overlapping (because of the automatic triangulation) 

    This causes visible edges like you have - because you have two edges right next to each other. Or even overlapping. This is not uncommon with N-gons - which is why people say to avoid them. 

    You need to edit the mesh to get rid of the long, thin, and closely spaced, triangles. 

    Obviously you can see where the bad triangulation is but you can also use the cleanup tool in Maya to check for this. (Mesh>Cleanup)
    Since this is a CAD mesh, ngons are unavoidable. 

    I'll run it through a mesh clean up just as a test, but yes I could also redirect it better by just exporting the ngon version from MOI3D and then doing some manual work. It just becomes a lot of work when dealing with any boolean cuts as I have so many vertices to manage 

    I'll post back when I've finished. :)

    Thank you!

    It might be as easy to fix as just joining a few vertexes together on the N-gon manually - and then letting it triangulate automatically. 
  • 3D4Eva
    Offline / Send Message
    3D4Eva polycounter lvl 4
    It might be as easy to fix as just joining a few vertexes together on the N-gon manually - and then letting it triangulate automatically. 
    Thankfully MOI3D gives very clean ngon versions.

    Example file

    https://www.dropbox.com/s/u2xnvarn1bvzkfy/ngonversion.obj?dl=0




  • Ghogiel
    Offline / Send Message
    Ghogiel greentooth
    Not that I could recreate the issue from exporting from maya or max with objs. but you could try changing the divide larger than export settings in moi, which will help minimise the long thin triangulation
  • 3D4Eva
    Offline / Send Message
    3D4Eva polycounter lvl 4
    Ghogiel said:
    Not that I could recreate the issue from exporting from maya or max with objs. but you could try changing the divide larger than export settings in moi, which will help minimise the long thin triangulation
    Thanks for the suggestion as this actually works perfect. The work I'm doing is going to be rendered offline so the higher polycount really doesn't matter, and the time saved is great! :astonished:

    MOI3D is a real life saver for CAD models!

    Thank you! :)
Sign In or Register to comment.