Author Topic: Problems replicating look between Painter and Unity. Possible Normals issue  (Read 273 times)

Hi

I'm having a hard time understanding why can't seem to get the same look in Painter as in Unity. Here is my pipeline:

1. I'm optimizing geometry using PiXYZ, creating proxy meshes which I export as FBX
2. I paint the model in Substance painter, set to OpenGL. I then export OpenGL normap maps in PNG 8 bit.
3. I import FBX mesh from step 1 into Unity, together with PNG files from step 2. Unity is set to Linear mode.

Here are screenshots from Painter (clay and full PBR):



Screenshots from Unity:





What I've tried:

1. I think I've tried every single combination of different import settings in Unity when it comes to Normals. Here are the default ones:



Suddenly, when I tried EXPORTING the mesh from Substance painter, as an OBJ and then imported that one into Unity, I got the expected result:




However, I then tried exporting OBJ instead of FBX from PiXYZ to be imported into Unity but it did no difference.

What's going on here?

Best regards

- Björn

Did you create smoothing groups for the model?

Not intentionally no. Not even aware of If I can do that in PiXYZ. I tried opening the FBX in Cinema4D and there seem to be what C4D refers to as a Phong tag on the mesh:



The OBJ from Painter does have an additional tag when opened in C4D, the vertex normal tag:

Last Edit: July 09, 2019, 01:59:33 pm

You need to create smoothing groups for your objects. Since I don't work with C4D (and have no idea what PiXYZ is) I can't tell you how to do that exactly, but there should be tutorials for that on youtube or something, it is a very common thing to do that should be possible in any 3d app.

Smoothing groups define which (groups of) polygons are smoothed, and which are not/ where hard edges will be located. If you don't define those areas manually, and import without that information saved into the file, the smoothing will happen irregularly across polygons, leading to those artifacts on your screenshots.

Today it is common to create area/ face weighted normals, which creates vertex normals based on the size of the polygons. It is more or less a one click process (provided the model is created accordingly with bevels ect), but the 3D application needs to have specific tools for that. No idea if C4D provides those tools. If not, try using Blender: https://www.youtube.com/watch?v=eKOdWmoaLOg
Last Edit: July 09, 2019, 02:34:24 pm

I'm not sure how this polygroup concept relates to this problem. Both Substance painter and Unity are feeded the same FBX file (polygroups or not). Do you mean Substance Painter generate it's own polygroups which are not there from the start? Everything looks great in Substance painter namely, and the OBJ exported from substance painter looks great in Unity aswell.

Are polygroups and vertex normals the same thing?

PiXYZ is a polygon optimization software that tesselate CAD files and optimize them for realtime use. I'm reaching out to them in parallel to see if they're aware of this polygroup concept you mention and how it's connected.

I have no experience with Unity. All I can tell you is that it looks like a vertex normal/ smoothing groups issue. Unity probably creates the vertex normals upon import because there either is no vertex normal map present on the model, or the import settings are set to not import the map.

You need to create those vertex normals/ smoothing groups yourself manually, so if you haven't done that and even have no idea what I am talking about, odds are that this is exactly your problem.

I see. Last thing though, how does that explain that things look great in Substance painter? And things look great if I export an OBJ from substance painter and put that in Unity. Does it mean substance painter creates these vertex normals upon import for me? See what I mean?

If there is no vertex normal map on the object Painter will recalculate them on import. Not sure though why it looks correctly in Painter, it will not create it with all the hard edges ect in place automatically. I'd say it would have to look incorrectly there also.

I've been in contact with the PiXYZ support team on this now and they've done some testings. Olivier over at PiXYZ compared the FBX they've generated with the OBJ exported from Substance painter (after importing that same FBX). It seems there are som subtle differences in the normals and tangents on the meshes. This imply's that substance painter does something to the mesh before baking - making whatever normal maps not fit entirely to the original mesh anymore thus requiring me to export the mesh once more from substance.



Is that right? Can someone from Substance please look into this and reply.
Last Edit: September 18, 2019, 12:10:58 pm