User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
textures:myfirst [2005-09-12 16:47]
Stormtrooper created
textures:myfirst [2013-01-07 12:07] (current)
Line 1: Line 1:
-This tutorial has 2 part. The first part covers ​textures ​for maps and the second part covers skins for models.+====== Using own textures ​======
  
-__**Part 1: Map textures**__ 
  
-Create your textureThen save it into one of the supported file formats (those are: .jpg, .png, .tga, .bmp).+This tutorial has 3 partThe first part covers textures for maps, the second part covers skins for models and the third part skybox textures.
  
-Go into your Ca3DE directory (Ca3DE-MDK -> Projects -> Ca3D-Engine) and from there into the textures directoryGames -> DeathMatch -> TexturesThere it should somehow look like this:+===== Part 1: Map textures ===== 
 + 
 +Create ​your texture. Then save it into one of the supported file formats (those are: .jpg, .png, .tga, .bmp).
  
 +Go into your Cafu directory and from there into the textures directory: **Games -> DeathMatch -> Textures**. There it should somehow look like this:
  
 +{{textures:​tut1_1.jpg}}
  
 Now create a new directory, I call mine "​tutorial"​. Go into it and place your texture there. I call my texture "​texture1",​ it consists of a diffuse map, a normal map and a specular map. I add endings to the different textures to exactly know which texture is which type. My diffuse maps have a _diff tag in their name, normal maps get _norm, specular maps get _spec and luminance maps _lum (not necessary to give them those tags though). Now create a new directory, I call mine "​tutorial"​. Go into it and place your texture there. I call my texture "​texture1",​ it consists of a diffuse map, a normal map and a specular map. I add endings to the different textures to exactly know which texture is which type. My diffuse maps have a _diff tag in their name, normal maps get _norm, specular maps get _spec and luminance maps _lum (not necessary to give them those tags though).
Line 14: Line 17:
  
 Let's go back to the DeathMatch directory. There you can find the "​Materials"​ directory in which all shader files are placed. They can be opened with simple text editors like notepad. If you open for example the "​generic.cmat"​ file, you can see that it contains informations about various textures. The system works like this: Let's go back to the DeathMatch directory. There you can find the "​Materials"​ directory in which all shader files are placed. They can be opened with simple text editors like notepad. If you open for example the "​generic.cmat"​ file, you can see that it contains informations about various textures. The system works like this:
-''​Textures/​directory_name(in which the textures are palced)/​texture name+<​code>​Textures/​directory_name(in which the textures are palced)/​texture name
 { {
-type_of_texture Textures/​directory_name/​texture_patch +    ​type_of_texture Textures/​directory_name/​texture_patch
 } }
-''​+</​code>​
  
 The best way to describe those shaders is to actually have a look at them. Here is the shader for my texture: The best way to describe those shaders is to actually have a look at them. Here is the shader for my texture:
 +<​code>​
 Textures/​tutorial/​texture1 Textures/​tutorial/​texture1
 { {
-diffusemap Textures/​tutorial/​texture1_diff.jpg +    ​diffusemap Textures/​tutorial/​texture1_diff.jpg 
-normalmap Textures/​tutorial/​texture1_norm.jpg +    normalmap Textures/​tutorial/​texture1_norm.jpg 
-specularmap Textures/​tutorial/​texture1_spec.jpg +    specularmap Textures/​tutorial/​texture1_spec.jpg 
-lightmap $lightmap+    lightmap $lightmap
 } }
- +</​code>​
 If you have a luminance map you would have to write "​lumamap"​ (without quotes). If you have a luminance map you would have to write "​lumamap"​ (without quotes).
  
 It's easy, isn't it? And that's already it! You can save it as yourshadername.cmat or within another shader and it will work. Start your mapping editor and you will be able to use the texture! It's easy, isn't it? And that's already it! You can save it as yourshadername.cmat or within another shader and it will work. Start your mapping editor and you will be able to use the texture!
  
-Download: Tutorial example files (.zip file) +**Download:** {{textures:​tut-textures.zip|Tutorial example files (.zip file)}} 
-Download: Tutorial example files (.tar.gz file)+**Download:** {{textures:​tut-textures.tar.gz|Tutorial example files (.tar.gz file)}}
  
  
-Part 2: Model textures 
  
-Using own skins (model texures) is as easy as using map textures. There are only slight differences.+===== Part 2: Model textures ​=====
  
-Instead of being placed in a directory in the textures directory yo have to place them in one of the directories in the Models ​(like the models themselvesdirectory. Let's say we place them into the Static directory that is placed in the Models directoryOur shader-file has to be placed in the Models directory that can be found in the Materials directoryIt would look like this:+Using own skins (model texures) is as easy as using map texturesThere are only slight differences.
  
 +Instead of being placed in a directory in the textures directory, you have to place them in one of the directories in the Models (like the models themselves) directory. Let's say we place them into the Static directory that is placed in the Models directory. Our shader-file has to be placed in the Models directory that can be found in the Materials directory. It would look like this:
 +<​code>​
 Models/​Static/​mymodelname/​a_name_for_my_skin Models/​Static/​mymodelname/​a_name_for_my_skin
 { {
-diffusemap Models/​Static/​a_name_of_my_skin_diff.png +    ​diffusemap Models/​Static/​a_name_of_my_skin_diff.png 
-normalmap Models/​Static/​a_name_of_my_skin_norm.png +    normalmap Models/​Static/​a_name_of_my_skin_norm.png 
-specularmap Models/​Static/​a_name_of_my_skin_spec.png+    specularmap Models/​Static/​a_name_of_my_skin_spec.png
  
-red ambientLightRed +    ​red ambientLightRed 
-green ambientLightGreen +    green ambientLightGreen 
-blue ambientLightBlue+    blue ambientLightBlue
 } }
- +</​code>​
 There are only small differences:​ There are only small differences:​
 1. you have to add a model name too and not only a texture name ("​mymodelname/​a_name_for_my_skin"​) - note that you can choose whatever you want, those names dont have to meet the model name/​texture name. 1. you have to add a model name too and not only a texture name ("​mymodelname/​a_name_for_my_skin"​) - note that you can choose whatever you want, those names dont have to meet the model name/​texture name.
Line 63: Line 64:
  
 Well that's it! If there are questions, feel free to post them in the forums! Well that's it! If there are questions, feel free to post them in the forums!
 +
 +===== Part 3: Skybox textures ======
 +
 +You can find detailed tutorial concerning the integration of new skyboxes here:
 +
 +  * [[textures:​skydomes#​how_to_integrate_a_skybox_into_cafu|How to integrate a skybox into Cafu]]
 +
 +
textures/myfirst.1126536422.txt.gz · Last modified: 2013-01-07 12:07 (external edit)