torinos-yt / VL.Alembic

MIT License
12 stars 1 forks source link

Problem with normals / smoothing #1

Closed heavy-d closed 2 years ago

heavy-d commented 2 years ago

Hi Torinos, thanks for making this!

I still have a problem with the normals not behaving correctly.

I made 2 patches that demonstrate the issue. Basically, the alembic version should look the same as the fbx model, but as you can see there is something off.

It might be that I missed something in the materials, in the 1st patch you can toggle between Stride and Fuse.

Maybe it would help to output the result of the _hasNormal test from here: https://github.com/torinos-yt/VL.Alembic/blob/master/src/native/VL.Alembic.Native/abcrGeom.cpp#L266

if (!N.valid() || N.getNumSamples() <= 0 || N.getScope() == AbcGeo

So any help would be much appreciated, you can also reach me in the Element chat if I can help with anything (user: rkt).

Thx, and have a great day!

Alembic_Problem_1

Alembic_Problem_2_reduced

alembic_problem.zip

torinos-yt commented 2 years ago

Thanks for the issue along with the detailed research.

The main problem with this seems to be that the abc file being loaded does not contain normals. I have tried loading this alembic in both cinema4d and houdini, but neither of them read the normal information. Please check your settings when exporting the alembic first.

Also, as a separate issue, VL.Alembic calculates a flat normal from the vertices if the normal is not included in the alembic, but it seems that an inverted normal was set. This is why the inverted scale gives the correct looks.

torinos-yt commented 2 years ago

VL.Alembic calculates a flat normal from the vertices if the normal is not included in the alembic, but it seems that an inverted normal was set.

This is fixed. 9273f30a5a4ebf61d4b4874e0a902048fa90473e Close the issue once, but feel free to reopen it if not resolved.

heavy-d commented 2 years ago

Thanks for taking the time and the inverted fix!

For anyone else having problems with this: what seems to help with the models to show up smooth instead of flat shaded is to apply 'Smooth Vectors' in Blender: image