Obj export from Max

What is the correct settings for subject? Because after converting to obj and loading via engine mesh is OK, UV coords i think is also OK, but… if i use normal map there is many artifact in the mesh visualization.

P.S.

Lighting material and directional light




Sorry, my mistake. I forgot to generate tangents and binormals.

Sorry. but i still have a problem. How to convert a model from Max to JME? Because obj doesn’t store tangents, Max’s baker generate tangents incompatible with tangent generator from JME and OGRE Exporter for Max makes binary mesh (converter to XML doesn’t work with meshes from last version exporter). As result - i can’t use normal mapping.

You can generate tangents for any model based on its normals, by using jMonkeyPlatform or TangentBinormalGenerator.

For the ogre exporter, there should be an option to export to XML

That’s my test code

[java] cube = assetManager.loadModel(“Models/Cube/testNormalCube2.obj”);

TangentBinormalGenerator.generate(cube);

Material matDefault = new Material(assetManager, “Common/MatDefs/Light/Lighting.j3md”);

matDefault.setTexture(“NormalMap”, assetManager.loadTexture(“Models/Cube/xNorma_nightl_normals.PNG”));

cube.setMaterial(matDefault);

cube.setLocalTranslation(0, 0, 0);

rootNode.attachChild(cube);



sun = new DirectionalLight();

sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));

rootNode.addLight(sun);[/java]

“xNorma_nightl_normals.PNG” is the normal map, which was baked in xNormal (with default tangent calculator)

And here is the result in JME



With normal map baked in Max result is exactly the same. But in scanline renderer and directX viewport in xNormal both normal maps works good. And here is screen from xNormal viewer (as i said before in max’s scanline everything is ok too)

URL]

Make sure you’re exporting both UVs and normals for the OBJ plugin

ok, the problem was with inverted y-axis while baking process. And seams disappeared (so-so) in jme rendering.

I am guessing the texture might be flipped. Try loading the texture through a TextureKey and see if changing the “flip” parameter in the constructor helps.

Otherwise, I don’t know, the only thing I can say is that it should work from what I see.



EDIT: Nevermind …