Author Topic: Bump mapping  (Read 2362 times)

Offline Kazan_HB

  • Skinner Team
  • Silver Member
  • ****
  • Posts: 899
Bump mapping
« on: January 21, 2012, 07:57:47 AM »
Discussion of http://bbs.hitechcreations.com/smf/index.php/topic,327361.0.html.
 I think here is a better place. :)
 Yes for some file is not too much work. And what I must send to Skuzzy, everything again?
Whether I can see bump mapping? at my new skin. What filename for bmp?
The Few
Since Tour 93

Offline Kazan_HB

  • Skinner Team
  • Silver Member
  • ****
  • Posts: 899
Re: Bump mapping
« Reply #1 on: January 21, 2012, 03:02:29 PM »
I have found the files. We have three file together.
example:
Spit9.bmp
Spit9_b.bmp bump mapping
Spit9_b_a.bmp specular mapping
The Few
Since Tour 93

Offline Chilli

  • Platinum Member
  • ******
  • Posts: 4278
Re: Bump mapping
« Reply #2 on: January 21, 2012, 03:11:56 PM »
Thanks Kazaan and Greebo for this thread.  I think your last post answers my question about bare metal, if I am correct that there are more than one bump map files, and the specular file would addresss reflective properties.

Let me know if I am out in left field please.  :D

Offline Greebo

  • Skinner Team
  • Platinum Member
  • ******
  • Posts: 7009
Re: Bump mapping
« Reply #3 on: January 21, 2012, 03:29:00 PM »
The next version of AH has some new features that relate to skins. Specifically bump mapping and specularity mapping. You can see these effects by downloading the beta which is linked from the beta forum. Note not all rides have these effects enabled yet, however the P-51D and I believe the P-47s have amongst others. You may need to go into advanced video settings and turn bump mapping on to see the new effects, this may impact on your framerate on lower end PCs.

Bump mapping allows your video card to raise or lower portions of the skin, i.e. sunken panel lines or raised rivets. Specularity mapping allows you to make areas of the skin shiny or matt, very useful for bare metal skins.

Skinners can add these effects to their existing or future skins. The skins will need to be (re)submitted to HTC for approval with the new files. For resubmissions remember to include the skin number you were given with the acceptance email as it saves HTC a lot of time processing them. Note bump and specularity maps are not a requirement for new skins. If you don't want to add them you can submit a skin without them.

The beta includes an updated version of the skin viewer. Note the beta viewer only works in the beta folder. Do not try and move it or direct it to your normal AH skin folders.
If you run the beta viewer, select an aircraft or GV and hit "save textures" it will create a new folder in the beta's skins folder with all the skin files in it, including the new specularity and bump map files. Delete any unneeded files (instruments, damage etc.) and you are left with the following, these are for a P-47D-25 but the principle is the same for all rides:

You have some of the same files as before:

p47d25.txt     The hangar name file (squadron/group etc.)
p47d251.bmp  The basic 256 colour skin file.
material.txt    The lighting adjustment file. This is still active when a player does not have bump mapping selected on his FE.

You also have some new files:

p47d251_B.bmp     The bump map image file.
p47d251_B_a.bmp  The specularity map image file.
p47d251_B_d.txt    The text file that controls how much effect the bump map image has on the skin.
bumpmat.txt         The material file that takes over when a player has bump mapping turned on.

Some GVs will also have extra bump and spec map files for the tracks and/or AA MG.

Whichever skin you save textures for should produce all these files to get you the file names. However if that ride has not yet been updated with bump and spec maps in the beta, the extra files will be dummies and have no usable content.

I will post again tomorrow about what you do with these files to bump map your skins, I'm a bit tired right now.




Offline FTJR

  • Silver Member
  • ****
  • Posts: 1996
Re: Bump mapping
« Reply #4 on: January 22, 2012, 02:53:28 AM »
Thanks Greebo for the explanation, I have a question, but I will wait for your next post, to see if it covers it.

Regards
Bring the Beaufighter to Aces High
Raw Prawns      

B.O.S.S. "Beaufighter Operator Support Services" 
Storms and Aeroplanes dont mix

Offline Greebo

  • Skinner Team
  • Platinum Member
  • ******
  • Posts: 7009
Re: Bump mapping
« Reply #5 on: January 22, 2012, 06:00:13 AM »
After you've created a new skin folder with the relevant files in it, you need to edit the new files to suit your skin. Start by making new multi-layer image files for your editing software. So in the case above and for Photoshop these would be p47d251_B.psd and p47d251_B_a.psd. Save both these as 1024 by 1024 256 shade greyscale images. I usually load the skin's bmp image into the editing software and save it to the new file names. Using the skin's image as the basis for the new files means the image can be used for lining up new layers pasted across from the original skin file. Note you won't need to convert these using Bright when you eventually save them as bmps.

The image below shows part of the default F6F-5 skin on the left, the bump mapped version in the middle and the spec mapped version on the right.

The bump mapped image is mostly grey shade 128/128/128. This is the neutral shade and is the lowest visible layer on the skin file, the bump map has no effect on parts of the skin this shade. The darker areas are sunken into the surface and lighter areas are raised. Deep holes are black, while panel lines are just slightly darker. You need to play around with this a bit in the viewer and flying offline to get the levels you feel happy with. Less is more with panel lines and rivets I find. On the F6F (and most Spits) the fuselage had raised rivets and the wings flush rivets. So on my bump map I have made the fuselage rivets lighter and the wing rivets very slightly darker to represent this. The canopy and wing fairings have been raised above the surface slightly, as have brackets on the gear doors, wheel rims etc. Most of this stuff was simply copy/pasted from the original skin file as whole layers, so it need not take long. It is entirely up to you how much or little of this you want to add to your skin. You may also be able to use parts of the default skin's bump map like the gear parts if you also used those parts on your base skin.

There is a text file that controls how much of an effect the bump map image has on the skin. In the case of the file names we are using here this would be p47d251_B_d.txt, the file's data is shown below:

#texture name, Bump width, Bump height, U scale, V scale
#    bump width and bump height are optional but must be present
#    if U scale and V scale are used.  U and V scale are also optional
P47D251_B,35.000000,0.250000

You can ignore the first three lines, the last one is the one you may need to edit. Also U and V scales have no use on player skins, they are mostly for terrain objects. The first part of the last line is the name of the bump map file, the second part gives us the scale being used relative to the 1024 pixel width of the tile. The P-47 fuselage takes up the whole of the width of the tile and is about 35 feet long minus its prop hub, so 35.000000 gives us the scale. The last number is the depth being used, in this case 0.25 of a foot or three inches. So doubling this last number would double the effect of your bump map image on the skin overall. The scale number does not have to be precise, just in the right ball park. So a four engined bomber might be nearer 80 feet for the same 1024 pixels and the same 0.25 foot drop would then have much less effect on the skin.

One more thing about bump mapping. The video card does not actually create little bumps and hollows on your skin when it is bump mapped. What it does is create highlights and shadows on the skin as if there were bumps or hollows there. These effects are only visible in the game or viewer as reflections of the sun. So you need to put the surface being viewed between your POV and the sun to see the effect.

Specularity map effects to follow.

« Last Edit: January 22, 2012, 06:28:48 AM by Greebo »

Offline Kazan_HB

  • Skinner Team
  • Silver Member
  • ****
  • Posts: 899
Re: Bump mapping
« Reply #6 on: January 22, 2012, 06:30:21 AM »
Today I made ​​small test
For specular mapping, I was tired :)




The Few
Since Tour 93

Offline Greebo

  • Skinner Team
  • Platinum Member
  • ******
  • Posts: 7009
Re: Bump mapping
« Reply #7 on: January 22, 2012, 06:53:45 AM »
The specularity map is built in a similar way to the bump map. Start with a base layer that is a greyscaled version of the original bmp so you can line other layers up accurately against it. Rather than thinking about how raised or sunken objects are you need to thing about how shiny they would be. Darker shades on the spec map file are duller on the skin, lighter shades are shinier.

In the case of the F6F shown above, the base blue paint was semi gloss but this tended to dull down with age. The white paint was duller so I've made the markings a slightly darker shade to represent this. The paint chips shown on the prop are shiny and so are much lighter, as is the glass on the light covers and bulbs. The paint chipped rivets are also lighter. Tyres and panel lines are dull so they are darker and so on. Use seperate layers for each material, its much easier to edit later on that way.

Note that shiny materials, as on bare metal skins, tend to show up the bump mapping effects to a greater extent than dull ones. So you may want to tone down the bump mapping effects a bit on these skins relative to one with dull camouflage paint.

The maximum shininess of the skin is controlled by the bumpmat.txt file. This is very similar to the material.txt file and does the same job but only when the player selects bump mapping. Here are the two files from the P-47D-25:

Material.txt
0.361,0.361,0.361,Ambient
0.639,0.639,0.639,Diffuse
0.000,0.000,0.000,Emissive
0.450,0.450,0.450,Specular
10.000,Power

Bumpmap.txt
0.361,0.361,0.361,Ambient
0.639,0.639,0.639,Diffuse
0.000,0.000,0.000,Emissive
1.000,1.000,1.000,Specular
10.000,Power

The only difference between them is the Specular line. In the case of the material.txt file the specularity of the whole skin would be 0.450, about midway between fully matt 0.000 and fully shiny 1.000. On the bumpmat.txt file this line is set to full gloss 1.000. However this is only the maximum shinyiness any part of the skin can be. The only parts of the skin that will be this shiny are those that are painted pure white on the specularity map. Anything that is a shade of grey will be less shiny than this. In short just take your original material file and make the fourth line: 1.000,1.000,1.000,Specular for the bumpmat file.
« Last Edit: January 22, 2012, 07:06:44 AM by Greebo »

Offline FTJR

  • Silver Member
  • ****
  • Posts: 1996
Re: Bump mapping
« Reply #8 on: January 22, 2012, 09:14:23 AM »
Thanks Greebo
Bring the Beaufighter to Aces High
Raw Prawns      

B.O.S.S. "Beaufighter Operator Support Services" 
Storms and Aeroplanes dont mix

Offline Krusty

  • Radioactive Member
  • *******
  • Posts: 26745
Re: Bump mapping
« Reply #9 on: January 24, 2012, 10:27:16 AM »
This is fascinating as far as skin improvements go.

Just to sum up, so I get this straight in my mind...

So 128/128/128 solid fill would be the same as "no bump map" essentially, correct? Any darker/lighter colors on that BMP file would then work as the bump map. This has to be used in conjunction with bumpmap.txt.

Then on the specularity side, you do NOT have an additional txt file, because it's going to work in conjunction with the materials.txt file?

This changes a couple BMF planes I'm working on... heck it gives me some very interesting ideas for non-BMF planes too....

Oooh, the potential! So much to do, so little time!  :D

Offline Greebo

  • Skinner Team
  • Platinum Member
  • ******
  • Posts: 7009
Re: Bump mapping
« Reply #10 on: January 24, 2012, 12:34:57 PM »
Krusty you summarized the the bump map stuff correctly, but not the specularity.

For each skin that employs a spec map there will be two text files needed for specularity: material.txt and bumpmat.txt. As now material.txt controls the overall specularity of the skin for when a player chooses in video settings to not have bump mapping active on his PC. Bumpmat.txt takes over for those players who do have bump mapping selected. For bumpmat.txt you just change the specular line to full specularity, i.e. 1.000, because the specularity map reduces the skin's specularity in different places as needed.

Offline Krusty

  • Radioactive Member
  • *******
  • Posts: 26745
Re: Bump mapping
« Reply #11 on: January 24, 2012, 12:54:51 PM »
Ooooooohhh....

So we have to build skins with a bit of LOD built in? We have to do the materials and also the specularity file to account for whatever the player chooses?

Too bad you can't set the materials and the spec map just uses that (i.e. a mask). Wouldn't that be the same results? Or maybe I don't fully understand it until I play around with it like Kazan is doing.

Offline Greebo

  • Skinner Team
  • Platinum Member
  • ******
  • Posts: 7009
Re: Bump mapping
« Reply #12 on: January 24, 2012, 01:13:34 PM »
Material.txt is exactly the same file as you would include with a skin now. You are just adding a second material.txt file called bumpmat.txt which only comes into play when the player selects bump mapping. This has nothing to do with LOD, the second file is simply there to allow the spec map to control the skin's specularity rather than the material file.

I wouldn't worry about it Krusty, the text files will become clear as soon as you work with them.

Offline Krusty

  • Radioactive Member
  • *******
  • Posts: 26745
Re: Bump mapping
« Reply #13 on: January 24, 2012, 03:42:20 PM »
By LOD I meant that because that's what it is, kind of. Instead of tied to distance it's tied to user settings.

You're right. I'll probably catch on fast once I get into it hands-on.


EDIT: Do we need the beta to preview this? Can we do this for skins that aren't updated in the game yet, or do we have to wait until we get HTC approval to do certain skins this way?

Offline oboe

  • Plutonium Member
  • *******
  • Posts: 9805
Re: Bump mapping
« Reply #14 on: January 24, 2012, 03:49:24 PM »
I think I missed something, does LOD - Level of Detail?