[Tutorial] Making a new BASIC texture & normal map.

Users who are viewing this thread

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.
Code:
export_dir = "C:/Program Files/Mount&Blade/Modules/Learning Mod/"
After you've done it, save and close. Now open module_game_menus.py and paste this code under start_female.
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 ~#
If you did it right, it should look like this.
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!!!
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 ']'.
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 ~#
If you did it right, it should look like this.
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 ~#

]
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.

73666067.jpg


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.
tunictex.jpg

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.
tunicnormal.jpg

PART 4 - Test it!
40801648.jpg

mb4.jpg

mb3v.jpg
mb2h.jpg
mb1.jpg

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. :smile:
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.
 
To be honest, I find a spec map to be of more use here than that normal map.

Try to convert the image before converting into grayscale and paint with black and white in where the clothes would hang. That'd make the normalmap much more useful.
 
Well yes, I agree, it's not the best. This tutorial was meant to only show how to get normal maps in-game, and besides, I'm still learning myself, too. :smile:
 
Lacking PS, I don't know how I would make the normal map. I assume that's a special filter only found in PS?

Never mind. There's a plugin for Gimp that seems to work just fine.
 
i found this tutorial very useful.  :grin:

btw, is the opacity included with the normal map? if not..
can you also make a step-by-step tutorial on how to add an opacity map to a .dds file or something? and
what are the steps involved in setting it up in brfedit to get it in-game.

i'm trying to  import this armor in my mod:



for this, i think i need a diffuse map, a bump(normal) map, a specular map (for shiny gold), and an opacity map (for the translucent wings).
although, i think they said you could use a normal map and use a specular shader and get the benefit of bump and specular shader.

specular_skin_shader, which seems to work more like a specularmap rather than actual bumpmap, though
this pseudo bump effect looks pretty neat plus it has the advantage of being able to display speculars as
well which dot3 doesn't do. The colouration is the result of using a normalmap as a bump map rather than
an actual grey bumpmap. However, both are using the same "normalized" bump texture indicated in the
material's bump field.

in this thread

http://forums.taleworlds.com/index.php/topic,61402.msg1589318.html#msg1589318

do you know what shader to use to achieve bump+specular+opacity effects in brf edit?

 
rorschach82 said:
do you know what shader to use to achieve bump+specular+opacity effects in brf edit?

Currently you can't have speculars working with bump map shaders in M&B. It should be possible when the expansion comes out. Also, I'm not 100% sure on this but I don't think you can have transparency along with bump mapping or speculars either with the current available shaders.
 
i read in a thread somewhere that you can use multiple meshes for the same object and assign different materials and shaders for each.
however, it doesn't seem to be applicable to armors yet...

anyway, how do you add an opacity in brf edit? what are the settings for that?
(there doesn't seem to be a slot for opacity maps, unlike bump maps and specular..)  :???:
 
[quote author= rorschach82]do you know what shader to use to achieve bump+specular+opacity effects in brf edit?[/quote]
Nope, sorry. As far as I know, only  one shader per model is possible. So you're gonna have to make a choice. :sad:

[quote author= rorschach82]i read in a thread somewhere that you can use multiple meshes for the same object and assign different materials and shaders for each.[/quote]
I'm quite sure that multi-meshes ONLY work for scene-props.

[quote author= rorschach82]anyway, how do you add an opacity in brf edit? what are the settings for that?[/quote]
I can't think of any native model which use an Opacity map. So I also can't see a reason why they would add the Opacity map feature. :/

Also, nice armor. And thanks Lumos! :razz:
 
cdvader said:
[quote author= rorschach82]anyway, how do you add an opacity in brf edit? what are the settings for that?
I can't think of any native model which use an Opacity map. So I also can't see a reason why they would add the Opacity map feature. :/
[/quote]

Grass, trees, bushes, them vines hanging in Veluca and in some taverns. Their opacity (or rather, transparency) is contained in the alpha channel.
 
[quote author= amade]Grass, trees. Their opacity (or rather, transparency) is contained in the alpha channel.[/quote]
I'm dumb. Lol. I thought there was a transparency map or something for them...

[quote author= rorschach82]anyway, how do you add an opacity in brf edit? [/quote]
Try using the flora_shader.
 
Updated the main thread... Hopefully, more understandable now.

cdvader
 
thanks. but now does anyone know how to specular map? i did same thing and toggled specular map enable, but it doesn't seem to change anything in-game

norms.jpg


norms2.jpg
 
Back
Top Bottom