The Making of the Bumpmapping Mod
Section One:
Introduction
So here I am, writing a tutorial in Microsoft Word about how to write shaders and make textures for specularly enhanced models. There were a few of you that expressed interest in getting this tutorial in their hands, so here it is, at long last. This tutorial may be short, but for all of you that are fond of the âbumpmappingâ effect my solution puts on the gun models, you will be delighted to know that the effect can actually work on ANY model in the game. Unfortunately, though, it doesnât work well on all map textures, justâŠbecause. It probably has something to do with the trisâŠorâŠsomething. Thatâs the problem I ran into with putting this effect on the default map textures, in case you were wondering why I hadnât lived up to that. Anyway! On to what I came here to do!
Section Two:
Making the Texture
And now we come to the main purpose of this document. If you follow these simple steps correctly, you will soon have your very own âbumpmappedâ model.
DEFINITION OF SPECULAR LIGHTING: Lighting on a surface that is calculated by the game engine and can moveâor be movedâacross that surface like a shiny highlight.
As you may have guessed, this is the method by which I have made this mod. I manufactured the textures in GIMP (a FREE alternative to the $400-$900 Photoshop program) using Lighting Effects and then used them as a Specular Map on a given model, using specialized shaders. A Specular Map is the texture that is overlaid onto the existing texture of a surface when the light hits that area. This is what allows the shiny appearance. Its shader keyword is âlightingSpecular.â However, weâll discuss that later, in Section Three. For now, letâs just get through those steps of manufacturing such a texture. Follow me to the next page, where weâll see the texture weâll be modifying.
NOTE: If you do not have GIMP or Photoshop, YOU WILL NEED THEM. This tutorial is written under the assumption that the user is utilizing GIMP. Download GIMP here: http://www.gimp.org/downloads/ . Click the link, press âGimp 2.4â at the topmost download section, and you should have the program in a little while. Patience!
THIS IS THE TEXTURE!
IT IS THE SKIN FOR THE BLASTER RIFLE.
Start up GIMP or Photoshop and open up this included image (blaster_r.jpg) that is contained in the âBumpmappingâ folder included in the .zip folder you downloaded for this tutorial. Once you have the file open, you can immediately begin lighting the texture with bumpmapping for the finished Specular Map. Go to Filters > Light Effects > Lighting Effects to get to the menu where you can apply the effect. Follow these stepsâŠ
Step 1: The Menu
Step 2: Turn on Bumpmapping under the Bump Map Tab
Step 3: Decrease âMaximum Heightâ to 0.03 and then move on to the Materials tab and enter the following values, moving the blue dot in the Preview Pane to the shown position
Step 4: Press Okay
This was only a quick mock-up of what this kind of Specular Map should look like. If you want the finished effect to look more like my Bumpmapping mod does, youâre going to have to increase the âShinyâ value to something like 1.50 or above. After applying this filter with the settings shown in Step 3, you should end up with something that looks basically like this (turn to next page to see)âŠ
Does this look too bumpy for youâor, possibly, not bumpy enough? No problem. Just press Ctrl and Z to undo these changes and then go back to the Lighting Effects menu and tweak some parameters around. I donât have that luxury right now, since Iâm the one writing the tutorial, soâŠletâs get on to writing the Specular Shader!
Section Three:
Writing the Shader
So now youâve gone to all the trouble of downloading GIMP (well, maybe) and baking this texture with one of its many filters, right? Well, you should have, and if you didnât, I command you to, right here and now, march right back to the beginning of Section Two and bake that texture. Honestly, it doesnât really matter if you use this texture or notâyou can use any you want; this was just an example.
Well, all your hard work wonât pay off unless you write a shader file! Never written one before? Well, thatâs fineâthatâs not what this tutorial is about. In fact, Iâm going to GIVE YOU THE SHADER and just have you paste it in there! Sound easy? Thatâs because it is! Now open up Notepad. If you donât know what THAT is, then youâre pretty sad. Still, I should probably tell you how to open it anyway! Press âStartâ (thatâs down on the big bar at the bottom of the screen right now, you know) and then go to All Programs, Accessories, and then click on Notepad. It will open up right awayâitâs not that big of a program.
Copy and paste the entire below block of text into the blank .txt Notepad gives you:
models/weapons2/blaster_r/blaster_r
{
q3map_nolightmap
{
map models/weapons2/blaster_r/blaster_r
rgbGen lightingDiffuse
}
{
map models/weapons2/blaster_r/blaster_r_spec
blendFunc GL_SRC_ALPHA GL_ONE
rgbGen identity
alphaGen lightingSpecular
}
}
If the directory âmodels/weapons2/blaster_râ doesnât already exist in the base folder of your JA directory, youâll have to create it, then save the new Specular Map you just made into âmodels/weapons2/blaster_râ. The Specular Map needs to be named âblaster_r_specmask.jpgâ for this to work, unless you change the Specular Lighting stage to refer to a different filename/directory. If you have no idea what Iâm talking about, then just leave your new shader as it is and save it as whatever you want.
HOWEVER! You WILL need to save it as a .shader file, which means that in the Save window you will have to select the All Files *.* option and then type the .shader file extension after the filename (blaster_spec.shader , for example). If you do not save it in this manner, the mod WILL NOT WORK.
After youâve done all this, it is safe to compile it all into a new .pk3 using Pakscape and release to the community (if you want)! If you donât want to release it, just put the .pk3 in your base folder and it will work as a new mod, and whatever model texture you just modified will, if all goes well, shine with specular brilliance next time you look at it.
Hmm. Do you know how to make .pk3s? Am I being too cautious? Well, maybe, on both accounts. And, though it pains me to do so and this is NOT a tutorial on .pk3-making, I should probably put an extra section in here, anyway, just in case you DONâT know how to.
GrrrrrrrâŠâŠâŠâŠâŠâŠâŠ..Well, here it is!
Section Four:
Pakscape and Compiling the Mod
You people make me really angry, you know that? Anyway, here we go.
Step 1: Downloading Pakscape
If you donât already have Pakscape, you can get it here: http://jediknight3.f.../Pakscape;31681
Step 2: Create Your .pk3
Press File > New to open up a blank .pk3 template. Here is what it looks like:
Step 3: Populate the .pk3
This is where you âfill the real estateâ of your new template. There is one guideline you must go by, though. In order for any of your .pk3 content to work, you must make it refer to the original content it replaces. For instance, you want to place your new Specular Map in the right directory so it doesnât show up as a missing texture in-game. So, you need to know which directory it should go in. See that second âparagraphâ (itâs actually called a âpassââeach âpassâ is closed off by a block of this: { and this: } so that it can be properly organized) in the shader code I gave you in Section Threeâthe one that starts off with map models/weapons2/blaster_r/blaster_r_spec? Well, thatâs the paragraph that tells the mod where the Specular Map is located and what to do with it. Map, at the very beginning of the âparagraph,â tells what texture to draw there, so if that texture canât be found, then thereâs going to be some âblack-and-white box troubleâ! Weâd better fix it so that doesnât happen, wouldnât you say?
To do this you need to recreate that exact directoryâmodels/weapons2/blaster_r/âto tell the game where to look for that special texture. Do this by first clicking on that little slash underneath âUntitled1â in the blank Pakscape template and then going up the âObjectâ menu and clicking New Directory. Name the new directory models. Double-click on models to enter it and then, once inside, create another new directory called weapons2. Finally, inside weapons2 you should create the folder blaster_r and youâre all set to import your Specular Map! So, go up to the Object menu again and click âImport Fileâ. Travel in the new window that pops up to the place where you stored the image and double-click on it to import it. After populating the Specular Map directory and file, you also need the shader to make it all work. So click on that little slash under Untitled1 again, create a new directory there called shaders, and import the file you put my little block of shader text into.
There! If you followed every step correctly, you should now end up with a .pk3 that looks basically like this in its directory tree:
If it does and you have put everything in the right place, then your mod should WORKâjust once you save it in your base folder! Yes, thatâs where you put all your OTHER mods, as wellâbut this time you have made your OWN! Hoorah!
Step 4: TEST AND ENJOY
Once you have done all this, open up your game, switch your gun to the Blaster Rifle, and see it shine! If it doesnât, youâve done something wrongâor you just need to make the Specular Map shine a bit more intense.
Congratulations! Youâve just made your own shiny blaster! Good luck on all your future exploits, whether they be in furthering your modding talents or using the talents you already have.
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now