collapse

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Bumpmapping VtMB and general stuff...  (Read 11332 times)

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Bumpmapping VtMB and general stuff...
« on: January 30, 2017, 11:55:37 AM »
For anyone who doubts or doesn't know what bumpmapping can do, here's a quick example.

First of all, in VtMB bumpmapping is a trick of the light. If light is on something, then the reflection can be modified to give the appearance of dips or bumps in a surface by how the light is drawn over the object.

There's no actual groove or bump in the model, but it looks like there is. For regular purposes, game developers use bumpmaps to add fine detail to models without having to overcomplicate the 3D mesh with lots of tiny things. This saves on processing power etc.

But in VtMB, we would use bumpmapping to improve the detail of something. We aren't concerned with the model's mesh because we simply can't add or delete any vertices in the mesh anyway, such as when changing the models in Blender.

Getting a bumpmap to look really good isn't easy unless you have a good tool. Some tools like GIMP come with a normalmap maker, and my guide to models & textures uses GIMP so anyone can start doing this for free.

The example I'm going to show you is done with GIMP however I must say I am not 100% satisfied with the result. Later I will probably find another program that does bumpmaps a little differently. GIMP's normal map plugin can handle quite a lot of images just fine, but in this case it didn't do a great job.

The images I'm showing you below are the Last Round seats to your right, just as you've entered the bar.

Here's what they look like after I recolored them (otherwise no change from original):


Here's what they look like after a bumpmap/specmap that took me about 5-10 mins to get right:


If you look very closely you can see the dips in the material of the seats now appear to actually dip in instead of it just being black shading.

As I said, it's a trick of the light. So you aren't going to notice bumpmaps if light isn't shining across something.

I've seen bumpmaps elsewhere in other games where there is no shine needed to create this effect (just ordinary light shading, light is always required), but like I said, I haven't been able to track down how this might be done in VtMB yet.
« Last Edit: February 02, 2017, 07:10:46 AM by Icicle »

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #1 on: January 30, 2017, 12:34:51 PM »
GIMP is a great tool (for being free), but if you want to do a really specific thing like Normalmapping, it's better to find a superior tool.

Enter AwesomeBump, a free tool specifically for auto-generating your Normalmap/Bumpmap and Specmap masks just from your original texture! After seeing what this can do with no tweaking, I'm not going to use GIMP for generating my normalmaps anymore!



This is with NO TWEAKING of any settings, just loading my texture image of the seat covers, generating a normal map and spec map, saving, and merging the two in GIMP for use in VtMB. What a difference, wow!

Compare this with the screenshots of the original (flat, boring!) and the ones I had GIMP generate (which I actually had to heavily modify myself which took a lot of time!)...this is an incredible tool.

Anyone who uses AwesomeBump should check out the tutorials by the creator of the program. It's not exactly that user friendly if you don't...
« Last Edit: January 30, 2017, 12:40:45 PM by Icicle »

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #2 on: January 30, 2017, 12:49:46 PM »
Here's the same thing but I edited the VMT to tint the reflection a little bit green so it matches the surface of the seat:




Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #3 on: January 30, 2017, 12:55:06 PM »
This might be the key to getting normal maps to work without spec shine:

Code: [Select]
"LightmappedGeneric"
{
"$basetexture" "asphalt/Asphalt"
"$basetexturetransform" "center .5 .5 scale 2 2 rotate 0 translate .5 .5"
//"$bumpmap" "asphalt/asphalt_normal"
"$surfaceprop" "concrete"
//"$specularfocus" "5"
//"$specular" "1"
}

This is from the original asphalt texture's .VMT.

Troika left some normal maps in the original but most are disabled in the VMT, presumably because they were in a rush to finish and didn't want to release a game with half things normal mapped and half not. I'm not sure.

I'm going to try these settings out and see if I can get normal maps/bumpmapping to work on things like rock, which shouldn't be shiny at all.

(And yes, I'm literally going to normalmap every texture in the game that it's appropriate for, if I can get this going :D)

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #4 on: January 30, 2017, 01:16:33 PM »
Well, Troika's asphalt normal map is a dud, it either doesn't work or is so weak that you can't see the effect.

So I'm looking at /ground/, and I see that the Vesuvius rock texture has a normal map:

Code: [Select]
"LightmappedGeneric"
{
"$basetexture" "ground/vesrocklava"
"$BUMPMAP"  "ground/vesrocklava_normal"
"$surfaceprop" "rock"
}

So I'm going to try it this way.

Another thing I noticed is that in the VTF viewer, this normal map has "Normal Map" box checked, whereas the asphalt one didn't.

I made my own asphalt texture which is really exaggerated so I would definitely notice the effect. I'll try it now...

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #5 on: January 30, 2017, 01:27:19 PM »
Well, it wasn't working at first, but I figured out what was wrong by looking at the Vesuvius rock normal's texture properties in VTF viewer.

To make a working normal map texture, you can't just right-click a TGA and convert it to .ttz/.tth. That's too automatic, it's setup for a different purpose.

So you have to open VTFEdit from the SDK yourself. Then you go up to File > Import and choose your normalmap image. Set the Normal Format and Alpha Formats to DXT1. Set the Texture Type to Volume Texture. Then click OK.

The last thing you gotta do is look in the Flags box in the bottom left. There's a flag that says "Normal Map". Check this, then save the file as a .VTF. From there go to this VTF and right-click it -> convert it to .ttz/.tth.

In the diffuse(the ordinary picture, not the normalmap) texture's .VMT, you just add this line:

Code: [Select]
"$bumpmap" "path/texturename_normal"

I'm going to test with and without those specular lines and then post my results in a moment with screenshots.

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #6 on: January 30, 2017, 02:17:20 PM »
Taking longer than expected, as I've tried several things with weird varying results, but nothing as I'd like.

The last step I've tried involves using a black spec map combined into the normal map, but then the game complained that the map wasn't recompiled so it said it was "ignoring" the texture...so I'm recompiling the la_hub_1 map right now to test.

Model textures behave immediately, but world textures are more fussy.
« Last Edit: January 30, 2017, 02:19:00 PM by Icicle »

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #7 on: January 30, 2017, 02:31:38 PM »
Involving spec mask, even a black one, produced weird and undesirable results (lots of weird black lines around where bumps should be). So that won't cut it.

I went back to just a normal map again, and tried it, and it changed to black smears across the sidewalk I'm testing this on. It might require a recompile again, so I'm recompiling la_hub_1 once more...

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #8 on: January 30, 2017, 02:41:33 PM »
No, it's just not working. It's having an effect, there's smears of black shading and lighter shading across the sidewalk cement. But it looks bad, and doesn't match the bumpmap at all. Could be additional parameters needed here, I'll keep trying

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #9 on: January 30, 2017, 02:45:31 PM »
Ok, I figured out that for some reason, even though the resolution of the bumpmap is the same as the texture I'm trying it on, it's squishing it down to 25% of the size and repeating it over the face of the texture.

Code: [Select]
"$bumptransform" "center .5 .5 scale .25 .25 rotate 0 translate 0 0"
This makes it stretch properly across the surface. "scale .25 .25" tells it to do only 1/4 of what it was doing without this line in the file.

The bumpmap I'm using looks bad so I'll make more until I find one that shades it right.

It's not making actual bumps appear, though. I'm disappointed in that and if all this results in is some shading, screw it - I could do that myself by editing the texture directly.

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #10 on: January 30, 2017, 03:12:09 PM »
Not only does it not display the bumps but it's actually smearing the normal map and blurring out its details, which is odd.

I can see this through the mat_normalmaps 1 command.

I just reloaded the map in hammer, saved and I'm recompiling, in case that makes a difference...it often does with textures, so who knows.

I also dread that maybe compiling in Fast Mode might disable bumping on world textures? That would mean I have to compile in Default or Final mode to be sure, wowww that will take a while. I'll probably choose a smaller map then...
« Last Edit: January 30, 2017, 03:17:45 PM by Icicle »

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6675
  • Reputation: +886/-28
  • Unofficial Patcher
Re: Bumpmap Example
« Reply #11 on: January 30, 2017, 03:19:43 PM »
The images I'm showing you below are the Last Round seats to your right, just as you've entered the bar.

Just a quick comment from me. While the new bumpmapping there shows fine 3D grooves, the whole material has changed in appearance from soft cloth to shiny plastic! You should avoid that otherwise the graphics will look as artificial as in Doom 3 and Prey at the time bumpmapping effects were overdone.

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #12 on: January 30, 2017, 03:25:40 PM »
The images I'm showing you below are the Last Round seats to your right, just as you've entered the bar.

Just a quick comment from me. While the new bumpmapping there shows fine 3D grooves, the whole material has changed in appearance from soft cloth to shiny plastic! You should avoid that otherwise the graphics will look as artificial as in Doom 3 and Prey at the time bumpmapping effects were overdone.

Right, this is an example, and also, it's not cloth, look at the texture. There's shine drawn into it (light spots) all over it. It's more of a vinyl cover (seen on car seats, diner seats, bar seats), which is shiny (but not that shiny, but it depends on the way the surface was prepared during manufacture). This can be toned down with a tint, just make it darker (but still green); or the specmap can have its brightness turned down, both can be used to slightly different effect this way.
« Last Edit: January 30, 2017, 03:36:12 PM by Icicle »

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #13 on: January 30, 2017, 04:01:03 PM »
Hmm, seems like AwesomeBump isn't so awesome for some kinds of textures, like this concrete flooring one I'm trying now.

So it's good to have multiple tools. GIMP did a good job for this run.

Interesting... Just using the $bumpmap and $bumpmaptransform lines, and reloading the map I'm testing on in Hammer, made the floors look noticeably darker. I made the texture extremely deep and bumpy so I'd definitely notice a difference.

Time to recompile in Fast and test, and if that fails, in Final mode and test...
« Last Edit: January 30, 2017, 04:03:40 PM by Icicle »

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Bumpmap Example
« Reply #14 on: January 30, 2017, 04:31:38 PM »
Nailed it!

Ok, here's how you get world textures bumpmapped in VtMB.

Without even using any external program, the SDK can normalmap for you right away.

1. Open the VTFEdit tool.
2. Choose File > Import.
3. Choose a TGA file of a texture.
4. Set Normal Format and Alpha Format to RGBA8888. Set Texture Type to Animated Texture.
5. Make sure "Generate Normal Map" is ticked under Normal map. Important: You may wish to reduce the scale number. A map that is too deep will make all the little details get shaded a lot, which makes a smeared mess of shadowed blotches across your textures when they're not well lit. It looks like someone dropped black soot on the ground then stomped it flat. No what you want is a small amount of detail.
6. Click OK. Now do File > Save and save it in the same dir as your original texture, with the name <texturename>_normal.vtf.
7. Right-click the .VTF and convert to .TTZ/.TTH.
8. There may be a .VMT here from when you saved as .VTF - delete it, normal maps which are solo don't need a VMT of their own.
9. Edit the .VMT of the original texture, insert this line:
Code: [Select]
"$bumpmap" "path/materialname_normal"
In my case since I have double-sized textures I also need:
Code: [Select]
"$bumptransform" "center .5 .5 scale .25 .25 rotate 0 translate 0 0"
Save. You can test it in game now, but it if doesn't work, reload the map in Hammer, then recompile it and test then.

Result?

Every texture is shaded dynamically based on light sources around it. This is FAR superior to drawn-in shading because it's dependent on position in the world!

As usual this is an ILLUSION, bumps aren't actually there. It's meant to accentuate details drawn into the texture by looking like they catch the light; because it's dynamic, this makes them more realistic!

However like I said, if you overdo it will look awful. Only major details should be made to shade, the rest should stay the same. SO you're going to need to be able to make normalmaps outside of VTF Edit sometimes, as it won't always do a perfect job - however you can try it first, and just keep tweaking the Scale value down, and it might produce a fine result with very little effort.

Screenshots soon, as my tests were deliberately exaggerated and bad-looking just so I would know it works.
« Last Edit: January 30, 2017, 04:35:35 PM by Icicle »

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal