GLTF 2.0 .glb export has incorrect colorspace applied to normal maps #98451

Closed
opened 2022-05-27 18:18:14 +02:00 by Casey · 15 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.77

Blender Version
Broken: version: 3.1.2, branch: master, commit date: 2022-03-31 17:40, hash: blender/blender@cc66d1020c
Worked: 3.0

Short description of error
Exporting gltf 2.0 .glb files with materials that contain normal maps use incorrect color space. If the normal map is set to use "non-color" (as it should be) in the material editor it'll export with that color space baked in and receiving apps read the normal map wrong, causing the normals to break. If the normal maps are set to use srgb (incorrect color space) then it exports fine and is read correctly by apps that import it.

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.77 **Blender Version** Broken: version: 3.1.2, branch: master, commit date: 2022-03-31 17:40, hash: `blender/blender@cc66d1020c` Worked: 3.0 **Short description of error** Exporting gltf 2.0 .glb files with materials that contain normal maps use incorrect color space. If the normal map is set to use "non-color" (as it should be) in the material editor it'll export with that color space baked in and receiving apps read the normal map wrong, causing the normals to break. If the normal maps are set to use srgb (incorrect color space) then it exports fine and is read correctly by apps that import it.
Author

Added subscriber: @Casey-3

Added subscriber: @Casey-3
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Added subscriber: @JulienDuroure

Added subscriber: @JulienDuroure
Member

Hi, thanks for the report. Please upload your .blend file.

Hi, thanks for the report. Please upload your .blend file.
Author

In #98451#1366329, @PratikPB2123 wrote:
Hi, thanks for the report. Please upload your .blend file.

AVDept.blend I have multiple .blend files that were exhibiting this behavior but this one is the most recent me and my team have had the problem with where pretty much every normal map was broken on export

> In #98451#1366329, @PratikPB2123 wrote: > Hi, thanks for the report. Please upload your .blend file. [AVDept.blend](https://archive.blender.org/developer/F13122164/AVDept.blend) I have multiple .blend files that were exhibiting this behavior but this one is the most recent me and my team have had the problem with where pretty much every normal map was broken on export
Member

Hi, I tried exporting then reimporting to blender (3.0, 3.1, 3.3) and I don't see any differences

receiving apps read the normal map wrong,

which software you're referring to?

Hi, I tried exporting then reimporting to blender (3.0, 3.1, 3.3) and I don't see any differences > receiving apps read the normal map wrong, which software you're referring to?
Author

In #98451#1366341, @PratikPB2123 wrote:
Hi, I tried exporting then reimporting to blender (3.0, 3.1, 3.3) and I don't see any differences

receiving apps read the normal map wrong,

which software you're referring to?

Blender being one, if you import the .glb back into it, Babylon JS being another.

> In #98451#1366341, @PratikPB2123 wrote: > Hi, I tried exporting then reimporting to blender (3.0, 3.1, 3.3) and I don't see any differences >> receiving apps read the normal map wrong, > which software you're referring to? Blender being one, if you import the .glb back into it, Babylon JS being another.
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Hello,
Can you please test with Blender 3.3 alpha?
Some recent changes on Blender side (not on addon side) added better color management during image creation.
I can confirm that result is not the same in 3.2 beta and 3.3 alpha

Hello, Can you please test with Blender 3.3 alpha? Some recent changes on Blender side (not on addon side) added better color management during image creation. I can confirm that result is not the same in 3.2 beta and 3.3 alpha
Author

In #98451#1366635, @JulienDuroure wrote:
Hello,
Can you please test with Blender 3.3 alpha?
Some recent changes on Blender side (not on addon side) added better color management during image creation.
I can confirm that result is not the same in 3.2 beta and 3.3 alpha

I will try 3.2 and 3.3, I have tried 3.2 a few days ago on the day I first reported the bug but it wasn't fixed then. Hoping something changed

> In #98451#1366635, @JulienDuroure wrote: > Hello, > Can you please test with Blender 3.3 alpha? > Some recent changes on Blender side (not on addon side) added better color management during image creation. > I can confirm that result is not the same in 3.2 beta and 3.3 alpha I will try 3.2 and 3.3, I have tried 3.2 a few days ago on the day I first reported the bug but it wasn't fixed then. Hoping something changed
Author

In #98451#1366635, @JulienDuroure wrote:
Hello,
Can you please test with Blender 3.3 alpha?
Some recent changes on Blender side (not on addon side) added better color management during image creation.
I can confirm that result is not the same in 3.2 beta and 3.3 alpha

Yep, looks like 3.3 is where it's fixed! I did download and tested 3.2 beta again and it is still broken/incorrect there but that's expected

> In #98451#1366635, @JulienDuroure wrote: > Hello, > Can you please test with Blender 3.3 alpha? > Some recent changes on Blender side (not on addon side) added better color management during image creation. > I can confirm that result is not the same in 3.2 beta and 3.3 alpha Yep, looks like 3.3 is where it's fixed! I did download and tested 3.2 beta again and it is still broken/incorrect there but that's expected
Member

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
Member

Closing, as this is already fixed in master branch

Closing, as this is already fixed in master branch
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#98451
No description provided.