Author Topic: [SOLVED] SBSAR Normals DirectX OpenGL flipped bug  (Read 2602 times)

Hi,

After some extensive testing, I'm finding that normals in the substance graph in Unity are flipped in comparison to an exported texture from Substance Designer.

The attached "SubstanceGraph" image shows the settings of the graph in Substance Designer. Notice that the viewport is set to OpenGL, the  Normal node is set to OpenGL, and output node is set to NormalXYZRight (OpenGL according to Substance Painter docs). Also based on the reflections, you can note that the light source in the viewport is illuminating from above and towards the camera.

The "NormalsFromGraph" image shows how the normals look when mapped to a quad in Unity HDRP with lighting coming from the same direction as the Substance Designer viewport. Note how the normals' Y is flipped to be like DirectX Normals. This is not the same as in Substance Designer. In Unity, the SBSAR has purple at the top, whereas SD shows it as cyan at the top.

If in Substance Designer, I don't export a SBSAR but instead export a texture straight from the 2D view of the output node, import that into Unity and apply Normal Map import settings, notice in the "NormalsFromTexture" image how the normals appear correctly in the OpenGL format. In Unity it is also correctly cyan at top.

The normals are somehow getting flipped from OpenGL to DirectX in the SBSAR, but not when exporting as a texture. This is with Unity 2019.3.4, HDRP 7.2.1, and Substance 2.4.4.

This problem is the same for all "usages" set in the output - NormalXYZLeft, NormalXYZRight, SNorm, sRGB, etc. exported from SD and imported into Unity.

However, if NO usage is set for the output, then when importing that substance into Unity, the texture appears correctly with cyan at top, BUT it doesn't function correctly with lighting as a normal map because it is not detected as a normal map by the substance engine. We also can't set the import settings for the texture to be a normal map because THERE ARE NO such settings in the inspector for that texture, only "Wrap Mode", "Filter Mode", and "Aniso Level". Please look into this bug.

As an aside, it would be nice to have all of Unity's texture import settings available rather than having the Navigation section in the inspector, if there has to be a choice between the two.
Last Edit: April 08, 2020, 05:50:11 pm

Can I get some kind of confirmation that this is being looked into please?

Hello,

Thank you for bringing this issue to our attention.
We are investigating this behaviour, and will get back to you as soon as possible. We appreciate your patience!

Best regards.
QA Analyst
Substance Designer Team

Thank you very much for the response! Great to know that this is being investigated.

Thank you very much for the response! Great to know that this is being investigated.

Hi,

The Unity plugin is auto converting from DX normals to OGL. If you have set the normal in Designer to be OGL, then Unity is doing another flip which in this case sets it back to DX. I can ask the devs to add a preference to disable this auto conversion of normals for a future update.

Cheers,
Wes

Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Thanks for the clarification. I'm just glad it wasn't my imagination. I'll change the viewport and normals in my graph to DirectX from now on, for Unity. It would be great if the auto conversion of normals could be mentioned in the Substance for Unity docs, unless it's already there somewhere and I missed it.

Also, having a preference to disable it would be great.
Last Edit: March 20, 2020, 12:23:08 pm

Thanks for the clarification. I'm just glad it wasn't my imagination. I'll change the viewport and normals in my graph to DirectX from now on, for Unity. It would be great if the auto conversion of normals could be mentioned in the Substance for Unity docs, unless it's already there somewhere and I missed it.

Also, having a preference to disable it would be great.
Thanks for the feedback on the docs. I will get that added : ) I have put a ticket in for us to add a preference for normals. I will push to get this in our 2.5 update. We are closing out our 2.4.5 update currently.

Cheers
Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja