MED - Frequently Asked Questions
I've designed a model in MAX, and imported it in MED.
It looks correct in MED, but looks wrong in the engine.
The textures appear different, I can see parts of the backside of the model, and some parts are not textured at all.
Check the transparency of your textures. 32-bit textures have a transparent alpha channel and don't cover parts behind them. That's why you see the backside. When this is not desired, remove the transparency by saving the textures with 24-bit color depth. If some parts are not visible at all, check the surface normals. You can only see a texture on the front of a surface, not on the back.
Another popular reason for a different look in the MED window and in the engine is that the model has a second skin coordinate set for shadow mapping, but no correct shadow map applied. The shadow map is only rendered in the engine window, but not visible in the MED editor windows. If your model has a second UV set, make sure that it also has a correct shadow map, or remove the second UV set (Object / Second UV Set / Remove) when shadow mapping is not desired.
Last but not least, the Material Setup can also give a model a strange look in the engine, especially when models are exported with extreme settings of the specular or alpha material parameters. Go through the skins (Object / Manage Skins / Skin Settings) and uncheck Material Setup when special material settings are not desired.
I've designed a model in MAX, and imported it in MED. It looks basically correct, but the MAX version seems to have more contrast and the edges are sharper.
This is most likely due to the material settings and smoothing groups. Some exporters have problems with that, so you might need to correct this in MED. First look into the skin Material Setup. Some exporters generate a high specular value, which "overshines" the texture details. Also, if smoothing groups are not properly exported, edges look too smooth due to the Gouraud shading. In this case you might need to duplicate the edge vertices in MED.
Q. I've designed my first level in MAX. It's about 300000 polygons, which shouldn't be a problem on a good PC, but when I save it as FBX and import it in MED, I'm getting an error message like "Can't create mesh - model too big".
A. Old 3D cards have usually a limit of about 65536 vertices per mesh, but that's not the main problem. Even if you could import that model and use it as a level in the script, you wouldn't have much fun with it due to a bad frame rate.
The scene manager of a 3D engine can not be used when the whole level consists of one huge single mesh. It then relentlessly renders all 300000 polygons every frame, which does no good to the frame rate. Better import the parts of your level - such a buildings - as separate models of several 1000 polygons each. Or better, import the level in WED - this way it's automatically prepared as a level and separated into many different parts (unless you designed everything from a single mesh). The engine can then determine which parts are visible, and won't render those that aren't.
I have imported bones animation from my favorite editor, but the animation looks distorted.
A: Animation distortions are caused by the following reasons:
- Linear interpolation between frames causes visible distortions when the movement is non-linear, f.i. when bones rotate about their hinges, and there are not enough frames. As a rule of thumb, insert a frame every 10..15 degrees of a rotating movement. This also applies for vertex animation.
- Bones weights causes distortion when the engine uses less bones per vertex than the original animation. Do not assign more bones to a vertex than you've set up with max_bones in the engine. Editions below
do not support more than 1 bone per vertex.
- Moving bones directly by script causes distortions when wrong vertices are attached to the moved bone. Check the vertex assignments of the directly moved bone, especially when using bones weights.
Q. I've imported a model and can see it in
the MED windows, but it is not visible under File / Engine Preview.
A. There are two possible reasons why you can't see an imported model in the engine or in the game:
- The model has a wrong size. It's so small that it's less than a pixel on the screen, or it's so big that the camera is inside it. You can adjust its size in the import dialog or the Edit menu.
- The model is all transparent. Check the skin material alpha settings, and the alpha channel of its texture. A frequent mistake is importing a model with an all-transparent texture - you'll then see it in MED, but not in the engine.
Q. I've assigned an .fx shader to a model skin in MED, but the shader does not work.
A. The shader probably needs parameters - such as variables or textures - from a MATERIAL that you haven't assigned yet to the entity, or haven't set up correctly.
Q. How do I create terrain?
A. Terrains can be created directly, or generated out of images (PCX, BMP). This image files contain an altitude profile and you can create them through terrain generators like Terragen or Bryce (see link page). You can also import a regular, rectangular grid in a model format (3DS, FBX etc.) and convert it to terrain. Make sure that the number of terrain squares in any direction is divisible by 8, so the vertex number should be a multiple of 8 plus 1.
How can I calculate the file size of a model?
A. A model file size depends mostly on the textures and the vertices of the mesh. Every texture pixel uses up to 4 bytes, every vertex up to 32 bytes. Simple models are about 100 KB in size, complex animated models with large textures can be up to 15 MB. If you model ends up with a wrong size, you probably made a mistake on import, such as accidentally converting large bones animation to vertex animation. The texture memory consumption can be largely reduced by using DDS textures.
Q. I use the JPG format for my model textures, as this is the most compressed format. However MED refuses to import JPG skins. I have to load them by script, and noticed that they then still need much memory and don't look good. In fact they look like sh**t.
A. As you can see, the JPG format is normally not suited for textures in 3D games. Under "File Formats" you can read why. Use TGA for good quality, or DDS for low memory consumption.