Some VTF's are Transparent when they seem they shouldn't
Quote from AuesomeMan3840 on October 5, 2015, 2:59 amSo I'm currently working on a mod for Portal 2, and I'm wanting to create custom signage for the different test elements I'm adding. However, when I open up the VTF for the signage that I want to edit in Paint.Net or Gimp, it shows up as half transparent. The VTF shows up normally in VTFEdit and looks fine in-game. I'm also attempting to make a skin for a cube, but the transparency is like the signage.
I'm wondering if this is meant to happen or if I'm messing something up.
Also: I edited some wall and floor textures because they are part of the mod, and they show up with proper transparency in PDN and Gimp.
So I'm currently working on a mod for Portal 2, and I'm wanting to create custom signage for the different test elements I'm adding. However, when I open up the VTF for the signage that I want to edit in Paint.Net or Gimp, it shows up as half transparent. The VTF shows up normally in VTFEdit and looks fine in-game. I'm also attempting to make a skin for a cube, but the transparency is like the signage.
I'm wondering if this is meant to happen or if I'm messing something up.
Also: I edited some wall and floor textures because they are part of the mod, and they show up with proper transparency in PDN and Gimp.
Quote from josepezdj on October 5, 2015, 3:31 pmI guess your problem is the material files, the .VMTs.
Post their content here so I can check and let you know how to fix it.
I guess your problem is the material files, the .VMTs.
Post their content here so I can check and let you know how to fix it.
Quote from AuesomeMan3840 on October 5, 2015, 4:53 pm(Quick note: I haven't edited the text of any of the VMF's except for their basetexture path)
metal_box.vmt
- Code: Select all
VertexLitGeneric
{
$baseTexture "modelsprops/Metal_box"
$bumpmap "modelspropsMetal_box_normal"
$phong 1
$phongexponenttexture "modelspropsMetal_box_exponent"$phongboost 1
$phongfresnelranges "[5 1 2]"
$selfillum 1
$nodecal 1
}signage_box_catcher.vmt
- Code: Select all
"LightmappedGeneric"
{
"$basetexture" "pgi/signage_box_catcher"
"$surfaceprop" "glass"
"$selfillum" "1"
"$decal" "1"
}
(Quick note: I haven't edited the text of any of the VMF's except for their basetexture path)
metal_box.vmt
- Code: Select all
VertexLitGeneric
{
$baseTexture "modelsprops/Metal_box"
$bumpmap "modelspropsMetal_box_normal"
$phong 1
$phongexponenttexture "modelspropsMetal_box_exponent"$phongboost 1
$phongfresnelranges "[5 1 2]"
$selfillum 1
$nodecal 1
}
signage_box_catcher.vmt
- Code: Select all
"LightmappedGeneric"
{
"$basetexture" "pgi/signage_box_catcher"
"$surfaceprop" "glass"
"$selfillum" "1"
"$decal" "1"
}
Quote from josepezdj on October 5, 2015, 6:12 pmOh, I now know what you mean: what you see inside Gimp or Paint.Net is the texture's alpha channel. The alpha channel is used in the game in many ways by each one of the multiple shaders. Shaders are what you first see at the top of the material files code, in your case they are the "VertexlitGeneric" (used in models) and the "LightmapGeneric" (the most common and widely used for many textures in floors, walls, ceilings, etc).
For example, if you take a close look in game, you'll see how the signage texture shines in the dark, this is made through the alpha channel of your texture and using the parameter $selfillum 1. If for example you want only a certain part of the signage to be spot on (illuminated), you create an alpha layer where only that part is visible, and the rest is fully transparent or nearly transparent. If you don't add any alpha layer for your texture (therefore, nothing is transparent), when using the $selfillum 1 param, the whole texture will be very bright, as much as it will even burn out the drawing in the signage.
In order to edit the texture comfortably (without transparency), open them in VTFEdit and hit Ctrl+E to export it. Export it for example to .JPG (all other formats keep the alpha channel, and you'll still see transparent areas).
Once you finish with editing your textures, you should create the alpha channel back As I told you, it's important in many ways. In the case of a model texture, apart from allowing you to spot certain parts of it with the $selfillum 1, it also determines which parts will be reflective and which ones not. In order to help you on creating the alpha channel in Paint.Net, take a look to this thread I posted.
Good luck!
Oh, I now know what you mean: what you see inside Gimp or Paint.Net is the texture's alpha channel. The alpha channel is used in the game in many ways by each one of the multiple shaders. Shaders are what you first see at the top of the material files code, in your case they are the "VertexlitGeneric" (used in models) and the "LightmapGeneric" (the most common and widely used for many textures in floors, walls, ceilings, etc).
For example, if you take a close look in game, you'll see how the signage texture shines in the dark, this is made through the alpha channel of your texture and using the parameter $selfillum 1. If for example you want only a certain part of the signage to be spot on (illuminated), you create an alpha layer where only that part is visible, and the rest is fully transparent or nearly transparent. If you don't add any alpha layer for your texture (therefore, nothing is transparent), when using the $selfillum 1 param, the whole texture will be very bright, as much as it will even burn out the drawing in the signage.
In order to edit the texture comfortably (without transparency), open them in VTFEdit and hit Ctrl+E to export it. Export it for example to .JPG (all other formats keep the alpha channel, and you'll still see transparent areas).
Once you finish with editing your textures, you should create the alpha channel back As I told you, it's important in many ways. In the case of a model texture, apart from allowing you to spot certain parts of it with the $selfillum 1, it also determines which parts will be reflective and which ones not. In order to help you on creating the alpha channel in Paint.Net, take a look to this thread I posted.
Good luck!
Quote from AuesomeMan3840 on October 6, 2015, 2:48 amThanks a lot dude! That really helped.
Thanks a lot dude! That really helped.