Logo
HomeGetting StartedTutorialsDownloadsRenegade ModelsSubmitUser FilesTeamFAQRegisterLog In

Applying a normal map to a W3D with Sdbedit

Author: Canadacdn
Skill:

Normal Mapping a W3D file in Renegade using sdbedit
By Canadacdn


Hi, kids! Do you want to know how to make normal maps for C&C Renegade, to make your vehicles and models look great?


YEEEESSSS!


SHUT UP, YOU LITTLE BRATS!


Heh, sorry about that. Now, let’s get started. To make normal maps, you will need quite a lot of stuff.

- Photoshop

- C&C Renegade

- A Computer

- Renegade public tools

- A normal map filter, or a normal map you already made (Normal map filter for photoshop can be found here for Nvidia cards:
Goto Nvida Plugin Page

- Jonwil’s scripts.dll with the developer tools and example shaders and all that. Any version higher than 3.1 will be good.


Ok, so first, we need convert all the textures for the model into Normal map textures in photoshop. Open up a texture in Photoshop. Go to the menu up top, and go to filter. (The Nvidia tools should be at the bottom if you installed them correctly) Open up the normal map filter, and you should see something like this:



I recommend you set the scale to 10. Hit ok, and you should have a decent-looking normal map texture. Repeat this for as many textures as the model needs.

Save all your normal map textures as .dds or tga. You need to make sure you know they are normal maps, so I put a _n after the name to recognize them later.

After you have all your textures, we will need to know the part of the vehicle that the texture needs to go on.

Go to the renegadepublic tools folder and open up the wdump application. In wdump, open the W3D model that you want to normal map. (I will be using the stealth tank for this tutorial.)

Now, you should see a large list like this:



Open up one of the many chunk_mesh sections and open the names the way I did in the picture above. Select W3D_CHUNK_VERTEX_MATERIAL_NAME and look over to the right, where I have circled the word 'canopy'.

This is the material name of the canopy part of the stealth tank, which is one of many parts. The part of the vehicle you are using should be named there as well.

Leave wdump open, but go to your Renegade folder.

Look for sdbedit.exe. It looks like a Renegade symbol and should be in the 'Data' folder. Open sdbedit, and go to file-open-shaders.sdb.

Now, you should see something like this:



Now, you are going to apply the normal map to the vehicle's part you found in wdump. Highlight 'Normal map shader' on the left, and create a new shader where I have. *The shader MUST have the same name as the vehicle part*! In my case, I am still using the canopy part, so I will be using the canopy normal map texture. Click New Shader.

Now, another window like this will pop up:



For the 'shader filename' click open, and double click 'HLSLnormal_map.fx'

Now, for the 'Normal Map' field, enter the name of your normal map texture with the file extention after the name. *NOTE* if the texture is a .dds, name it with a .tga after the name anyway or it won't work.

There are many different settings you can apply here, but I am going to use the default ones used for the mammoth and flame tank.

Hilight 'Specular Enabled' if it isn't already, and then enter 1.000000 for the three 'Light Colour' fields.

Then, enter 0.300000 for the FIRST three 'Ambient Colour' fields. Leave the 'Surface Colour' alone.

If everything is alright, it should look similar to the picture above.

Hit ok.

Now, go back to wdump, and find all the other parts of the vehicle or model. (Renegade ones have a LOT of repeating ones, there aren't actually as many as it looks) Repeat the process, using the texture for the right part for the normal map.

This can take some trial and error, because sometimes you have to guess which texture to use for some parts. Most of the time it is pretty self-explanatory, though.

After you have applied the textures to the vehicle's parts, go to file-save and overwrite the current shaders.sdb, and quit sdbedit. Fire up Renegade and see if the normal map worked.

If it did, you should get something like I did for the stealth tank:



If your normal map DIDN'T work, or has the wrong texture over the wrong part, follow these steps:

- Make sure you included the file extention (.tga) of the texture in the shader's settings in sdbedit

- If the 'light' is coming from a strange angle, or only one part of the vehicle is 'bumpy', try playing around with the 'Specular Power' number

- Make sure you saved when exiting sdbedit

- Make sure your shaders have the same name as the vehicle part you normal mapped with them

Thanks for reading this tutorial!

-Canadacdn


P.S, Check out the Roleplay 2 mod, at www.roleplay2.com!



This tutorial is for your viewing pleasure only, and hosted by permission of its author Canadacdn. It may not be distributed in any way without the express written consent of the author.

Copyright 2006+ RenHelp.net
Page served in: 0.02 ms, 23 queries.