Tangent Basis of Blender does not match xNormal. (Both use mikktspace) Which is 100% correct? #27908

Closed
opened 2011-07-08 18:57:16 +02:00 by Andy Davies · 8 comments

%%%Hey,

I have been doing some tests and noticed that Normal maps that are produced in Blender do not match ones that are created with the same models in xNormal 3.17.5.
As im sure you are aware, xNormal now uses the mikktspace by Morten S. Mikkelsen, so it should match Blender 100%
Im wondering if this is due to an error in xNormal, or in Blender, or due to different ray casting techniques for both of the programs

I have attached ta difference map, along with a zip file that includes the rendered maps from each application, along with the .blend, the LP and HP meshes used for baking.

Any ideas?

Blender 2.58a
Windows 7 64bit
8GB RAM
Nvidia 460GTX%%%

%%%Hey, I have been doing some tests and noticed that Normal maps that are produced in Blender do not match ones that are created with the same models in xNormal 3.17.5. As im sure you are aware, xNormal now uses the mikktspace by Morten S. Mikkelsen, so it should match Blender 100% Im wondering if this is due to an error in xNormal, or in Blender, or due to different ray casting techniques for both of the programs I have attached ta difference map, along with a zip file that includes the rendered maps from each application, along with the .blend, the LP and HP meshes used for baking. Any ideas? Blender 2.58a Windows 7 64bit 8GB RAM Nvidia 460GTX%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'

%%%There are some differences on the edges, but that has nothing to do with the tangent space, just difference in baker implementations. Also some pixels +1 -1 but again that's just because they are two different applications, you can't expect them to give 100% the same output.%%%

%%%There are some differences on the edges, but that has nothing to do with the tangent space, just difference in baker implementations. Also some pixels +1 -1 but again that's just because they are two different applications, you can't expect them to give 100% the same output.%%%
Author

%%%Thanks for the reply Brecht.

When you say edges, do you mean the edges of the islands? I expected those to be different :)
I was concerned more about the centre section of the island that it top left, and the centre vertical lines of the Bottom island, as they show quite a difference.
Would you put this down to the difference between the applications?

Thanks for looking%%%

%%%Thanks for the reply Brecht. When you say edges, do you mean the edges of the islands? I expected those to be different :) I was concerned more about the centre section of the island that it top left, and the centre vertical lines of the Bottom island, as they show quite a difference. Would you put this down to the difference between the applications? Thanks for looking%%%

%%%I think that too is just difference between bakers, the tangent space is just one of many factors influencing the result. The main reason to have matching tangent spaces is so that you can render the resulting normal map the same way. For baking there's more things that can be different, which point on the low poly mesh corresponds to which point on the high poly mesh is not well defined, it's something that I would expect to vary a bit.%%%

%%%I think that too is just difference between bakers, the tangent space is just one of many factors influencing the result. The main reason to have matching tangent spaces is so that you can render the resulting normal map the same way. For baking there's more things that can be different, which point on the low poly mesh corresponds to which point on the high poly mesh is not well defined, it's something that I would expect to vary a bit.%%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Author

%%%ok. Thanks for taking the time to look at this :)%%%

%%%ok. Thanks for taking the time to look at this :)%%%

%%%Hey Andrew,

What Brecht is saying is absolutely correct. I just thought I'd add a few extra details. It is true that there's no way you can expect two different bakers to
pick up/sample the same field of normals from the hi-res. The advantage to a shared tangent space is that you're able to import and correctly "decode"
the normal map (ie. use it for rendering) such that your viewer can reconstruct the original captured normals. So for instance you can bake the map in Blender and use the result in the viewer in xNormal and vice versa works too.

Other things you need to be aware of is that if xNormal splits quads along a different diagonal then Blender then you get different interpolated tangent spaces.
So to be on the safe side, especially when scrutinizing results like this, it can be best to triangulate in Blender before exporting and baking .

Another thing you should know is by default xNormal calculates its own vertex normals which will affect tangent space too.
So you should choose "use exported normals" in xNormal where your lo-res is selected.

%%%

%%%Hey Andrew, What Brecht is saying is absolutely correct. I just thought I'd add a few extra details. It is true that there's no way you can expect two different bakers to pick up/sample the same field of normals from the hi-res. The advantage to a shared tangent space is that you're able to import and correctly "decode" the normal map (ie. use it for rendering) such that your viewer can reconstruct the original captured normals. So for instance you can bake the map in Blender and use the result in the viewer in xNormal and vice versa works too. Other things you need to be aware of is that if xNormal splits quads along a different diagonal then Blender then you get different interpolated tangent spaces. So to be on the safe side, especially when scrutinizing results like this, it can be best to triangulate in Blender before exporting and baking . Another thing you should know is by default xNormal calculates its own vertex normals which will affect tangent space too. So you should choose "use exported normals" in xNormal where your lo-res is selected. %%%
Author

%%%Thanks Morten :)
Sorry for the late reply...I missed the notification email for this.
I love digging deeper into this and it is great to actually understand why there are difference between bakers that go further than just the normal tspace/swizzle. I think its good for artists to have a solid understanding of these "behind the scenes" factors that directly effect their work. :)
Cheers guys!%%%

%%%Thanks Morten :) Sorry for the late reply...I missed the notification email for this. I love digging deeper into this and it is great to actually understand why there are difference between bakers that go further than just the normal tspace/swizzle. I think its good for artists to have a solid understanding of these "behind the scenes" factors that directly effect their work. :) Cheers guys!%%%
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
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#27908
No description provided.