Page MenuHome

FBX importer wrong normal map strength
Closed, ResolvedPublic

Description

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.30

Blender Version
Broken: version: 2.82 (sub 0), branch: master, commit date: 2019-10-15 18:02, hash: rBa8d001fef5e8
Worked: (optional)

Short description of error
The FBX importer seems to do a strange conversion for the normal strength, which was brought to my attention by a question on Blender's StackExchange. Creating a material with a Normal Map node with strength set to 1.0, exported to .fbx and imported again, will result in a strength of approximately 0.14. The reason for this seems to be the following calculation in line 1429 of the import_fbx.py introduced in commit 94a1268efa6a16b2e85b95a6ad145e3bbd63f018

# (x / 7.142) is only a guess, cycles usable range is (0.0 -> 0.5)
ma_wrap.normalmap_strength = elem_props_get_number(fbx_props, b'BumpFactor', 2.5) / 7.142

Since I'm not familiar with the .fbx format, I can't tell if there is a use case where dividing by 7.142 would be necessary. The fact that the values don't match after import and that the range of the strength is actually [0.0, 1.0] suggests that this line is wrong. It may also be that Blender's exporter code makes different assumptions than the import code.

Exact steps for others to reproduce the error

  1. Create a material with an Image Texture node, connected to a Normal Map node, which in turn is connected to the normal socket of the Principled BSDF node.
  2. Export the object as .fbx
  3. Import the .fbx file
  4. Verify that the strength of the Normal Map node is not the same

Original project

Exported .fbx

Project after import

Event Timeline

Bastien Montagne (mont29) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.
Bastien Montagne (mont29) edited projects, added Add-ons, Import/Export; removed BF Blender.
Robert Guetzkow (rjg) removed Bastien Montagne (mont29) as the assignee of this task.EditedWed, Oct 16, 6:20 PM
Robert Guetzkow (rjg) raised the priority of this task from Confirmed, Medium to Needs Triage by Developer.
Robert Guetzkow (rjg) updated the task description. (Show Details)

@Bastien Montagne (mont29) Sorry my update of the task description overwrote your changes.

Bastien Montagne (mont29) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.Wed, Oct 16, 8:00 PM

That conversion factor in import goes back to 2013 (rBA53f601943472b, initial commit adding some import support to generate Cycles materials from FBX - we did not have any way to export those at the time).

@Campbell Barton (campbellbarton) I guess that was OK at the time with Cycles' own BSDF shaders, but now with the 'industry-compatible' Principled shader, I’d think we can just use the value without any conversion? Otherwise I'll have to add matching reversed conversion to the exporter too…

@Brecht Van Lommel (brecht) you may also have an idea about why that conversion was needed back then too? And whether we can just use FBX value directly nowadays?

No answer so far, will just assume this factor is not needed anymore and remove it from the importer.

I have no idea what BumpFactor in FBX is intended to do. Or what the conversion does, I guess it was just empirically determined.

In Blender, "Distance" is a scale on the bump height, and "Strength" is a mixing factor for linear interpolation between the original and bumped normal.