Left 4 Dead 2

Left 4 Dead 2

View Stats:
Deep Thunder Dec 22, 2014 @ 6:40pm
Campaign posters; what is alpha transparency? Please define
[Solved]
Hello, I have an issue with my campaign poster. It loads but it's extremely bright and eventually fades out to black.

"This is a poster image that is displayed while your campaign loads. Standard size is 1024 x 1024 pixels with an alpha channel for transparency."

Ok. I resized my poster to 1024 x 1024 in VTFEdit.
So, exactly what do I do in VTFEdit to accomplish "alpha transparency"?

I created the .vtf and .vmt of the image in VTFEdit and placed it underneath:
C:\Program Files (x86)\Steam\SteamApps\common\Left 4 Dead 2\left4dead2\addons\[mapname]\materials\vgui

In my mission.txt file (under the missions folder)h:

// Loading poster data
//
// Note that "posterTitle" and "posterTagline" are often blank as
// the poster usually includes these in the poster image itself.
// If you do not provide a poster, a generic default will be used.
"poster"
{
"posterImage" "LoadingScreen_my .bsp filename, which is the map name"

"posterTitle" ""
"posterTitle_y" "360"

"posterTagline" ""
"posterTagline_y" "372"

Nothing wrong here, correct?
Last edited by Deep Thunder; Jul 6, 2016 @ 4:30pm
< >
Showing 1-15 of 16 comments
AlwaysToast Dec 22, 2014 @ 7:40pm 
Alpha transparency is when you set the Alpha Channel to Transparent. Your image will normally have three channels one for each primary color. The Alpha Channel is a 4th channel. Sometimes this requires creating an Alpha Channel, just to set it to transparent.

This is something you need to set in the image file before you put it into VTFedit (at least as far as I know). So a graphics program like Gimp2 works. Just use youtube or google to find a tutorial for the graphics program you use. Give the image a Alpha Channel, set it to transparent and save it (or export it in gimp2). Then put it into VTFedit.

The poster, and the small image for each level (for when you hit tab, if they don’t have an alpha, they can appear black or not show up), needs to have the Alpha channel set up properly. The rest of the images in the file generally do not.
Rectus Dec 23, 2014 @ 12:57am 
Originally posted by AlwaysToast:
The poster, and the small image for each level (for when you hit tab, if they don’t have an alpha, they can appear black or not show up), needs to have the Alpha channel set up properly. The rest of the images in the file generally do not.
The textures shouldn't really need alpha channels unless you're making a transparent L4D1 style poster, and putting them in needlessly will just waste your file size budget.

If you have problems with the UI images, it usually because your material is using the wrong shader. It should normally be using UnlitGeneric, and look something like this:
UnlitGeneric { $basetexture "vgui/loadingscreen_mymap" $vertexcolor 1 $vertexalpha 1 $no_fullbright 1 $ignorez 1 }
Deep Thunder Dec 23, 2014 @ 6:49am 
I'll set up the Alpha channel for my campaign poster before putting it into VTFEdit and update you guys on and my results.

Originally posted by Rectus:
The textures shouldn't really need alpha channels unless you're making a transparent L4D1 style poster, and putting them in needlessly will just waste your file size budget.

My poster is just a bitmap image, with some text at the bottom that I filtered using a motion blur in Inkscape. So what you're saying is that I can just resize my image in VTFEdit to 1024x1024, create the VTF and VMT files and call it a day? Same with the thumbnail?

Originally posted by Rectus:
If you have problems with the UI images, it usually because your material is using the wrong shader. It should normally be using UnlitGeneric, and look something like this:

Well...here's the thing; my map thumbnail loads perfectly fine. But, when you go into the map, and back out to the main menu, the thumbnail is just plain black. I made sure it was 256x128 in VTFEdit. Wrong shader you think? Or something I missed? Here is the template I used for it:

"UnlitGeneric"
{
"$basetexture" "vgui\maps\l4d2_mymap"
"$translucent" 1
"$ignorez" 1
"$vertexcolor" 1
"$vertexalpha" 1
}
Last edited by Deep Thunder; Dec 23, 2014 @ 6:52am
Rectus Dec 23, 2014 @ 7:11am 
All of that seems like it's set up right. You might also need to set "fullscreen" "1" in the poster part of your mission file to make the loading screen texture stretch out properly, if it's desinged to be a full screen one like the L4D2 posters.

The thumbnails turning black sounds really odd though. Does it print any errors related to your materials to the console?

You mihgt also want to check that the mission file doesn't have any errors in it by running the game with the -allowdebug option, and typing mission_reload in the console.
Deep Thunder Dec 23, 2014 @ 7:40am 
Fullscreen 1, eh? Here is the template I used for the campaign poster:

"UnlitGeneric"
{
"$translucent" 1
"$basetexture" "VGUI

\LoadingScreen_,mapname"
"$vertexcolor" 1
"$vertexalpha" 1
"$no_fullbright" 1
"$ignorez" 1
"$additive" 0
"$fullscreen" 1}


..and it's plain black.

By typing in mission_reload, these have always been the results:

MissionManager: Mission file "missions/missionfile.txt" has invalid settings for game mode coop
MissionManager: Mission file "missions/missionfile.txt" has invalid settings for game mode versus


So it shouldn't have anything to do with the poster...I would hope not. My map is survival only.

I think I'll start over from the beginning by briefly listing the steps I took. I may have uneccessarily modified my images to begin with.

And what do you mean by -allowdebug option?
Last edited by Deep Thunder; Dec 23, 2014 @ 7:42am
Rectus Dec 23, 2014 @ 8:13am 
The fullscreen option goes into to mission file, not the material.

If the map is only for survival, you should remove or comment out any map entries for the other game modes in the mission file. The entires there set the thumnails, so maybe the invalid ones make it glitch out.

-allowdebug is a command line option that is added to the game lauch path. You can set it in Steam by right clicking a game -> properties -> Set launch options.
Deep Thunder Dec 23, 2014 @ 8:49am 
Ah yes, the mission file...I didn't see a specification as to where to put in the mission file, so this is what it looks like:

"poster"
{
"posterImage" "LoadingScreen_mapname"
"fullscreen" "1"

"posterTitle" ""
"posterTitle_y" "360"

"posterTagline" ""
"posterTagline_y" "372"

Results: Was not fullscreen, was extremely bright, and faded out to black quickly.

Remove or comment out the entries to accomodate only survival? I'm not sure exactly what you meant, and these were the only entries that directly refer to coop & versus, unless I'm missing something. This is what it looks like now:

"modes"
{
"survival"
{
"1"
{
"Map" ".bsp mapname"
"DisplayName" "mapname (in game map name)"
"Image" "maps/l4d2_mapname"
}
}
}

}

So I basicaly deleted the whole coop and versus portion of it. By typing in mission_reload, I still get the following:

MissionManager: Mission file "missions/missionfile.txt" has invalid settings for game mode coop
MissionManager: Mission file "missions/missionfile.txt" has invalid settings for game mode versus


Results regardless: Still disappeared after going into the map, going back to the main menu, and attempting to view the preview image.

By using -allow debug, I get a few lines of extra feedback:

Mission mapname ver 1 loading...
MissionManager: Mission file "missions/ingamemapname.txt" has invalid settings for game mode coop
loaded 1 survival chapters.
MissionManager: Mission file "missions/ingamemapname.txt" has invalid settings for game mode versus
Mission mapname ver 1 loaded 1 game modes.
Rectus Dec 23, 2014 @ 9:03am 
Sounds like the game could be trying to load old versions of the files from somewhere. If you have any of the map files packed into a vpk, it's going to to take priority over anything that's unpacked.
Deep Thunder Dec 23, 2014 @ 10:30am 
PROGRESS. 95% there. Here is what I did after packaging my files, and moving the unpacked files onto my desktop:
1) Map thumbnail preview loads every time now (I backed out twice to make sure I wasn't getting lucky)
2) "Invalid game mode" errors no longer show up in dev console

At this point, it's a matter of getting the campaign poster to work.

Are materials still relevant at this point (-allowdebug)? Read the spoiler-covered text if you think so. I'm not sure if it has anything to do with my map:
"materials/videobikmaterial_backgroundcb.vtf": can't be found on disk
"materials/videobikmaterial_backgroundcr.vtf": can't be found on disk
"materials/videobikmaterial_backgroundy.vtf": can't be found on disk


I think it's best I restart. Unless you want me to try something else. This is what'll I do, and tell me if anything I'm doing is wrong.

1) Open the file in Inkscape (the originial file dimensions are 1024 x 768, bitmap type)
2) Re-size dimensions into 1024 x 1024 (for convenience and possible quality preservation purposes) (tutorials have been telling me to use those dimensions for l4d1, not sure if it still applies to l4d2)
2) Add some text at the bottom for traditional purposes, with an effect of motion blur
3) Export the bitmap image as LoadingScreen_.bsp map name
4) Close Inkscape
5) Open VTFEdit
6) Import LoadingScreen_.bsp map name
7) Make dimensions 1024x1024
8) Re-Create .vtf file, place it under C:\Users\OPEN\Desktop\mapname\materials\vgui
9) Re-Create .vmf file, place it under C:\Users\OPEN\Desktop\mapname\materials\vgui
10) In the .vmf file, copy and paste the template as follows:
"UnlitGeneric"
{
"$translucent" 1
"$basetexture" "VGUI\LoadingScreen_mapname"
"$vertexcolor" 1
"$vertexalpha" 1
"$no_fullbright" 1
"$ignorez" 1
"$additive" 0
}

Any suggestions? Anything I've done incorrectly?
Lastly, note that I didn't do anything with alpha transparency because it's likely uneccessary.

Your help has been great so far Rectus
Last edited by Deep Thunder; Jul 6, 2016 @ 4:26pm
Rectus Dec 23, 2014 @ 10:51am 
The only thing I can see that's wrong is that the material file extension is .vmf instead of .vmt, everything looks good otherwise.
Deep Thunder Dec 23, 2014 @ 11:11am 
Yeah, I meant to put .vmt instead.

And it is still completely black.

I guess I'll have to give it an alpha channel in Inkscape. If that's possible.
Rectus Dec 23, 2014 @ 11:27am 
I can't imagine that adding an alpha channel would help, but if you wan't to add one you probably would need an image editor like GIMP or photoshop.

You could try switching the base texture value in the material to one of the stock loading screen textures to check if it's the texture or something else that's broken.
Deep Thunder Dec 23, 2014 @ 11:30am 
By any chance, do you know of a campaign that uses a poster without alpha channel? I'll try an official L4D2 poster and a custom campaign with no alpha transparency.
Last edited by Deep Thunder; Dec 23, 2014 @ 11:30am
Rectus Dec 23, 2014 @ 11:38am 
Only the ported over L4D1 campaigns have alpha channels, so any other stock campaing will work. Neither of my full campaings have alpha channels either. You can check whether a texture has an alpha channel in VTFedit, if it does one of the One Bit Alpha or Eight Bit Alpha flags on the left will be checked. You can also view the alpha channel as a transparency from View -> Mask.
Deep Thunder Dec 23, 2014 @ 12:13pm 
[Solved] Thank you Rectus.
Last edited by Deep Thunder; Jul 6, 2016 @ 4:30pm
< >
Showing 1-15 of 16 comments
Per page: 1530 50

Date Posted: Dec 22, 2014 @ 6:40pm
Posts: 16