Post by barabbah on Dec 27, 2023 9:47:35 GMT
FYI - how to bumpmap/envmapmask VtMB with Gimp 2.8 & Bloodlines SDK (by Icicle)
I always write myself little instruction files so I don't forget how to do things.
I thought I would share this time just so everyone can benefit. I was beating my head against my computer (not literally lol) for 9 hours trying to figure this out so to save anyone else the frustration just use these steps and you're guaranteed to have a shiny/bumpmapped look to your model in-game.
Ready your texture for mapping through Bloodlines SDK in Windows file explorer:
1. Choose your texture, right-click the .ttz and convert it to .tga.
First we create the normal map...
Normal/bump map through GIMP 2.8 free image editor: (<< this creates the bumps on your model)
2. Open the .tga in GIMP.
3. Choose menu Filter > Map > Normalmap.
4. Click the 3D Preview button and, as you adjust settings, keep rotating the square to get an idea of how your texture is going to pop up when rendered in-game.
5. Select from the Filter drop down, try them all until you see one that looks best...it can vary depending on the image.
6. Minimum Z: min 0 max 1.0, this is the lowest height on your normal map (increasing this seems to make things pop less, useful if the bumps are good but seem to pop out too much).
7. Scale: min -100 max 100, changes the overall direction of bump and how strong the results are. Results vary depending on the filter you used. In general it also changes how high/low things get. Adjust it up and down and observe the results, pick what looks good.
8. Conversion: Sometimes you won't use this, but using it changes how the normal map is made by targeting different groups of pixels, such as by their color for example. If your normal map seems too crazy or you only want to isolate certain details of the image this can be useful.
9. (only for map textures, not for models): Wrap. Check this and it will pattern seamlessly.
10. (only if your normal map seems to be upside down): Invert X/Y. Check this to flip the map.
11. Click OK.
12. Gimp considers RGB 127,127,255 flat, but Source engine considers 128,128,255 as flat. So to adjust our image do the following:
12a. There should only be one layer. Make sure it is selected in the Layers list.
12b. Now click the Channels tab above the layer. Hold CTRL and click the blue channel so it is DESELECTED. Every other channel should be selected now except for blue.
12c. Choose menu Colors > Color Balance.
12d. Leave the settings on "Midtones" and adjust the Red and Green values both to 1, but leave Blue at 0.
13. If you want to edit your normal map, you can remove any bumps/divets you don't want by choosing the Brush tool. Set the hardness to 100 (you don't have to but it's easier to clean up stuff if you do). Now make sure the color is set to RGB 128,128,255... draw over anything you don't like. To quickly and easily change your brush size, use the [ and ] keys.
14. For safekeeping, Export this image as a .tga. (CTRL-Shift-E.) After you click Export, make sure the RLE Compression checkbox is UNCHECKED. You don't want compression. Then just click Export again.
Second we create the specular map or "envmapmask"...
Spec/env map through GIMP 2.8 free image editor: (<< this creates the shininess on your model)
15. Open the original .tga file of your texture again (not the normal map you just made).
16. Choose menu Colors > Desaturate.
17. Choose Lightness, Luminosity, or Average ... it previews it for you. Note, black is not shiny, white is totally shiny, and grey is in-between (depending on its brightness). So if your image isn't mostly black, pretty much everything is going to look shiny (usually this is bad).
18. Choose the brush tool again, set your color to black (RGB 0 0 0, make sure). Now paint over anything you don't want to be shiny until all those areas are black. To quickly and easily change your brush size, use the [ and ] keys. If you're having trouble with the darkness causing lack of detail in the image, open the original .TGA file, Select All (CTRL-A), Copy (CTRL-C), switch back to your greyscale image and choose menu Edit > Paste As > New Layer. Now go over to the layers in list in the right, click on the new layer you just pasted in (it will have color in it), then move the opacity slider down (50% should be OK, but put it as you like). Now make sure you click back on the layer of your greyscale image so it is selected (that's the one it will draw into when you are using the brush tool). This way, you'll be able to see your original colored texture as a ghostly transparent image over top your grayscale, but you'll only be painting on the grayscale. Helps a ton...
19. Optional but helpful: You can use Brightness/Contrast to make things shinier or duller, but if you already have black areas you probably don't want to change them.
19a. Choose menu Select > By Color (Shift-O). In the left side, make sure Threshhold is 0 (you can set it higher but you probably shouldn't). Now click on a black part (truly black, as in RGB 0 0 0). Now all the black parts should be selected.
19b. Choose menu Select > Invert (CTRL-I). Now everything except the black parts will be selected.
19c. Choose menu Colors > Brightness-Contrast, tweak the brightness/contrast until you have things as you like.
20. Now look at your surfaces. For example a character's coat. For consistency and a good look, you should make the shininess the same over the whole coat. If you don't, only parts of it will shine the most, and the rest will shine less. Would you buy a coat that was half shiny and half dull? I don't think so bub. So press O (the shortcut key for Color Picker Tool) and choose a shade of gray you will use for the whole coat in this case. Now choose brush tool again and paint over the coat carefully. Start with the edges and make sure it doesn't bleed into anything else that isn't supposed to shine etc. To quickly and easily change your brush size, use the [ and ] keys. Hardness 100 is also good here, anything less will leave artifacts in its wake. Once you have those tricky edges painted over, just increase your brush size and zip around the inner parts filling them in.
21. You should have a fairly black image with areas that are smeared with grey and maybe white for anything super lustrous and shiny. This is good. You don't need lots of detail in an envmask.
22. If you made an extra layer using the original texture as a guide, click on that layer, then right-click it and Delete it.
23. For safekeeping, Export this image as a .tga (CTRL-Shift-E.) After you click Export, make sure the RLE Compression checkbox is UNCHECKED. You don't want compression. Then just click Export again.
Third we must combine our normal map and specular/envmapmask images into a single image file, like so:
Combined normal/bump map and env/spec map in one image through GIMP 2.8 free image editor:
24. Now open up your Normal map .tga again, select it all (CTRL-A) and copy it (CTRL-C), and paste it into a new image. (CTRL-Shift-V.)
25. Go to the layers list on the right side again. Click on your layer (should only be one) so it is selected, then right-click it and choose Add Layer Mask. It doesn't matter what you choose in this list because we're going to paste over it, so just click the Add button.
26. By default this creates a layer mask and selects it, you'll notice the thumbnail for your layer has gotten smaller and a new thumbnail is beside it that looks solid white or black. It may be hard to notice but the new white/black part is also selected automatically, and has a white border around it. Leave this as it is. (Just click on it if you deselected it, make sure it has the white border.)
27. Now click on the Channels tab above the layers again.
28. Click the eyeball symbols beside Red Green and Blue so they disappear. You only want to have the eyeball beside Alpha channel showing.
29. Now open your Spec/env map .tga up, select all (CTRL-A), copy (CTRL-C).
30. Go back to the new image we are working on, and paste (CTRL-V). The alpha channel should change immediately. You will see a ghostly transparent image of your env/spec map.
31. Now you can click where the eyeballs of Red/Green/Blue are to bring them back. Notice your normal map image in this file is now also ghostly and transparent. Good!
32. Go back to the Layers list. You will see a Floating Selection listed above your only Layer. Right click this Floating Selection and choose Anchor Layer. The Floating Selection will disappear, as it has now merged with your only Layer.
33. Export this image as a .tga (CTRL-Shift-E) - make sure it is named the same as the original texture but with "_normal" at the end of its name. For example if you used "tor0female.ttz/tth/vmt" as your texture then your normal/env map texture file should be "tor0female_normal.tga". After you click Export, make sure the RLE Compression checkbox is UNCHECKED. You don't want compression. Then just click Export again.
Lastly we need some finishing touches so our maps will affect their texture in-game:
Finish creating your normal/env mapped texture through Bloodlines SDK in Windows file explorer:
34. Now go to the .tga file you just saved.
35. This new file needs to be paired with the texture you started with to be used in-game. If it's not in the place where it's going to be used in-game, move it there now. (For example, if it's a character put it in /VtMB Folder/YourProjectDir/materials/models/character/npc/blahblahwherever/).
36. Right-click the .tga and use the Bloodlines SDK to convert it to .ttz. This also generates a .VMT file - good, we need that.
37. Now you have the original texture in this folder, and your new map texture you just created.
38. Right-click the original texture's .VMT file and edit it in Notepad (or whatever you use).
39. Though you may make adjusments to this template in some cases, in general it needs to be like this:
VertexLitGeneric
{
"$basetexture" "models\character\pc\female\toreador\armor0\torf0body"
"$bumpmap" "models\character\pc\female\toreador\armor0\torf0body_normal"
"$envmap" "env_cubemap"
"$normalmapalphaenvmapmask" "1"
}
40. Save and exit.
41. Now right-click your new texture (the _normal one)'s .VMT file and edit it too:
VertexLitGeneric
{
"$basetexture" "models/character/pc/female/toreador/armor0/torf0body_normal"
"$normalmapalphaenvmapmask" "1"
}
42. Save and exit.
43. You'll need a .mdl that references this texture to see it in-game. If you're just changing something already in the game, then it should work right now. If you are making something new, you'll need to make changes to a copy of a .mdl and point it to this file (outside the scope of this tutorial).
44. Now your model in-game should look shiny in places that are well lit, also if you look closely there should be areas that seem to pop out (or stick in) better thanks to the normal map.
All done.
Social Media