VTF ? Created 13 years ago2010-12-28 20:20:21 UTC by Striker Striker

Created 13 years ago2010-12-28 20:20:21 UTC by Striker Striker

Posted 13 years ago2010-12-28 20:20:21 UTC Post #288283
I am trying to learn how to manipulate source materials, but it seems something is going wrong and I don't really know where I'm doing the mistake.

I am trying to create a texture( the texture is shitty, but that isn't important, it's for testing) that has bump mapping(normal mapping) and can reflect env_maps.

This is the texture:
User posted image
This is the normal texture:
User posted image
And this is not what I am expecting!
User posted image
This is the VMT:
[quote]LightmappedGeneric
{
$basetexture test_textures\ground_test_texture
$surfaceprop gravel
$bumpmap test_textures\ground_test_texture_normal
$ssbump
$envmap env_cubemap
}
[/quote]

So, what am I doing wrong?
Striker StrikerI forgot to check the oil pressure
Posted 13 years ago2010-12-28 20:32:27 UTC Post #288284
manipulate source materials
This is where I stopped. You can't mind control source materials, they're just a bunch of 0s and 1s that make pixels, and the pixels make colors, and the colors make a fake texture on a computer. It's really advanced stuff to manipulate those, so I'm just gonna step back.
Dimbeak DimbeakRotten Bastard
Posted 13 years ago2010-12-28 21:20:25 UTC Post #288287
Thanks for the philosophy, but that doesn't help me.
Striker StrikerI forgot to check the oil pressure
Posted 13 years ago2010-12-28 21:26:04 UTC Post #288288
Dimbark, it's time to stop posting.

Cstriker, I'm not entirely sure I see what the problem is. It's rendering correctly, isn't it?
I never use VTFedit when I'm making my Source materials, so I can't really help there.
Archie ArchieGoodbye Moonmen
Posted 13 years ago2010-12-28 21:35:00 UTC Post #288289
Idk Huntey i think he wants more visible depth in the material.
Looks flat in-game.
Tetsu0 Tetsu0Positive Chaos
Posted 13 years ago2010-12-28 22:03:44 UTC Post #288290
Gray scale the image and mess with the contrast to get a more defined bump map. That's how I do it but I use Photoshop's normal map plugin.
monster_urby monster_urbyGoldsourcerer
Posted 13 years ago2010-12-28 22:05:04 UTC Post #288291
I'm not sure what the problem is, either.
If you want more depth, you can change the height map scale from the default value of 2 after picking an image to import.
Posted 13 years ago2010-12-28 22:11:38 UTC Post #288292
Also, that texture is not a good one to use for bump mapping to begin with. There are too many dark shadows and they will be rendered as cracks by the bump map. Remember that height mapping is related to brightness of the image.

This is why I suggest working with a greyscale image when creating the bump map. Mess around with the image, makeing the higher parts (cement) as bright as you need them to be, then making the lower down portions (underlay / gravel) darker. (Also, make the gravelly part have a higher contrast level so that there is the odd (brighter) raised bit that catches the light.)
monster_urby monster_urbyGoldsourcerer
Posted 13 years ago2010-12-28 22:20:34 UTC Post #288293
I'm not entirely sure I see what the problem is. It's rendering correctly, isn't it?
I mean, look at this:
User posted image
That bump mapping is obvious. Mine is practically inexistent.
Gray scale the image and mess with the contrast to get a more defined bump map. That's how I do it but I use Photoshop's normal map plugin.
Photoshop normal map plugin? Hmm... I used the VTFedit tool to do this. Btw, Archie, if you're not using this what are you using? I read something about scripting this on the valve wiki. Don't tell me you are really that hard-core lol.
If you want more depth, you can change the height map scale from the default value of 2 after picking an image to import.
How can I do that?

And Urby, I think I understand what you're saying. But I still need more info about that normal map plugin :). (btw is there one available for GIMP ?)
Striker StrikerI forgot to check the oil pressure
Posted 13 years ago2010-12-28 22:22:40 UTC Post #288294
Well, you could try to carve out some of them and then set them to seperate heights on a scale to 1-3 so that it looks jagged.
Dimbeak DimbeakRotten Bastard
Posted 13 years ago2010-12-28 22:52:07 UTC Post #288295
$ssbump
^^ Problem.

What you have posted is a regular normal map, not an SSbump map.

http://developer.valvesoftware.com/wiki/$ssbump

Remove that line from the .VMT and the normal map should begin working correctly. Furthermore, the reflection mask for textures utilizing normal maps is located in the alpha channel of the normal map. I'm not certain if that is ignored if no alpha channel is saved in the normal map, but you may want to try adding just a completely white alpha channel to the normal map, and adding "$normalmapalphaenvmapmask" to the VMT somewhere.

It's also worth noting that there is a LOT of light already found in the base texture; to add to what Urby has mentioned, it may be more difficult to see how well the normal map is behaving with all that light in the texture showing through as well. Just keep that in mind.
Posted 13 years ago2010-12-29 00:05:58 UTC Post #288296
How can I do that?
User posted image
Posted 13 years ago2010-12-29 06:40:25 UTC Post #288305
And Urby, I think I understand what you're saying. But I still need more info about that normal map plugin smile - :). (btw is there one available for GIMP ?)
I believe it works similar to the VTFEdit tool. I've never used VTFEdit to make normal maps so I'm not the best judge.

Same goes for the GIMP question, no idea, don't use it.

The Photoshop plugins are available from [url=http://developer.nvidia.com/object/photoshop_dds_plugins.html]NVidia[/quote]
monster_urby monster_urbyGoldsourcerer
Posted 13 years ago2010-12-29 10:04:02 UTC Post #288308
If there are no GIMP plugins you can always use CrazyBump
Furthermore, the reflection mask for textures utilizing normal maps is located in the alpha channel of the normal map. I'm not certain if that is ignored if no alpha channel is saved in the normal map, but you may want to try adding just a completely white alpha channel to the normal map, and adding "$normalmapalphaenvmapmask" to the VMT somewhere.
It's ignored if there is no alpha and you're not using the $normalmapalphaenvmapmask parameter. You can define an external specular mask with $envmapmask. The only caveat is that $envmapmask doesn't work on model materials that also use $bumpmap and so you have to put your spec mask in the alpha channel of the normal map to get them to work on models.
RabidMonkey RabidMonkeymapmapmapfapmap
Posted 13 years ago2010-12-29 11:56:37 UTC Post #288310
Well, you could try to carve out some of them and then set them to seperate heights on a scale to 1-3 so that it looks jagged.
Dimbark, it's time to stop posting.
Archie ArchieGoodbye Moonmen
Posted 13 years ago2010-12-29 13:46:26 UTC Post #288311
I think I'm going to stick with VTFedit, it's the simplest solution to me. Also, I have discovered that the above posted texture(the in-game screenshot), is actually using parallax mapping.
Rabid, CrazyBump costs money. VTFedit is an all-in-one, and it's free :).

The $envmap parameter seems to be adding a reflection to the texture as a whole, it doesn't consider bump maps or anything. I believe, from what you are talking guys, that there is a "specularity" map or something like that, a defined are of the texture which will shine? If that is so, can you link me to a tutorial on the valve wiki? I can't find it.
Argh, there's much to learn. I only fully understand how to create a basic texture right now.
Striker StrikerI forgot to check the oil pressure
Posted 13 years ago2010-12-29 14:37:34 UTC Post #288312
you're overcomplicating things. Add an alpha layer to your normal map and add this to your .vmt

"$normalmapalphaenvmapmask" "1"

Here's an example vmt. of a material I did which works fine:

"LightmappedGeneric"
{
"$baseTexture" "huntey/huntey_whiteboard1"
"$surfaceprop" "plastic"
"$bumpmap" "huntey/huntey_whiteboard1_normal"
"$normalmapalphaenvmapmask" "1"
"$envmap" "env_cubemap"
"$envmaptint" "[ .3 .3 .3 ]"
}
Archie ArchieGoodbye Moonmen
Posted 13 years ago2010-12-29 15:08:17 UTC Post #288313
The question is: how do I add an alpha layer?
[EDIT] And why do you put " everywhere? It works without them.
Striker StrikerI forgot to check the oil pressure
Posted 13 years ago2010-12-29 17:46:58 UTC Post #288318
I don't know how you do it in vtfedit, I use photoshop for every step of the texture creation process. VTF options, normal mapping etc.
Archie ArchieGoodbye Moonmen
Posted 13 years ago2010-12-30 12:45:25 UTC Post #288352
Ok, I somehow managed to get bumpmapping and an alphaenvmask working. But with funny results again:
User posted image
Ok thank you for the cartoon effect dear Source engine, but it's not what I want right now.
I think I am doing something wrong. Here's what I did for the bump map.

I grayscaled the texture, and made some adjustments so that the brighter bricks are emphasized. I copy pasted that into the alpha layer and increased a bit the contrast for the specular map.
User posted image
Then I saved it as a 32bit .TGA
After that I loaded it into VTFedit, chose BGRA8888 for both "Normal" and "Alpha", and saved it:
User posted image
Also, the .vmt is this:
[quote]"LightmappedGeneric"
{
"$basetexture" "test_textures\brickorange"
"$surfaceprop" "brick"
"$bumpmap" "test_textures\brickorange_envbump_map"
$envmap env_cubemap
"$envmaptint" "[ 0.7 0.7 0.7 ]"
"$normalmapalphaenvmapmask" "1"

//"$parallaxmap" "brickorange_heightmap"
//"$parallaxmapscale" "0.08"
}
[/quote]

What am I doing wrong?
Striker StrikerI forgot to check the oil pressure
Posted 13 years ago2010-12-30 15:12:42 UTC Post #288370
Tone down your specular map/tint, move your cubemap to a darker spot, or brighten up your room.
Cubemap reflections don't become brighter or darker according to how much light is actually on the face (just like in real life, of course).
Posted 13 years ago2010-12-30 15:18:00 UTC Post #288371
Rabid, CrazyBump costs money. VTFedit is an all-in-one, and it's free .
It's free, you don't have to buy a license.

The effect shown ingame is just what's being caused by your spec map. The white bricks are really white which means they're going to be very shiny.
RabidMonkey RabidMonkeymapmapmapfapmap
Posted 13 years ago2010-12-30 15:48:11 UTC Post #288373
The effect shown ingame is just what's being caused by your spec map. The white bricks are really white which means they're going to be very shiny.
But the most shiny part are the unseen bricks!
It's free, you don't have to buy a license.
You mean the demo version is okay?
Striker StrikerI forgot to check the oil pressure
Posted 13 years ago2010-12-30 16:41:24 UTC Post #288378
Yikes. You went waaay overboard with those bricks. The bricks in the texture look like they are on a similar level so they should all have the same sort of brightness level, with the cracks in between them being darker / black. The one you created would be best suited for a smooth wall with a few bricks jutting out.

Also, you don't need envmapping on a brick texture. Bricks aren't all that shiny last time I checked. :P
monster_urby monster_urbyGoldsourcerer
Posted 13 years ago2010-12-30 16:48:39 UTC Post #288380
Ahh, well look at what you've done...
"LightmappedGeneric"
{
"$basetexture" "test_textures\brickorange"
"$surfaceprop" "brick"
"$bumpmap" "test_textures\brickorange_envbump_map"
$envmap env_cubemap
"$envmaptint" "[ 0.7 0.7 0.7 ]"
"$normalmapalphaenvmapmask" "1"

//"$parallaxmap" "brickorange_heightmap"
//"$parallaxmapscale" "0.08"

}
First of all, you've told your normal map to also act as a specular map. That's what $normalmapalphaenvmapmask does, so just take that line out all together.
You also haven't specified your actual specular map to be used with the texture, so your black&white specular map isn't even being used at all.
Change the value of $envmap to match your specular map. Using "env_cubemap" there makes the entire texture equally shiney.
Posted 13 years ago2010-12-30 16:50:09 UTC Post #288381
Argh, I was meant to add this onto my last post. Anyway:

For a smooth brick texture like that, A greyscale image to use as a bumpmap would be similar to this.
User posted image
The grout is lower than the bricks so is a lot darker, whereas the bricks would be more raised, (but not too much) so they are a lighter grey, not white.
monster_urby monster_urbyGoldsourcerer
Posted 13 years ago2010-12-30 17:10:49 UTC Post #288386
Let's take a step back for a second, because there's a lot of conflicting information in this thread.

If you want a normal/bump/parallax mapped surface that is also reflective, there's 2 ways to go about doing it.

1. You can have a separate texture for your normal map and specular map. The specular map will have to be black and white, and the normal map should be a traditional bump map with all it's purple glory.
2. You can double down and let your normal map also act as a specular map. In this case, do not use a traditional, purple bump map. Use a black and white parallax map instead.

Disregard what I said about changing the value of $envmap, too. You need to add the $envmapmask field, instead, if you're using two separate images.
http://developer.valvesoftware.com/wiki/$envmapmask
http://developer.valvesoftware.com/wiki/$bumpmap
http://developer.valvesoftware.com/wiki/Bump_map

Consider trying some new tools while you're at it, because not all bump maps are created equally:
User posted image
Posted 13 years ago2010-12-30 21:36:57 UTC Post #288413
You mean the demo version is okay?
Should work just fine.
First of all, you've told your normal map to also act as a specular map. That's what $normalmapalphaenvmapmask does, so just take that line out all together.
No, it tells the material that the specular mask is stored in the alpha channel of the normal map. In this event the specular mask generally has to be inverted because it's in the alpha channel. You can either use an external spec mask ($envmapmask), a spec mask in the alpha channel of the normal ($normalmapalphaenvmapmask) or a spec mask in the alpha channel of the diffuse texture ($basealphaenvmapmask). $envmap defines the particular reflection map to use; in most instances you want env_cubemap because it will use the nearest cubemap as a reflection source.
RabidMonkey RabidMonkeymapmapmapfapmap
Posted 13 years ago2011-01-09 14:12:46 UTC Post #288871
Well, I finally obtained what I want:
User posted image
This is a good "wet wall" effect. I will specify that I used Gimp and a normal plugin for it. It's almost like the photoshop plugin. The only problem is that it's difficult to work with alpha layers in GIMP, but once you learn it, it's easy. Also, as I read in a tutorial here on TWHL, after generating the normal map, I have to increment the red and green channel by 1.
Striker StrikerI forgot to check the oil pressure
Posted 13 years ago2011-01-09 15:05:17 UTC Post #288873
Are you familiar with that dreaded petal shaped light when you place a light entity in front of a wall that has a normal map?

As seen here.
You must be logged in to post a response.