Issues with blender modeling

Hi all! I’ve actually been exploring the JME sdk for quite a whiles now, and have kinda been neglecting coming to the community.

Without further adieu, I present the issue.

I’ve followed the instructions on the exporting blender models.
Notes: I use the “HoverTank” example to try and debug why my models don’t work throughout.

There’s a few problems:

  1. Using the normal “double click convert to j3o method” does NOT work for normals, as the normal map is mapped on as a diffuse texture of sorts.

Additional info: I’ve simply named the exported material myModel.material and then double clicked on the myModel.mesh.xml to convert to j3o before. This clearly doesn’t work very well with normal map.

Upon further inspection, I noticed that the HoverTank xml formatting is different from blender’s xml formatting you get when you export. Strange.
I also noticed that the material property in the submesh tag of the xml uses the directory of the j3m file, which I attempted to copy. I also modified my mesh’s submesh tag to contain some of the properties HoverTank’s submesh and vertex buffer tags had.

Additional info: “<vertexbuffer positions=“true” normals=“true” colours_diffuse=“true” texture_coord_dimensions_0=“2” tangents=“true” texture_coords=“1”>”

The result was a successful load in the opengl model viewer, but when I load it into the game with AssetManager, the texture is beyond messed and it appears that vertices aren’t joining to their adjacent neighbouring vertices.

Another problem arose at this point:
Any time normal mapping is involved, certain pc’s refuse to render using the above method. I believe I’ve deduced it to be because Intel trolls like a boss, claiming that their graphics cards support certain features that they don’t actually support. I’ve tried the same model on about 3 computers that use a Radeon and so far, all have “rendered” it in the opengl model viewer successfully. I find this rather strange because in the example, HoverTank, it also uses normals and the j3o file provided in the examples loads perfectly fine on my Intel 4000 graphics card.

I also noticed HoverTank doesn’t appear to use shared vertices, which I’m assuming has to do with vertex groups.

I managed to find a converter that converts shared vertices to non-shared, however I’m almost positive that this converter doesn’t quite work the same for bones… and knowing that my animations use vertex groups and my team uses weight painting, even if we do continue with using this method of modifying the xml exported from blender, we’ll inevitably hit a roadblock with animations.

-somewhat gives up trying to translate the Rosetta Stone-

Does anyone actually have a conventional way, or a more specific way to actually export and load into the game (with normals and all other textures) using blender?
There’s got to be something I’m missing as there have been many successful games developed using JME.

I’m almost positive that HoverTank used some other exporting method, aside from the “ogre_exporter”, and I know for sure that it was made using blender (it had a blend source file xD)

Thanks,
-Seen

Moar additional information:

  • if I do load the model in using my method of modifying the xml, certain faces “disappear (wont render)” after a certain point during rotation, instead of having a shadow effect over them.

Image:
Note: The red circle points out a few spots that “should still show their faces but with a shadowy effect since they’re not directly hit by the light”, which are being either culled or clipped of sorts.

erf…the HoverTank mesh.xml is not the best example, because it was modified by hand to directly use the j3m material…it’s kind of a hack.

I’m using the ogre xml exporter a lot, and it works pretty well. BUT…i never export material with it. For 2 reason :

  • It’s kinda easy to create my own material from the textures in JME.
  • Blender and JME materials do not really match so I’d have to tweak the JME material anyway to have something similar.

For your issue, you need to generate the tangents on the model : right click on the geometry “Tools/Generate Tangent”. This is mandatory for proper normal mapping.
Normal mapping use a special coordinate space called tangent space. It’s a coordinate system that is different for each vertex.
The normal of the vertex is the Z axis for this coordinate system, and for proper normal mapping we need the 2 other axis.
Those axis are called Tangent and Binormal (or bitangent) and can be computed from the texture coordinates by using some kind of crazy math.

If those tagents and binormal are not computed for your model they are defaulted with undefined values. So the lighting of your model is completely messed up and can look very different on hardware/computer/even on different run.

nehon so if i create material in jme3 i can go without doing uv unwrap?

no that’s not what I meant.
I mean when you export your model using the orge exporter, you’d better not export material along the model and just recreate it in the jme3 SDK.

Thanks. Everything’s working wonderfully :DD