Feature Request: Implement Import CAD generated vertex shading normals with OBJ files

Hi there,

I was curious if anybody has a good solution to the as it seems to me still existing vertex shading issues.
Oddly with NGONs as well as fully triangulated meshes the same issue is present in different forms.
Reading online, it seems also MODO people have issues in their engine.

Anybody has a good idea or approach?
The screenshots below are from MOI explored as NGON and tri mesh
and in Blender I removed the doubles.

Blender shading and rendering artifacts.

MOI internal shading - perfect :wink:

If you could show the mesh, it would help… maybe.

I reproduced (more or less) your shape and I got no shading artifact.

As you can see, the geometry is very simple. No Ngons, no triangles. Any way, triangles don’t work well with the Subsurf modifier.

Different angle, still no artifacts.

Hi there,

Blender with BMesh and Cycles got extremely more powerful and usable for product rendering.

However it seems that Blender still ignores the vertex shading generated from the NURBS data
and thus produces terrible vertex shading artifacts that can actually make it in certain cases useless.

The developer of MOI explained that Blender ignores vertex normals that are present in the OBJ file and instead calculates the normals from averaging surrounding polygons.

With CAD data it’s important for the vertex normals that are stored in the file (which are very accurate and come from the original NURBS surface), to be used for the shading rather than trying to make an approximation.

Any chance this could be addressed to Blender?

Scorpius made a patched version of Blender two years ago, which suppressed the constant normal recalculation and had an importer that worked with normals. Apart from that, I haven’t seen anyone interested in working on this.

What you can do is try finding a NURBS tesselator that creates a more uniform mesh, without the large triangles that influence averaged normals strongly. Most applications have really bad tesselators that don’t create watertight meshes. Maybe look a bit into the FEM area. If you find something good, let us know.

Ah what a pity,

MOI produces outstanding NGON based meshes that shade PERFECTLY but not in Blender - grrr.

This is a re-occurring request made throughout the years. I can’t imagine this to be very difficult to implement? I mean, a simple on/off checkbox in the objects’ properties would do it, while making sure that the obj importer also includes this option. Done!

Is this not a couple of lines in Blender’s source code?

Hi Herbert,

It seems to really re-occur over the years, however I am not sure how difficult it would be to implement.
I just noticed that MOI produces outstanding NGON meshes but they hardly work well in Blender because of how Blender treats the vertex normal shading …

And that little detail is quite important for product rendering!

Yes, it is just “a couple of lines”. However, don’t underestimate the amount of effort that can go into that. In any case it’s not a particularly interesting thing to do and it affects few users.

One of the first things I did on these forums was to ask scorpius for his patch, because I was getting tired of finding all the areas in Blender that trigger a normal recalc (but he never provided it). Even Blender Internal recalculates them. Eventually I lost interest, because while it wasn’t a big thing by-and-large, it wasn’t worth it to me.

Maybe a more straightforward way to go about it would be to create importer modifiers, that way you might get around the whole mesh update/editing thing.

This is just a simple demo file to show that already with basic shapes the rendering fails.

Thank you for your effort!

That’s awesome. I use Moi myself, and this would be absolutely the bomb!

Bumping this thread on account of the modified OBJ importer that helps with this issue.

In regards to my comment above, back when I wanted to modify Blender to suppress normal recalculation, Blender Internal would recalculate normals (and there was no Cycles), so having just a modified importer seemed useless.
This seems to no longer be the case, you can render modified normals both in Blender Internal as well as Cycles.

A viable workflow, for now, is to import the modified mesh and save it out to a blend file, then link that into another scene (to prevent accidental editing).