Normal Map/Baking problem

Ive tried a few workarounds and searched quite a bit, but for the life of me i cant figure out why i get this problem:

http://i54.tinypic.com/2icbr7n.jpg

I tried the whole flipping textures thing, but that didnt fix it,

some info on the model:

made in blender, low poly, UV Wrapped (i moved the faces around on the UV image so i could paint textures easily,which showed up properly in blender, so maybe thats the problem ? )

  • exported using ogre exporter (using 2.49a blender btw)

    urm, generated normal map using bake on blender and normal map matches in terms of position,

    Link to texture image, Link to Normal map image



    my j3m:

    [java]Material Fence : Common/MatDefs/Light/Lighting.j3md {

    MaterialParameters {

    Shininess: 8.0

    DiffuseMap: Repeat Textures/Models/fence_nol.png

    NormalMap: Repeat Textures/Models/fence_bake.png

    }

    }[/java]

It looks is missing the uv texture layers in your model file, or is missing generating tangent binormals to it.

i reallly would like to know how to to lighting on imported models(without deleting UV of textures to them)

i tried

[java]material Material/TEXFACE/windmill_diffuse.jpg

{

receive_shadows on

technique

{

pass

{

ambient 0.500000 0.500000 0.500000 1.000000

diffuse 0.338824 0.338824 0.338824 1.000000

specular 0.500000 0.500000 0.500000 1.000000 12.500000

emissive 0.000000 0.000000 0.000000 1.000000

lighting off

texture_unit

{

texture windmill_diffuse.tga

}

normal_map

{

texture windmill_normal.tga

}

}

}

}

[/java]

IT HAVE GOOD TEXT CORDS BUT: it will not work with normal map. And Without lighting off it is just “gray”

when using :

[java]

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

mat_lit.setTexture(“DiffuseMap”,assetManager.loadTexture(“Models/objects/windmill/windmill_diffuse.tga”));

mat_lit.setTexture(“NormalMap”,assetManager.loadTexture(“Models/objects/windmill/windmill_normal.tga”));

mat_lit.setFloat(“Shininess”, 5f); // [0,128]

World.getObject(name).setMaterial(mat_lit);

[/java]

it will just remove uv tex cords as topic person said.(or it is black as i have)

i red http://hub.jmonkeyengine.org/groups/import-assets/forum/topic/lighting-on-blender-imported-object/

but sun direction didnt helped

[java] DirectionalLight sun = new DirectionalLight();

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

sun.setDirection(new Vector3f(-1, 1, -1));

rootNode.addLight(sun);

[/java]

Please tell ANY example of load lighting definition with texture and normal map THAT DONT DELETE UV CORDS.

Just select a geometry in the SceneComposer and in its properties, select “create j3m”, then you have a j3m material file you can edit, assign textures to etc. UV coords wont be changed.

i really dont want to have models in j3o format, but if it is necessary to do it, then i will do it ;/

Is there any way to do it without compile object to j3o? just after importing to game from mesh xml file?

[java]

Spatial spat = assetManager.loadModel(URL_OF_OGRE_MESHES); // not j3o

Node node = (Node) spat;

[/java]

like this

EDIT:

BTW i have problem with SDK sceneComposer Editor… it just close(CRASH) after going to edit j3o file

i have chipset(not graphics card) but it worked in previously versions ;/

same with material( but here only when i am in full screen mode)

Its not that we disencourage using external formats directly to annoy you but to save you from problems. If you don’t manage to do this yourself its probably best to listen to advice given.

1 Like

ok i understand, so now i must just fix problem with scene composer bug…



Thank u for stop me from Days of seek how to do it without j3o :wink:

Perhaps you need to flip the textures along the Y?

[java]Material Fence : Common/MatDefs/Light/Lighting.j3md {

MaterialParameters {

Shininess: 8.0

DiffuseMap: Flip Repeat Textures/Models/fence_nol.png

NormalMap: Flip Repeat Textures/Models/fence_bake.png

}

}[/java]

i dont know if u said it to me,



Material matwindmill : Common/MatDefs/Light/Lighting.j3md {

MaterialParameters {

Shininess: 8.0

DiffuseMap: Flip Repeat Models/objects/windmill/windmill_diffuse.tga

NormalMap: Flip Repeat Models/objects/windmill/windmill_normal.tga

}

}



black object… I tried with diffrent sun position, but nothin ;/

and i still cant use scenecomposer ;/