Help with normal maps/ bump maps

Can't get normal maps working

By llVeXXll 10 months ago

Hi I am having trouble getting my normal maps to show up in game here is an explanation of how I am trying to do it so you can tell me if I'm doing it wrong:

Made my custom texture, which exists as a .vtf and a .vmt in the appropriate folder. Imported the same image into vtfedit again, checked normal format: BGR888 and alpha format: BGRA8888. Checked animated texture (because it wouldn't let me check generate normal map unless animated texture was selected). Checked normal map, pressed ok.

I then had a blue and green and red version of my texture, I saved this as a vtf in the same location with normal at the end of it's name. I went into the vmt mentioned before and added: "$bumpmap" "mytextres/causticnormal".

In game, the normalmap is not showing up at all it's just a normal flat texture. Any help??

17 posts 1,037 views
  • You must be a member

Replies

  • HylianWolf's Levels
    • P1: Beggar
      Points: 8
    • C1: Member
    • A4: Graduate
      Account Age: 2 years
    Posted 10 months ago

    what weapon is that that you edited?

  • llVeXXll's Levels
    • P1: Beggar
      Points: 211
    • C1: Member
    • A2: Tenderfoot
      Account Age: 11 months
    Posted 10 months ago

    its not a weapon its just a texture for a wall or floor etc

    EDIT: I have now got it working for opaque surfaces. It just won't work on a transparent surface.

    User Title
    meow by name, meow by nature
  • will2k's Levels
    • P3: Peasant
      Points: 10,753
    • E4: Teacher
      EF: 117
    • C3: Moderator
    • A4: Graduate
      Account Age: 2 years
    Username
    will2k
    Map Critic
    Posted 10 months ago

    Normal maps should work for both opaque and alpha channeled materials.

    It would be better to work on your normal map in a 2D editor and leave VTFEdit for the .vtf creation only. You can use Photoshop/Paint Shop Pro with the Nvidia normal map filter or the free GIMP as an alternative.

    If you're not comfortable with using 2D editors, then there are couple of programs to generate normal maps

    Make sure that your normal map has the exact same dimensions of your diffuse texture, and that it has the exact alpha channel too. Once you finish editing the 2 textures, save them as . TGA with 32 bit to preserve the alpha channel. Use now VTFEdit to generate the corresponding .vtf.

    The BGRA8888 format is usually used for the uncompressed texture with alpha channel, but I usually use compressed DXT format (it works fine with Orange box source but won't work with EP1 version)

    Make sure to tick the normal map check-box in VTFEdit for the normal map before saving. And don't forget to modify the vmt which you already did.

    To check if your normal map is working, apply your texture to a small test map, load it in-game, then enable cheats and type mat_bumpmap 0 to temporarily disable bumpmaps (mat_bumpmap 1 to restore them). You should immediately spot the difference between bump/nobump on your texture and this will be your proof that your texture is working fine.

    For the sake of it, I just made a quick texture with alpha channel and its corresponding normal map using the method I mentioned above; then I tried it in a small map and the bump maps are working correctly :)

    Hope this helps and good luck in your map

    Will2k

    User Title
    cosa dici!
  • llVeXXll's Levels
    • P1: Beggar
      Points: 211
    • C1: Member
    • A2: Tenderfoot
      Account Age: 11 months
    Posted 10 months ago

    Thanks for your reply Will2k but I am still having problems. Basically. If I create just a normal opaque texture for example a red 128 x 128 square, and then create a bump map using another image (in my case, some waves) then I specify that it must use this bump map in the VMT, then go in game, I can see the bump map of the waves on the red square. If I do exactly the same thing but with a semi transparent red square, or maybe a red square with transparent bits cut out, I cannot get the bump map to show at all.

    I am confused about the term "diffuse image" is this just the image that my bog standard texture is? If so, yes I have been keeping everything the same size, and it's still not working.

    When VTFedit gives me the option of which formats to use for importing an image to make into a bump map, there are 2 fields I must select the format from, normal format and alpha format. I don't know what exact alpha channel my tga gets saved with, so I chose BGRA8888 for that field. As for the normal field, there is no GBR8888 option, only a BGR888 (3 x 8 only) so I used that one. I'm assuming that it I had not used the correct channels it would not show up at all but I could be wrong.

    But all that is for a lightmappedgeneric surface. I have tried my bumpmap on a water shader, where it works perfectly fine, as the water shader does not rely on a basetexture.

    User Title
    meow by name, meow by nature
  • Rafael De Jongh's Levels
    • P3: Peasant
      Points: 19,415
    • E3: Tutor
      EF: 73
    • C3: Moderator
    • A5: Veteran
      Account Age: 5 years
    Skinning/Modelling Expert
    Posted 10 months ago

    Could you post your VMT for a sec I'll have a look!

    Also I wouldn't recommend Crazybump it makes sloppy normals, better use nDo2 or just get used to working and editing with Nvidia Normal Map filter!

    The VMT would probably be the problem here but to be sure post your maps!

    User Title
    2D/3D Artist
  • llVeXXll's Levels
    • P1: Beggar
      Points: 211
    • C1: Member
    • A2: Tenderfoot
      Account Age: 11 months
    Posted 10 months ago

    "LightmappedGeneric" { "$basetexture" "MINE/CROFT/water/bumpmaptest" "$translucent" 1 "$normalmap" "MINE/CROFT/water/causticbumpmap" "$bumpmap" "MINE/CROFT/water/causticbumpmap" $bumpframe 0 Proxies { AnimatedTexture { "animatedtexturevar" "$normalmap" "animatedtextureframenumvar" "$bumpframe" "animatedtextureframerate" "30.00" } } }

    User Title
    meow by name, meow by nature
  • will2k's Levels
    • P3: Peasant
      Points: 10,753
    • E4: Teacher
      EF: 117
    • C3: Moderator
    • A4: Graduate
      Account Age: 2 years
    Username
    will2k
    Map Critic
    Posted 10 months ago

    the .vmt you posted is a bit confusing:

    Is this a water texture? If so, then there is no need for $basetexture here. The surface is a combination of fog color, animated bump map, and reflection. And you don't need the translucent shader either.

    Also the "$normalmap" shader (for DX9 and above) should be different than $bumpmap shader (A Du/dv map for DirectX 8 rendering).

    The animation proxy you added is useless unless your normal map is originally animated.

    If this texture is not water, then you can't use "$normalmap" shader. And as I mentioned, your normal map should be animated in order to use the animated texture proxy.

    What I suggest is to start simple with a simple normal map, a simple diffuse texture (the actual texture you modify in a 2D editor) and a simple vmt to start with. Once you get the basics working, you then move to more complex stuff.

    Would you like me to send you the example texture I made yesterday so you can see the vtf/vmt combination.

    And as I mentioned in my earlier post, and as Rafael confirmed, it's better to make your normal maps in a 2D editor (follow the tutorial link I gave you) and not use vtfedit to generate them.

    Will2k

    User Title
    cosa dici!
  • llVeXXll's Levels
    • P1: Beggar
      Points: 211
    • C1: Member
    • A2: Tenderfoot
      Account Age: 11 months
    Posted 10 months ago

    I don't think I'm explaining myself properly. I have got the basics working. I have managed to get a static normal map to show on an opaque material.

    This is not meant to be a water texture.

    What I am having difficulty with is, when I try to apply a static normal map to a material that has translucency enabled, it wont show.

    The example I pasted was for something else I was trying, I have created an ANIMATED normal map, which works fine when used on a water shader. But when I try to apply this animated normal map on a bog standard lightmapgeneric surface, it won't animate.

    So I have 2 problems: 1.) normal maps wont show on any translucent or transparenet material 2.) animated normal maps wont show on any lightmappedgeneric material regardless of whether it is transparent or not.

    User Title
    meow by name, meow by nature
  • K@rt's Levels
    • P3: Peasant
      Points: 8,480
    • E2: Guide
      EF: 21
    • C3: Moderator
    • A4: Graduate
      Account Age: 3 years
    Posted 10 months ago

    You don't need:

    "$normalmap" "MINE/CROFT/water/causticbumpmap"

    in your .vmt. The "$bumpmap" is all you need. Your animation proxy is correct, but did you actually compile your normalmap as an animated texture?

    You can simply use DXT1 compression for normal maps without nice filtering. If you are using the alpha channel of the bumpmap then use DXT5. Uncompressed textures are much larger and rarely necessary to use.

    You are correct that the DIFFUSE image is the visible part of your material, 99% of the time the diffuse image is simply your basetexture. BUMP and NORMAL are the same thing in source and are created using either CrazyBump, nVidia NormalMapFilter or whatever gimps is called.

    It actually doesnt really matter if the textures are the same size or not, smaller textures will be automatically "scaled" up so they are the same size as the larger ones.

    Generally bumpmaps are not that often used on transparent textures, and depending what engine version you are using adding $transparent 1 to your .vmt may be stopping the bumpmap from working - I'm honestly not sure what works in which versions anymore.

    The wiki is definitely a good source of information, but be careful sometimes as the engine undergoes updates and changes however the wikis arent always changed to keep up with the new info.

    In the end I recomend you making 2 textures... the first is just you basetexture (diffuse) from your material using lightmappedgeneric or unlitgeneric. The second make into a refract texture using your normalmap as the animated refract. You can then simply create 2 surfaces, one over the other and put one texture on each.

    *you replied while i was writing this so the info may be a little inconsistant with the last 2 posts, but ill leave it anyway.

    Messiah
  • llVeXXll's Levels
    • P1: Beggar
      Points: 211
    • C1: Member
    • A2: Tenderfoot
      Account Age: 11 months
    Posted 10 months ago

    This problem is now SORTED. I discovered that translucency does not work with bump maps what so ever. As for the animation not working- I had one bit of code wrong: "animatedtexturevar" "$normalmap" should have been "animatedtexturevar" "$bumpmap". I got confused because it has to be the other way round for it to work with water shaders for some reason. Thanks for all your help anyway

    User Title
    meow by name, meow by nature
  • You must be a member