Shader Files
Creating Shader Files
--------------------------------------------------------------------------------
Strictly speaking, your environment does not need any .shader files, but without them, you will not have any textures. Also, you can have many, many .shader files to specify different shaders for your environment, but for this demonstration we will only be dealing with a simple one, appropriate for a floor or wall in your sample level.
To begin, run H2Guerilla.
Go to the File menu, and select New...
A dialog box will appear asking what type of file you want to create. Select shader from the list and press okay.
You will see a nearly empty window representing the new file. Before you can specify what the shader looks like, you need to select a Shader Template. A shader template defines what basic type of shader you are creating, and there are a lot of them to choose from -- but typically you will just want an opaque surface with a bump map, and possibly a detail or environment map. The functionality of a template is loosely explained by its filename.
To select a template, click the browse button (the little box labelled "..." to the far right on the same line as template is printed). you will see a select file dialog appear.
Browse to the tags folder of your Halo 2 tools installation. From there, browse to shaders, then shader_templates. You will find several folders with different types of templates, but we just want a floor texture, so open the opaque folder. You should now be looking at the contents of tags\shaders\shader_templates\opaque.
There are a lot of these with small differences, but for our purposes select tex_bump.shader_template. This is a template that's opaque, and allows us to specify a diffuse map (color), a bump map (surface relief, bumps and so on), and a detail map (a sort of noise that adds fine grain to the surface in-game). When you have selected tex_bump, press Open.
You will now see a lot more fields available for editing. There are four you want to fill in.
First click the browse("...") button next to base_map, and once again you will see a file dialog. Let's make this a concrete texture, so browse to an appropriate .bitmap file. Bitmap files are the image format Halo 2 uses, so any textures you want to use in a shader need to be in that format. They are created using H2Tool.
Lets make a concrete texture. Browse to tags\scenarios\bitmaps\forerunner\industrial\metals\panels_generic_outdoor and select that bitmap. Yes I know were in metals just stay with me. Press okay, and you will see the base_map line now has panels_generic_outdoor listed.
Since the base map is just the colors of the surface, you will want to give it some relief. This is done using a bump map, specified in the line labelled, appropriately enough, bump_map. Press the browse("...") button go to tags\scenarios\bitmaps\forerunner\industrial\metals and select panels_generic_bump, then press Open.
So now you have a texture with both color, and appropriate bumps and ridges. You want it to have some appropriate grainyness when you get close to it though, right? For this we will use a detail map. Click the browse("...") button on the detail_map line of the shader.
Detail maps are typically stored in the tags\scenarios\bitmaps\detail_maps folder, in a few different folders. Browse there and choose the concrete folder. You should now be looking at the contents of the tags\scenarios\bitmaps\detail_maps\concrete folder.
Select smooth.bitmap, then press Open.
You should now see smooth.bitmap listed for detail_map.
You are almost done, but we need to scale down the detail map, otherwise it will be the same size as the other maps and not give much, well, detail. You will notice that there are scale fields listed for all the maps, though generally you will only want detail to be scaled differently than the others (though there are tricks you can do by editing the other ones, depending on what you want the shader to do). In this case you want the detail map to be scaled much smaller than the other maps, so find the line that reads detail_map_scale_x and click the function button. This is the little button to the far right with f() written on it.
A dialog box will appear with a number of fields in it. The one you want to edit is just below Input, and by default should say 16. This is a little too small (the number dictates how many times this texture tiles for each time the base texture does). Change 16 to 2, and press the enter key on your keyboard.
You should now see value: 2.00 listed next to detail_map_scale_x. Repeat the process for detail_map_scale_y.
Now go to material name at the top of the shader,move your curser over to the long blank section, click on it, go to default material, then go to hard, then go to hard terrain, then hard terrain concrete, select that. Now your shader will act like concrete when someone shoots it in game. Your shader file is now complete! Typically you will want to save new shaders in a folder named after the level they will be used in. But you dont have to, save this one in tags\scenarios\shaders\forerunner\industrial\tech. Go to file, Save as, Go to the tech folder, name your shader file, concrete and press Save. To use this shader in the map put it in Max like this, f_it concrete in the material editer
One more thing you will have to do, Go to data\scenarios\bitmaps\forerunner\industrial\metals\panels_generic_outdoor. Copy and Paste that texture into the tech folder, and change it's the name to concrete. This shader really does look like concrete in the game. This outline will give you a little understanding on shaders.

