PDA

View Full Version : Making custom Graffiti the RIGHT WAY?


The_insane_3004
04-03-2011, 12:01 AM
This has been a problem of mine for a long time now... I put the graffiti on a plain transparent background in photoshop and an ugly white outline is put on it... A ways back I was told I had to put it on a perfect gray (128 128 128) and something else with alpha channels... In photoshop 8, I have no idea how to access the layers and channels in photoshop... can someone help me out here!?!

Xopaa
04-03-2011, 01:52 AM
lol I use GIMP and have never had a problem, just make a layer mask.

using the perfect gray thing has to do with using modulated decal, which i dont use, ive just been making my graffiti LightmappedGeneric with a $decal 1 in the vmt, and thats been showing up fine.

also, using photoshop without knowing how to use layers and channels is actually a crime in most states. you should probably invest a good 30 mins into cracking open the help file and taking a look around.

ThaiGrocer
04-03-2011, 02:43 AM
What you actually want is 127 127 127 as a background without alpha. Save it as a TGA and convert with vtex to get a 124 126 124 background.

The process can be broken down into four small steps:

Create a transparent source image with background completely filled with color RGB 127 127 127
Save the image as TGA without alpha
Convert the image to a VTF (DXT 1) using vtex provided by the L4D1 or L4D2 Authoring Tools (this results in a background color of RGB 124 126 124)
Create the accompanying VMT with DecalModulate shader and test


Example VMT:
DecalModulate
{
$basetexture "graffiti/graffiti_saferoom_c1_m3-4_01"
$surfaceprop default
$decal 1
$vertexcolor 1
$vertexalpha 1
}

The_insane_3004
04-03-2011, 09:38 AM
I was able to get to step three before getting this Error message

VConfig Error

Setup file 'gameinfo.txt' doesn't exist in subdirectory C:\Program files (x86)\Steam\steamapps\common\left4dead2\bin\vconfi g
Check your -game parameter or Vconfig settings

couple problems here

1. I don't have a vconfig folder in bin
2. There is a gameinfo.txt in bin\skdlauncher but I don't know if it is the right one
3. If it is the right one here is what it says
"GameInfo"
{
FileSystem
{
SteamAppId 220 // This will mount all the GCFs we need (240=CS:S, 220=HL2).
ToolsAppId 211 // Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc.

//
// The code that loads this file automatically does a few things here:
//
// 1. For each "Game" search path, it adds a "GameBin" path, in <dir>\bin
// 2. For each "Game" search path, it adds another "Game" path in front of it with _<langage> at the end.
// For example: c:\hl2\cstrike on a french machine would get a c:\hl2\cstrike_french path added to it.
// 3. For the first "Game" search path, it adds a search path called "MOD".
// 4. For the first "Game" search path, it adds a search path called "DEFAULT_WRITE_PATH".
//

//
// Search paths are relative to the base directory, which is where hl2.exe is found.
//
// |gameinfo_path| points at the directory where gameinfo.txt is.
// We always want to mount that directory relative to gameinfo.txt, so
// people can mount stuff in c:\mymod, and the main game resources are in
// someplace like c:\program files\valve\steam\steamapps\<username>\half-life 2.
//
SearchPaths
{
Game |gameinfo_path|.
Game hl2
}
}
}

That doesn't look very L4D2 oriented...


Anyone know what to do?

ThaiGrocer
04-03-2011, 10:17 AM
You would want D:\Installed Games\Steam\steamapps\common\left 4 dead 2\left4dead2\gameinfo.txt, but I don't have a vconfig folder in that location... so that error might be a red herring that Valve dropped in order to test our resolve.

How were you using vtex? I was half asleep and left details out. It's not a GUI but you can still drag and drop from the materialsrc folder onto a shortcut of vtex.exe. Here are more details: http://developer.valvesoftware.com/wiki/Left_4_Dead_Graffiti_Tutorial

The_insane_3004
04-03-2011, 11:27 AM
You would want D:\Installed Games\Steam\steamapps\common\left 4 dead 2\left4dead2\gameinfo.txt, but I don't have a vconfig folder in that location... so that error might be a red herring that Valve dropped in order to test our resolve.

How were you using vtex? I was half asleep and left details out. It's not a GUI but you can still drag and drop from the materialsrc folder onto a shortcut of vtex.exe. Here are more details: http://developer.valvesoftware.com/wiki/Left_4_Dead_Graffiti_Tutorial

The tutorial cleared things up abit... but still having problems
When I drag and drop the tga file onto vtex, it says this

input file: C:/Program Files (x86)/Steam/steamapps/common/left 4 dead 2/left4dead2/materialsrc/testgraff
output directory: C:/Program Files (x86)/Steam/steamapps/common/left 4 dead 2/left4dead2/materials
no config file for C:/Program Files (x86)/Steam/steamapps/common/left 4 dead 2/left4dead2/materialsrc/testgraff.tga
ERROR: Cannot create low-res image for non-power of two textures (did you forget to set 'cubemap 1' or 'skybox 1'?)

Hit a key to continue

I checked the materials folder and no new file was created...
and I have absolutely no idea what to do about the Error message...

ThaiGrocer
04-03-2011, 12:30 PM
I think it has something to do with your texture dimensions. You can get a better answer if you upload your test TGA file.

Any image file can be used as a texture, so long as both of its dimensions (height and width) are a power of two: 2, 4, 8, 16, 256, 512, 1024, and so on.

HellaLouYaah
04-03-2011, 01:12 PM
The tutorial cleared things up abit... but still having problems
When I drag and drop the tga file onto vtex, it says this

I checked the materials folder and no new file was created...
and I have absolutely no idea what to do about the Error message...


Just use the photoshop vtf plugin (http://developer.valvesoftware.com/wiki/Photoshop_VTF_Plugin).

And check the file formats (http://developer.valvesoftware.com/wiki/Valve_Texture_Format), usually only need DTX1 or DXT5.

ThaiGrocer
04-03-2011, 01:37 PM
Just use the photoshop vtf plugin (http://developer.valvesoftware.com/wiki/Photoshop_VTF_Plugin).
Unfortunately it doesn't give the same resulting background color that DecalModulate needs to make it fully translucent and was told by the author of the tools to just use vtex if there was a difference.

I was reminded by tsr that this isn't the only nor "the best" way to make graffiti, just a copy-cat way of doing what is officially done without a full understanding why they did it the way they did.

The_insane_3004
04-03-2011, 01:38 PM
I think it has something to do with your texture dimensions. You can get a better answer if you upload your test TGA file.

I completely forgot about this part :)
should have more success now

The_insane_3004
04-03-2011, 01:49 PM
I just had a success with a 512 by 512 SOLID block. In hammer it was invisible :D

But when I went back to add some writing, it started to give me some VConfig crap again. apparently just drawing on the solid is not the right way, so now my question is how do I get the graffiti on there?

(almost there... ALMOST THERE...)

sweet_lime49
04-03-2011, 08:48 PM
Why not just use GIMP 512x512, transparent background saved as TIF, and make the file in VTFEdit? It's so easy that way. Literally open the image in VTFEdit, save as VTF, save a VMT and tick the transparent box. You're good.

The_insane_3004
04-03-2011, 09:41 PM
:eek:


...You have got to be ♥♥♥♥ting me... that simple?

Just tested it... I don't know whether to be jarateed or happy... well... thanks sweet_lime49... I guess that is just one of the many reasons that Gimp has advertised as more "user friendly" huh?...

The_insane_3004
04-03-2011, 10:21 PM
http://i981.photobucket.com/albums/ae295/insane3004/left4dead22011-04-0323-17-21-81.jpg?t=1301890766

Testing out a pen tablet I had... can't thank you guys enough :D

sweet_lime49
04-04-2011, 12:00 AM
:D Thanks for the picture. Glad I could help.

Thingy Person
04-04-2011, 06:10 AM
Nick looks stunning today.