Game Development Community

Textures

by Taylor Wiebe · in Constructor · 06/30/2007 (5:32 pm) · 3 replies

Hi, I am curious how do you add normal maps to textures (I am really not quite sure how all this works). I can texture fine but I want it to be somewhat like a bump map (if that is what a normal map is like) I tried this program called Crazy Bump but now I don't know how to add it into the constructor.

#1
06/30/2007 (6:27 pm)
I don't think Constructor supports bump or normal maps in the editor itself. TGEA does and the Moderation Kit for TGE.
#2
08/11/2009 (5:22 pm)
i think what he wanted to know was how do you add a normal map to a texture

regardless of what he uses for diff modeling this should still be possible if he is using tgea

so how is it done (and yes i know constructor dosnt support normals but there has to be SOME way to add them to a level after the constructor phase)

or more simply put

if i create a texture and a normal map how do i combine them to get the effect of a bumpy wall or floor
#3
08/11/2009 (9:51 pm)
First off, Constructor and TGE are out of the picture. It's possible with TGE + Modernization Kit, but I won't go there...

You use a materials.cs script and define a new material for your object. Each material corresponds to a texture file for your object. materials.cs files are located/created in the same directory of the texture(s) you wish to use.

For example, the Swarmgun uses both a texture and a normal map, plus it has a specular effect (it's shiny). These textures are found in the "scritpsAndAssets/data/shapes/weapons/swarmgun" directory. The materials.cs file is found in the same place. Code is in place to automatically read/exec any materials.cs files that are found. Inside this file is where you define your "material".
new Material(w_swarmgun) // Name of your material
{
   mapTo = "w_swarmgun";
   baseTex[0] = "w_swarmgun"; // This is the color/diffuse texture
   bumpTex[0] = "w_swarmgun_bump"; // This is the normal map you wish to use
   pixelSpecular[0] = true; // This makes things shiny (based on the alpha channel in your normal map)
   specular[0] = "1.0 1.0 1.0 1.0"; // The color of the shiny bits
   specularPower[0] = 32.0; // How shiny it is
};
And that is just a bare example of how to include a normal map in order to have "bump maps".

For further reading and knowledge refer to the High Level Walkthrough of Materials page of the online documentation.