ssbucarlos / smash-ultimate-blender

Blender Plugin containing utilities for Smash Ultimate Models and Animations.
45 stars 9 forks source link

Smooth normals not always preserved on export #163

Closed JArmstrongArt closed 2 years ago

JArmstrongArt commented 2 years ago

Download Specimen of Files Had this issue I was recommended to report yesterday. So, I made this model in Blender 3.0. Upon exporting the model with this tool and then inspecting that export in StudioSB (I know this is an outdated program but this shouldn't be an issue in it even so), I noticed that faces along UV seams of the meshes had become triangulated strangely following a warning on export that some of my meshes were not triangulated and that this would be taken care of for me on export. This wouldn't be a problem if not for this automatic triangulation changing my shading from smooth to flat. I can only assume this happens along UV seams because it happened along the UV seam of the fluffy object I modelled and it happened along what I would assumed to be a reasonable UV seam for Banjo's hand. Below, you can see images demonstrating the effects of this issue from before export to after export. image image

ssbucarlos commented 2 years ago

Thanks for compiling the info, i should get around to looking into it sometime in the coming days, in the mean time, manually triangulate / split the mesh along the seams, and see if that fixes it. Theres some steps over on the wiki here, however it doesnt cover all cases. I'll be updating this thread as i find more info.

ScanMountGoat commented 2 years ago

Check the render modes in SSBH Editor. StudioSB does not accurately render normals.

JArmstrongArt commented 2 years ago

I'll go download SSBH editor now and check on these files in there, it's worth a try, I just have not had any shading issues with any mesh in StudioSB thus far despite its age and inaccuracies.

JArmstrongArt commented 2 years ago

image It's possible I'm mistaken, but it looks as though the issue persists in SSBH Editor. The rendering on all the meshes in terms of materials is completely off because this is from a version of the model before I worked around this issue for the time being and I no longer have the resources available to easily recreate those materials, but as far as I can tell smoothed normals should be apparent on the mesh even without a proper material to go along with it.

ScanMountGoat commented 2 years ago

Check the render modes under Menu > Render Settings. It's possible one of the vertex attributes or normal maps is causing the problem.

JArmstrongArt commented 2 years ago

image Drawing back the rendering just about as much as I can whilst retaining a visual on the issue, you can see even on the hat meshes, along their UV seams the faces have become flat shaded, which I was not aware of from previous observation.

ScanMountGoat commented 2 years ago

For issues like this you would check Normals (includes normal maps) and Normal0 (mesh attribute).

JArmstrongArt commented 2 years ago

image image My apologies for misunderstanding, anyway, first picture is a look in 'Normals' mode, and the second picture is a look in 'Normal0' mode.

ScanMountGoat commented 2 years ago

It looks like this is only happening on the custom meshes. If the addon needs to modify your mesh in any way for export it will create a temporary mesh, apply the operations like triangulation and splitting, and then transfer the old normals using a data transfer modifier. I'm able to fix the normals for the hat by checking autosmooth. Alternatively, you can triangulate and split on UV seams like Carlos mentioned. The addon won't modify your mesh on export if it doesn't need to.

I'm getting this error in the debug console on export. Blender's approach to normals is pretty unintuitive sometimes. We'll need to do some research to figure out if there's a better solution than forcing people to check autosmooth. I'm hoping we can just modify the temp mesh so that it correctly receives the custom normals. BKE_modifier_set_error: Object: "kazooieHat.001", Modifier: "Transfer Normals", Enable 'Auto Smooth' in Object Data Properties

JArmstrongArt commented 2 years ago

Alright, well, for now I'll just enable auto-smooth, I have no faces on any of my meshes that require flat shading anyway. TY for giving this update!

ScanMountGoat commented 2 years ago

This is fixed now on the latest commit.