I'm curious which type of normal map works better? DirectX or OpenGL normal maps? Which one to use for cycles and eevee?
Asked
Active
Viewed 4.2k times
13
-
8Blender expects normal maps in the OpenGL format. The difference between the two is that the green channel is inverted from one to the other, so in the end it doesn't matter what you use, if you know how to use it - you get the same result. – Jaroslav Jerryno Novotny Feb 03 '18 at 16:06
2 Answers
18
Only DirectX applications use DX normal maps. And DirectX run only under Windows mainly due to license. For everything else you need to use OpenGL. For sure is good always check documentation.
On image below you can find simple way how to convert DX to OpenGL (or OpenGL to DX)
Shubol3D
- 2,142
- 1
- 14
- 22
-
-
@DrachenSeele - unfortunately no, because Blender itself doesn't support DirectX textures – Shubol3D May 06 '19 at 19:45
-
1
18
Blender uses the OpenGL format. This image shows an optimized version of normal map conversion, because it doesn't convert between number and color, so it is faster with Cycles and EEVEE:
This second picture shows how you can recognize OpenGL normal maps just by looking at them. Notice, that on OpenGL normal map it looks as if there is light shining from the top right (or opposite), while on DirectX it's from the bottom right direction (or opposite).

Vilém Duha
- 572
- 3
- 9
-
1I really don't get what you mean by this part: " This image shows an optimized version of normal map conversion, because it doesn't convert between number and color, so it is faster with Cycles and EEVEE" – Martynas Žiemys Jan 28 '20 at 14:50
-
Grey dots on nodes are numbers - one value. Yellow are colors. If you'd use Invert node, Cycles needs to convert the single number to RGB and then back. So if you do nodes it's good to stick with grey(number) inputs and outputs if possible. – Vilém Duha Jan 30 '20 at 12:47
-
Where do you get this info from? How do you know it differs? Color nodes do maths with numerical values they just come from colors - that's the same. Even if we say that color management transforms impact performance(which is definitely not perceivable in any way in practice), normal maps are set to non-color data, so there is no color management for them. As far as I know there should be no difference at all in this case. I mean have you tested it, or looked through the source code? – Martynas Žiemys Jan 30 '20 at 13:34
-
Yes I have tested it when building complex procedural shaders, and the performance difference was perceptible. Normal map is set to non-color, but how does the Invert node know this, when it gets numeric input? Even with no color management, it's still 3x the same operation(invert is 1-x on all channels) - probably calculated on each sample of the material, so many million/billion times per image. – Vilém Duha Jan 30 '20 at 14:24
-
You could use ColorMix node in difference mode with 0,1,0 for RGB values. You get inverted image if you mix it with white in difference mode so to invert green you would mix the image with 100% green if I am not mistaken. I think color nodes are very useful for maths, sometimes. As far as I know there is no reason not to abuse them this way. – Martynas Žiemys Jan 30 '20 at 14:54
-
The 'conversion' part is what confused me. I think there is no conversion here so to speak. – Martynas Žiemys Jan 30 '20 at 15:02
-
1There is a reason not to use the color nodes - even without color correction, you still operate on 3 values instead of on one. And as I mentioned, I tested performance impact in some more complicated node setups. – Vilém Duha Feb 13 '20 at 16:06

