Browse Source

Clarified normal baking.

mitm 7 years ago
parent
commit
243465f38c
1 changed files with 16 additions and 1 deletions
  1. 16 1
      src/docs/asciidoc/jme3/external/blender.adoc

+ 16 - 1
src/docs/asciidoc/jme3/external/blender.adoc

@@ -193,7 +193,14 @@ Be careful: in the Outliner the camera symbol (Restrict Render) must be on!
 
 == Fixing the normal colors in Blender
 
-Blender has its own normal colors standard. We need to fix the colors to prepare the normalmap for using it with the JME Lighting Material. You should only have to invert the green channel, the red channel should stay unchanged. The curve for the red channel should go from bottom left to top right.
+There are two "`standards`" for normal maps:
+
+*  DirectX
+*  OpenGL
+
+The difference between them is that the green channel is inverted. One would expect that JME supports the OpenGL way, but actually JME supports the DirectX way because it’s what Blender supports and the developers of JME thought it would be easier in the Blender to JME workflow.
+
+Because of this, you need to fix the colors to prepare the normal map for using it with the JME Lighting Material. You should only have to invert the green channel, the red channel should stay unchanged. The curve for the red channel should go from bottom left to top right.
 
 To do this, go to the Blender Node Window
 
@@ -213,7 +220,15 @@ To do this, go to the Blender Node Window
 *  After rendering, save the file to a destination you want and use it with the JME Lighting Material and the lowpoly version of the model.
 **  image:jme3/external/ready_normal.gif[ready_normal.gif,width="",height=""]
 
+[TIP]
+====
+Note that the link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.j3md#L40[PBR material] has a NormalType parameter that allows one to handle this in the shader instead of having to edit the normal map.
+
+You can also use the SDK to invert the channel:
 
+.  In the SDK, btn:[RMB] select the image and choose "`Edit Texture`".
+.  In the window header, press the btn:[Filters] button and choose `menu:Invert[Green]`.
+====
 
 === LightMap baking