Defining Normal Map in Blender Exported Material

Hey there.

The last few days i was mapping and modeling for my little project i’m onto atm. I made and found some textures and wanted to add normal maps aso. for my models.

Now I’m asking myself wether i can define which normal map aso shall be used in the blender exported material file or if i have to make a material file for every model i want to export. That would be a lot of unecessary work, wouldnt it?

I searched the forums a lot but found only jme2 related entries fitting my cause… And well. Jme3 isnt Jme2, aye? ( I’m so glad it is not… Jme2 was nice somehow, but so complicated in many ways. :smiley: )

I would really appreciate if someone knew an answer.

If this feature is not supported maybe someone has an idea how to implement it? Would i have to write an own material loader and register it in the assetManager and write a shader supporting all my wished features aso?

I’m pretty cluesless atm.

This feature exists, use the lighting.j3md material definition and set your normal map with material.setTexture(“NormalMap”,yourMap);

I know that there is the lighting.j3md.

Maybe i posed my question a bit unclear.:smiley:

I want to know wether there is a possibility to alter a material created by the blender ogre exporter script in any way to use the lighting.j3md.

So to speak something like this:

[java]material ElevatorRoom


receive_shadows on





ambient 0.500000 0.500000 0.500000 1.000000

diffuse 0.640000 0.640000 0.640000 1.000000

specular 0.500000 0.500000 0.500000 1.000000 12.500000



texture Textures/stygian_ore.jpg




texture Textures/stygian_ore_normal.jpg





No you have to create your own material.

Afaik, materials exported from ogre only support one diffuse texture.

But really, your material file (.j3m) should be like this

Material MyMaterial : Common/MatDefs/Light/Lighthing.j3md {

MaterialParameters {

Ambient : 0.500000 0.500000 0.500000 1.000000

Diffuse : 0.640000 0.640000 0.640000 1.000000

Specular 0.500000 0.500000 0.500000 1.000000

Shininess : 12.5

DiffuseMap : Textures/stygian_ore.jpg

NormalMap : Textures/stygian_ore_normal.jpg




So i have to change every material. Thats pretty uncool. :smiley:

Well. Maybe i will write an importer for that one or something like this. Let’s see what ideas come and what I’m capable of doing. :smiley:

Tanks, so far. :slight_smile:

Edit: I just noticed, that th blender ogreexporter has a template function for materials. I will c wether i get this one working.

The Blender Importer in jME3 should support normal maps, although that is not tested yet. I don’t think its that much of a big deal to make the material files manually: it takes significantly longer to make the model itself in comparison