cdvader
Introduction.
In this tutorial I will show you, or at least try to show you how to edit existing textures, make a new completely from-scratch normal map and also set it all up in-game. Now what is a normal map, you ask?
[quote author= Wikipedia]In 3D computer graphics, normal mapping, or "Dot3 bump mapping", is a technique used for bump mapping. It is used to add details without using more polygons. A normal map is usually an RGB image that corresponds to the X, Y, and Z coordinates of a surface normal from a more detailed version of the object. A common use of this technique is to greatly enhance the appearance and details of a low polygon model by generating a normal map from a high polygon model.[/quote]
Now that you know what is a normal map, or what it's meant to be, we can move on.
What do we need?
Mount & Blade - Version 1.011.
Mount & Blade - Module System for Version 1.011.
BRF Edit v0.8.9.5
Adobe Photoshop or GIMP.
Photoshop DDS/NormalMap Plugin or GIMP NormalMap Plugin and Gimp DDS Plugin.
PART 1 - [OPTIONAL] Setting stuff up.
Alright. First we need to set everything up so we could always check our progress, etc. Go to Program Files/Mount&Blade/Modules. Now make a copy of Native and rename it to "Learning Mod". Now download AND set up the Module System. Once you've got it all set up, go to your Module System folder and open module_info.py. Change the export_dir to this.
After you've done it, save and close. Now open module_game_menus.py and paste this code under start_female.
If you did it right, it should look like this.
Close and save again. Let's move on - Now open module_items.py and scroll down to the very bottom. Add this before the ending ']'.
If you did it right, it should look like this.
Now hit build_module.bat. If you did everything as I said, it will compile fine. If not, check for any syntax errors in your new code. Okay. Now go to Mount&Blade/Textures folder. Copy "arena_armorB.dds" to Mount&Blade/Modules/Learning Mod/Textures. Rename it to "tunic_tex.dds". Then make a copy of it and rename it to "tunic_normal.dds". Phew, texture stuff is set up - Time for the .brf file. Go to Mount&Blade/CommonRes and open "arena_costumes.brf". Select "arena_tunicB" and then press the Export button. Save it to desktop. Also, make 100% sure you export as .SMD. Rename it to "tunic_mesh.smd". Open BRFEdit. Go to File > Settings and set the Module to "Learning Mod" and press OK. Then go to the Tex (Texture) tab in the upper left corner. Press on "Add" in the lower left corner twice. Rename the first one to "tunic_tex.dds" and the second one to "tunic_normal.dds". Now move on to the Mat (Material) tab. Press "Add" only once. Set the name as "tunic_mat", shader to "dot3", Diffuse to "tunic_tex" and Bump to "tunic_normal". HINT: If your material shows up as completely black in the window, then it's all okay. It's meant to go black for some reason. Now go to Mesh tab. Press Import in the upper left corner. Import "tunic_mesh.smd" what we saved on the desktop. Make sure "Previously SMD (10x)" is ticked and "Y/Z Axis swap" is unticked. Click on "tunic_mesh" and change the material to "tunic_mat". Now the mesh should disappear. Save your .BRF as "tunic.brf" to Mount&Blade/Modules/Learning Mod/Resource. Now your mesh should come back (Yes, looks rather black, but it will be fixed later).
Finally, all set up.
PART 2 - [OPTIONAL] Editing the "tunic_tex.dds" to make it look more custom.
Alright. Open Photoshop or whatever tool you're using to modify your pictures. I'm doing it in Photoshop. Right. File > Open and browse to Mount&Blade/Modules/Learning Mod/Textures and open both of them, "tunic_tex.dds" and "tunic_normal.dds". First select "tunic_tex.dds". We'll edit that one first. Change and edit it to your liking.
Here's how my "tunic_tex.dds" looks like in the end. Basically, I marked the areas I wanted to edit with the Polygonal Lasso Tool, took the Brush tool, put the colours to "R - 100", "G - 0", "B - 0" so I got a dark-red colour. Set the brushes opacity and flow to 40% and painted. Then I got a random picture from the internet, took out the parts I wanted with the Polygonal Lasso Tool, copy-pasted it to "tunic_tex.dds" and set the mode to Multiply.
PART 3 - tunic_normal.dds - The Normal Map.
Okay, so we finally get to making the normal map. It's very simple. First open both, your "tunic_tex.dds" and "tunic_normal.dds". Press M, then select and copy everything from "tunic_tex.dds" to "tunic_normal.dds" Working with "tunic_normal.dds", delete the Background layer. Now go to Filter > nVidiaTools > NormalMapFilter. My settings are "Invert Y, 4 sample, scale 1, Average RGB, Unchanged". Everything else is unticked / 0. Press OK.
Ok, that done, now Duplicate the layer (You can press CTRL + J for that). Set the duplicated layer to Overlay. Now keep duplicating until you reach your wanted result. Then go to Layer > Flatten Image. Now Filter > Blur. Do it twice or so. Now go back to "tunic_tex.dds" and press the M key and select everything again. Copy it and then go back to "tunic_normal.dds", press on the "Channels" tab, click on "Alpha 1" and then Paste. And you are done!
Save both, "tunic_tex.dds" and "tunic_normal.dds" as DXT5. Your end result should be something like this.
PART 4 - Test it!
Final notes.
Alright, tutorial finally ended. I hoped I made myself clear enough. This is, after all, my first tutorial. I think I'll add some screenshots later explaining what I do, and also expand the tunic_tex editing part.
Please post feedback on the tutorial. I want to see other peoples normal mapped models too, and I'd also like to know how to make my tutorial better.
cdvader
Credits.
Thanks to MartinF for the Quick Character menu.
Thanks to Thorgrim for the BRF Edit.
And, of course, a big thanks to Armagan for Mount & Blade.
In this tutorial I will show you, or at least try to show you how to edit existing textures, make a new completely from-scratch normal map and also set it all up in-game. Now what is a normal map, you ask?
[quote author= Wikipedia]In 3D computer graphics, normal mapping, or "Dot3 bump mapping", is a technique used for bump mapping. It is used to add details without using more polygons. A normal map is usually an RGB image that corresponds to the X, Y, and Z coordinates of a surface normal from a more detailed version of the object. A common use of this technique is to greatly enhance the appearance and details of a low polygon model by generating a normal map from a high polygon model.[/quote]
Now that you know what is a normal map, or what it's meant to be, we can move on.
What do we need?
Mount & Blade - Version 1.011.
Mount & Blade - Module System for Version 1.011.
BRF Edit v0.8.9.5
Adobe Photoshop or GIMP.
Photoshop DDS/NormalMap Plugin or GIMP NormalMap Plugin and Gimp DDS Plugin.
PART 1 - [OPTIONAL] Setting stuff up.
Alright. First we need to set everything up so we could always check our progress, etc. Go to Program Files/Mount&Blade/Modules. Now make a copy of Native and rename it to "Learning Mod". Now download AND set up the Module System. Once you've got it all set up, go to your Module System folder and open module_info.py. Change the export_dir to this.
Code:
export_dir = "C:/Program Files/Mount&Blade/Modules/Learning Mod/"
Code:
#~ Learning Mod Quick Character for Mod Test Begin ~#
("start_mod",[],"Quick Character",
[
(troop_set_type,"trp_player",0),
(assign,"$character_gender",tf_male),
(assign,"$background_type", cb_noble),
(assign,"$background_answer_2", cb2_page),
(assign,"$background_answer_3", cb3_squire),
(assign,"$background_answer_4", cb4_revenge),
(troop_add_item, "trp_player","itm_tunic_normalmap",imod_plain),
(change_screen_return, 0),
]),
#~ Learning Mod Quick Character for Mod Test End ~#
Code:
#This needs to be the first window!!!
(
"start_game_1",menu_text_color(0xFF000000)|mnf_disable_all_keys,
"Welcome, adventurer, to Mount&Blade. Before you can start playing the game you must create a character. To begin, select your character's gender.",
"none",
[],
[
("start_male",[],"Male",
[
(troop_set_type,"trp_player",0),
(assign,"$character_gender",tf_male),
(jump_to_menu,"mnu_start_character_1"),
]
),
("start_female",[],"Female",
[
(troop_set_type,"trp_player",1),
(assign,"$character_gender",tf_female),
(jump_to_menu,"mnu_start_character_1")
]
),
#~ Learning Mod Quick Character for Mod Test Begin ~#
("start_mod",[],"Quick Character",
[
(troop_set_type,"trp_player",0),
(assign,"$character_gender",tf_male),
(assign,"$start_mod", 1),
(assign,"$background_type", cb_noble),
(assign,"$background_answer_2", cb2_page),
(assign,"$background_answer_3", cb3_squire),
(assign,"$background_answer_4", cb4_revenge),
(troop_add_item, "trp_player","itm_tunic_normalmap",imod_plain),
(change_screen_return, 0),
]),
#~ Learning Mod Quick Character for Mod Test End ~#
("go_back",[],"Go back",
[(change_screen_quit),
]
),
]
),
#This needs to be the second window!!!
Code:
#~ Learning Mod New Items Begin ~#
["tunic_normalmap", "Powerful Tunic", [("tunic_mesh",0)], itp_type_body_armor |itp_covers_legs ,0, 27 , weight(2)|abundance(100)|head_armor(100)|body_armor(100)|leg_armor(100), imodbits_cloth ],
#~ Learning Mod New Items End ~#
Code:
["rabati", "Rabati", [("rabati",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
#~ Learning Mod New Items Begin ~#
["tunic_normalmap", "Powerful Tunic", [("tunic_mesh",0)], itp_type_body_armor |itp_covers_legs ,0, 27 , weight(2)|abundance(100)|head_armor(100)|body_armor(100)|leg_armor(100), imodbits_cloth ],
#~ Learning Mod New Items End ~#
]
Finally, all set up.
PART 2 - [OPTIONAL] Editing the "tunic_tex.dds" to make it look more custom.
Alright. Open Photoshop or whatever tool you're using to modify your pictures. I'm doing it in Photoshop. Right. File > Open and browse to Mount&Blade/Modules/Learning Mod/Textures and open both of them, "tunic_tex.dds" and "tunic_normal.dds". First select "tunic_tex.dds". We'll edit that one first. Change and edit it to your liking.
Here's how my "tunic_tex.dds" looks like in the end. Basically, I marked the areas I wanted to edit with the Polygonal Lasso Tool, took the Brush tool, put the colours to "R - 100", "G - 0", "B - 0" so I got a dark-red colour. Set the brushes opacity and flow to 40% and painted. Then I got a random picture from the internet, took out the parts I wanted with the Polygonal Lasso Tool, copy-pasted it to "tunic_tex.dds" and set the mode to Multiply.
PART 3 - tunic_normal.dds - The Normal Map.
Okay, so we finally get to making the normal map. It's very simple. First open both, your "tunic_tex.dds" and "tunic_normal.dds". Press M, then select and copy everything from "tunic_tex.dds" to "tunic_normal.dds" Working with "tunic_normal.dds", delete the Background layer. Now go to Filter > nVidiaTools > NormalMapFilter. My settings are "Invert Y, 4 sample, scale 1, Average RGB, Unchanged". Everything else is unticked / 0. Press OK.
Ok, that done, now Duplicate the layer (You can press CTRL + J for that). Set the duplicated layer to Overlay. Now keep duplicating until you reach your wanted result. Then go to Layer > Flatten Image. Now Filter > Blur. Do it twice or so. Now go back to "tunic_tex.dds" and press the M key and select everything again. Copy it and then go back to "tunic_normal.dds", press on the "Channels" tab, click on "Alpha 1" and then Paste. And you are done!
Save both, "tunic_tex.dds" and "tunic_normal.dds" as DXT5. Your end result should be something like this.
PART 4 - Test it!
Final notes.
Alright, tutorial finally ended. I hoped I made myself clear enough. This is, after all, my first tutorial. I think I'll add some screenshots later explaining what I do, and also expand the tunic_tex editing part.
Please post feedback on the tutorial. I want to see other peoples normal mapped models too, and I'd also like to know how to make my tutorial better.
cdvader
Credits.
Thanks to MartinF for the Quick Character menu.
Thanks to Thorgrim for the BRF Edit.
And, of course, a big thanks to Armagan for Mount & Blade.