dixx / Die_Chroniken_eines_namenlosen_Spiels

We develop a game just for the sake of learning how to do it. Okay, maybe it's more developing a game engine and using a game as its integration test. We have no real goal besides the learning experience.
Other
1 stars 1 forks source link

how to get meshes from Blender to IrrLicht #9

Open dixx opened 10 years ago

dixx commented 10 years ago

Using Blender, certain materials and properties may be stored for a mesh. What can be retrieved by IrrLicht mesh loaders?

property in Blender 3ds (solid) x ms3b b3d
Material.name yes no no no no
Material.lighting no yes yes yes yes
Material.colors.ambient yes == diffuse no yes == diffuse
Material.colors.specular yes yes yes yes no
Material.colors.diffuse yes yes yes yes yes
Material.colors.emissive yes no yes yes no
Material.textures yes no no no no
Material.physics
Material.reflection yes no no no no
Material.shinieness yes no yes yes no
Material.transparency yes no no no
Mesh.properties
Bones
Animations.keyframes yes no yes
Animations.names no
Animations.weights yes no yes
Particle_effects
Camera_and_lights yes if asked if asked
saves unused materials yes no yes no saves only 1 at all!
other can in no way hold material names text format, export left-hand as per default breaks the mesh, crashes the game.

How to export .x correctly: How to export .3ds correctly:

dixx commented 10 years ago

.x: Materials are saved by Blender by name and unsorted, with special chars replaced by '_'.

dixx commented 10 years ago

So this seems to be a bigger issue, as the Blender export of .x and .3ds differ substantially. For instance, .3ds exports the XYZ orientations 'as is', and .x exports Y and Z flipped. .3ds exports right-handed, .x exports left-handed. This is a biiiig mess.

dixx commented 10 years ago

Blender 's .x export only supports the following lightings: specular, diffuse, emmissive. Also the shinieness factor is supported. The transparency must be set to the applied texture, instead of the material. Blender's .3ds export seems to support all and everything so far, has to be confirmed with Irrlicht import.

dixx commented 10 years ago

Blender 2.7 supports alot more .x export functions, however the mesh is still drawn 'mirrored' just remember to export left-handed. It does not provide more material properties than before.

Conclusion: with the current export script, .x seems to be no option for animated objects because of the lack of properties saved. We must check other animation mesh formats, like ms3b and b3d, where the latter seems to be preferred by Irrlicht.

dixx commented 10 years ago

b3d Export is not supported in Blender; However, here is a script for it: http://www.rtsoft.com/forums/showthread.php?7509-Blender-B3D-2-6x-Export-script

dixx commented 10 years ago

It seems that in any case, either the Blender export is broken or the Irrlicht import doesn't work well. .x is shit, .b3d is big shit, .ms3d seems to break the mesh and leads to a crash in the game for unknown reasons. In no case were the material names, textures or reflection supported.

dixx commented 10 years ago

ms3d corrupts the mesh if does NOT consist of only one big triangle fan. Blender does not support this properly. So there is only one way: to check if Blender support is ok, and if so, write an own Irrlicht mesh loader for either .x or .b3d.

dixx commented 10 years ago

.md2 (Blender export script can be found here: https://groups.google.com/forum/#!topic/junaio-developer/9NUaSP5V28w) supports basically the same as b3d.

dixx commented 10 years ago

ok, let's try to tweak the .x Irrlicht importer to get the values correctly. Especially the material names, as we can then tweak every material in Irrlicht.

dixx commented 10 years ago

Irrlicht materials don't support names! I'm soooo close to giving up.

dixx commented 10 years ago

.md2 seems to only support one material.