[BUG] Symmetrical Blender Model with TangentGenerator and NormalMap (74 posts)

  • Profile picture of mifth mifth132p said 7 months, 3 weeks ago:

    Hi! I found this bug in blender model since jme alpha 2(before @kaelthas started working on the blender loader). I think the problem could be in model’s tangents/normals/binormals.

    There is just a blender geometry, normal map, j3m material, light source, tangent generator. When model is symmetrical so and TangentGenerator is true, so there is a seam appears on the model. But if TangentGenerator is switched off, so the seam disappears.

    I did a simple test for *.obj and *.blend models.

    Here you can get it:

    Screenshot: http://dl.dropbox.com/u/26887202/123/jme_blender/normalmap_bug/seam_blend_model.png
    Code: http://pastebin.com/xizbkEC5
    Models with NormalMap Texture: http://dl.dropbox.com/u/26887202/123/jme_blender/normalmap_bug/Models.zip

    Entire JMP project: http://dl.dropbox.com/u/26887202/123/jme_blender/normalmap_bug/NormalMapTest.zip

  • Profile picture of mifth mifth132p said 7 months, 3 weeks ago:

    It seems the problem looks like it is described here: http://www.gamedev.net/topic/587770-inverted-tangent-normal-map/

  • Profile picture of mifth mifth132p said 7 months, 3 weeks ago:

    I suppose it is in the Blender Loader.

  • Profile picture of mifth mifth132p said 7 months, 2 weeks ago:

    Core Devs, can you tell anything about this issue? Is it possible to fix symmetrical blender models with normal map? Otherwise, I have to use obj and ogre files instead of blend files.

  • Profile picture of normen normen1290p said 7 months, 2 weeks ago:

    Just stitch the model together in blender..

  • Profile picture of mifth mifth132p said 7 months, 2 weeks ago:

    there are no stitches and modifiers in blender model. obj model was exported from blender. it’s ok with obj.
    This is really a bug blender models and symmetry like here http://www.gamedev.net/topic/587770-inverted-tangent-normal-map/.

  • Profile picture of mifth mifth132p said 7 months, 2 weeks ago:

    As I mentioned above, stitches appear when I switch TangentGenerator on in my code. Otherwise, there are no any stitches on the blender model. So, the problem is with TangentGenerator and symmetrical blender models.

  • Profile picture of nehon nehon591p said 7 months, 2 weeks ago:

    can be due to the fact that blender and jme does not use the same normal maps
    have you try to invert red and green channels?

  • Profile picture of mifth mifth132p said 7 months, 2 weeks ago:

    I tried invert channels (rgb) of normal map. Stitches appear anyway.

    It caused by TangentGenerator. Possibly, TangentGenerator recalculate normals/tangents/binormals of a blender symmetrical model in different way.

    But if I switch TangentGenerator off the stitches disappear.

  • Profile picture of mifth mifth132p said 7 months, 2 weeks ago:

    The problem also can be in BlenderLoader instead of TangentGenerator. When BlenderLoader loads meshes.

  • Profile picture of nehon nehon591p said 7 months, 2 weeks ago:

    But if I switch TangentGenerator off the stitches disappear.

    mhhhh…. @Kaelthas do you import blender’s tangents when loading a mesh?

  • Profile picture of Kaelthas Kaelthas57p said 7 months, 2 weeks ago:

    No I didn’t implement tangents loading.
    But as I see I probably should.

  • Profile picture of mifth mifth132p said 7 months, 2 weeks ago:

    Kaelthas, I sent you a message, but you were faster. :)

  • Profile picture of mifth mifth132p said 7 months, 2 weeks ago:

    I updated today JMP. The problem still exists.

  • Profile picture of nehon nehon591p said 7 months, 2 weeks ago:

    Kaelthas said:
    No I didn’t implement tangents loading.
    But as I see I probably should.

    well…shouldn’t be necessary. Because the tangentGenerator should work fine
    But you’ll have issues with normal maps generated in blender, because you have to invert the red and green channel in order to render them properly with the lighting material

    The issue here is with the tangent generator i guess….