This is an old revision of the document!
Importing own static models into Cafu is very easy and only requires a modelling program that can export into the ASE file format.
Now you have to create your model texture shader. You have to know what a texture shader is and how to create it. There is a tutorial for this that can be found here. Although it features everything you need to know here is what my texture shader (which contains informations about my textures) looks like:
Models/Static/tutorial-model/box <- texture path/name { diffusemap Models/Static/djcrate03_diff.png <- diffuse texture path normalmap Models/Static/djcrate03_norm.png <- normal map path red ambientLightRed green ambientLightGreen blue ambientLightBlue }
The only difference compared to a normal texture shader is that a model texture shader also features the following key words:
red ambientLightRed green ambientLightGreen blue ambientLightBlue
After you have created your texture shader, you have to do the following: In order to let your texture work, you need to give the material you applied to your model your texture name/path. Like this, my material is named:
Models/Static/tutorial-model/box
The right material name is VERY important, if you don't apply it, the engine WONT find the texture!
Every texture has to have it's own model part. You can't apply 2 textures to a model that features only 1 part. This also means that that you need a bigger shader file.
Here is an example archive containing an example model + textures + shader.
Download: 2 Parts/Textures example files (.zip file) Download: 2 Parts/Textures example files (.zip file)
Ok, now export your model and place it into a directory of the Models directory. Note: The path in the textures shaderhas to be right: As an example let's take my shader, the texutre path/name is Models/Static/tutorial-model/box. This means that I have to place my model and my textures into the Static directory that can be found in the Models directory.
The result ingame:
And that's it. It's that easy! If you have a problem, have a look at the example files that can be downloaded here (links below)!
Example files:
Download: Static model example files (.zip file)
Download: Static model example files (.tar file)
Relevant links: