5
$\begingroup$

I'm curious which type of normal map works better? DirectX or OpenGL normal maps? Which one to use for cycles and eevee?

$\endgroup$
  • 5
    $\begingroup$ Blender 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. $\endgroup$ – Jaroslav Jerryno Novotny Feb 3 '18 at 16:06
8
$\begingroup$

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)

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ so when i use blender on windows I can use the DirectX version? $\endgroup$ – DrachenSeele Apr 28 '19 at 19:56
  • $\begingroup$ @DrachenSeele - unfortunately no, because Blender itself doesn't support DirectX textures $\endgroup$ – Shubol3D May 6 '19 at 19:45
  • $\begingroup$ OK, is there any way to distinguish DX and OGL? $\endgroup$ – DrachenSeele May 6 '19 at 19:47
6
$\begingroup$

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:

OpenGL to DirectX normal map

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). enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ I 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" $\endgroup$ – Martynas Žiemys Jan 28 at 14:50
  • $\begingroup$ 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. $\endgroup$ – Vilém Duha Jan 30 at 12:47
  • $\begingroup$ 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? $\endgroup$ – Martynas Žiemys Jan 30 at 13:34
  • $\begingroup$ 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. $\endgroup$ – Vilém Duha Jan 30 at 14:24
  • 1
    $\begingroup$ There 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. $\endgroup$ – Vilém Duha Feb 13 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.