Talk:VMT

From Valve Developer Community
(Redirected from Talk:Vmt)
Jump to: navigation, search
English (en)Français (fr)
Icon-message-48px.png
This is the discussion page of VMT. To add a comment, use the Edit button near the headline of the appropriate section. To create a new section, you can use the Add topic button at the top of this page.
Comments on talk pages should be signed with "~~~~", which will be converted into your signature and a timestamp.

I'm still confused as to options are available to me as a texture artist. I know there's a lot of good information above, but I'm not a programmer; I'm an artist. Is there a more detailed explaination of this procedure available? Or maybe, a program designed where I can enter the types of material effects I'm looking for (i.e. metallic, shiny, whatever) and have the code generated for me?

You want VTFEdit.

There needs to be a list of all variables that can be in a VMT file. This list should either be contained in, or linked to from this article. I see that most of the $variables are listed in Shader Types and Parameters, but the %variables are listed nowhere... Nhammen 21:59, 12 Oct 2007 (PDT)


Further Additions

This article could use a lot more information about how to write proper VMT files, and the basic parameters that can be added. --JeffLane 09:09, 19 Jul 2005 (PDT)

Though on second thought, this has gotten pretty long, so any new information should probably be linked instead of added. It may have to be divided up at some point. The sections on creating .VMT files and .TXT parameters could probably be pulled out into their own smaller articles, for example. --JeffLane 14:34, 19 Jul 2005 (PDT)
Agreeing: I'm thinking this page should just describe what a material is. Everything describing the creation of a material could be moved to a "Material Creation", and details about Vtex should be put on the Vtex page. Too bad I got the flu and a faulty monitor, or I would have fixed it myself. --Andreasen 14:35, 27 Aug 2007 (PDT)

render order

Does anyone know how to force the render order of translucent/additive textures? When I have multiple transparent textures in front of one another, the game gets confused about which is in front of the other and flips between them based on the view angle. Is there a shader parameter to force the game get it right? --Mungo 10:29, 23 Jul 2005 (PDT)

That would be interesting, Modal/TopMost for textures. I've noticed that my nVidia GeForce card does a lot better job of this than my ATI Radeon, might be system specific. --wisemx 10:53, 23 Jul 2005 (PDT)
This is called a "sorting issue". It all depends on what type of object the material is applied to. Some classes of objects, such as standard world brushes and func_detail, are rendered (and sorted) together for speed reasons. Same goes for models (a single model is rendered as a batch). When this happens, the hardware has a hard time "sorting" -- determining what object with a translucent material should be rendered last (in front).
One way to force a brush object to render seperately is to make it a brush entity, such as a func_brush. This obviously has its own share of limitations, including reduced performance and lighting differences, so it's not always a solution.
The only way I know of to fix this in the .VMT itself is to make the material alphatested instead of alphablended, which has a high visual cost. Regardless, no simple addition to the .VMT will fix this problem without a performance or visual quality penalty. --JeffLane 15:43, 23 Jul 2005 (PDT)
Thanks a lot. I should also mention that this is occurring in the 3D skybox specifically. There are two separate props I'm using in the sky. Could that be part of the problem? Do the shader parameters "$writez" and "$comparez" have anything to do with this? --Mungo 19:29, 23 Jul 2005 (PDT)
I'm looking into the exact function of these variable for correctness, but no, I don't believe they will help you in this case. Dynamic props are not included in cubemap rendering because they are by definition dynamic, and may not always be present in the scene, which would make the cubemaps be an incorrect rendering. If you need it to be in the cubemap, you should make it a prop_static. --JeffLane 17:20, 25 Jul 2005 (PDT)
I added a description of $writez to Shader Types and Parameters. I was told $compareZ is not used in any shaders and should not be used. --JeffLane 18:04, 25 Jul 2005 (PDT)

Binding VMT/VTF files to map

I created a decal for my map, but when I was serving the map and someone connected to my server, they couldn't see my decal, because the decal files didn't get transferred to their computer. I guess I could set up MY server so that the client is required to download the file, but if someone else is using the map on their server, they won't necessarily do that for their server and the decal will be lost. Thanks.

Create a resfile --Pon 01:12, 24 Sep 2005 (PDT)
You can also embed the decal inside your map using bspzip. Kodak 17:36, 9 May 2006 (PDT)

16 bits/pixel

This targa type didn't work. Vtex thought this type was "bogus". 24 and 32 bits/pixel types worked fine though. Edit: Tested this again with a similar texture, and got the same results: 24- and 32-bits pass, while 16-bits fail Vtex convertion. Unless you have gotten 16-bits to work, the article should exclude 16-bits as an option. --Andreasen 22:52, 21 Oct 2006 (PDT)

Edited out 16-bits/pixel. --Andreasen 14:28, 27 Aug 2007 (PDT)

Nice filter

Are there any examples of what the "nice filter" does? --TomEdwards 07:10, 22 Apr 2007 (PDT)

Yes. It does nice things. :P
Nah, might do some filter stuff like in photoshop. No idea really. --Sortie 02:39, 25 Apr 2007 (PDT)

merge with VMT?

It seems to me that "Material" by itself is such a common word it is too vague for use in technical documentation:

  • "Material" is often used simply as shorthand for "Valve Material Type" (a specific set of Brush/Mesh Surface Properties), for which VMT is a specific, accurate, and concise term.
  • "materials" may also refer to the game_dir/materials/ folder.
  • "material" is also unavoidably in common use on the VDC, eg "reference material" or "assemble your tools and materials ...".
  • Strictly speaking the "material that a world object is made of" is a physical and procedural property, not just a surface property of an object. Prop Data is an important part of the "World" Material System but it is defined in QC rather than VMT. Many VMTs describe non-physical surfaces; eg those in the materials/Editor and materials/HUD folders.

So unless I've missed something, I would like to propose merging the "Material" into the "VMT" article, and possibly renaming it Valve Material Type. A Human-readable explanation of "materials folder contains Valve Material Type (VMT) files" should go in a Material System Introduction and/or the Glossary. --Beeswax 10:57, 4 Apr 2008 (PDT)

Sounds good to me.--Gear 13:41, 4 Apr 2008 (PDT)

VMT/VTF Naming Problems

I have noticed off and on that some materials fail simply based on their name. I haven't figured out if it is something about the length of the name or another factor... but it seems to be long names.

Let us say I have a material named: generator_floor_fan_001DiffuseMap2_LOD_1 it fails. But changing the name to something like generator_floora works. (Of course, this means I am changing the file name and the references in VMTs, models, etc).

I am curious if anyone else has noticed this and what is the actual limitation that is causing this.--Shawnolson 11:58, 24 September 2011 (PDT)

Looks to me like the first name was too long to be valid. What was the full path? --Artfunkel 12:00, 24 September 2011 (PDT)
The original path in this instance is models/wallworm/props/industrial/generator_floor_fan_001DiffuseMap2_LOD_1 .--Shawnolson 12:03, 24 September 2011 (PDT)
So what is the official limit for texture name length? And is it dependent on just the name or the full path?--Shawnolson 08:18, 20 October 2011 (PDT)

The name has a LIMIT of 22 characters. the path has no problem, just make sure there are no spaces.

Valve Material Type

I've always thought the name "Valve Material Type" sounded stupid, and upon further investigation it appears this is not actually what VMT stands for. On older revisions of this page, and on the Valve ERC (Valve's official SDK documentation from before the VDC), it is noted as standing for simply "Valve Material"; the specific name "Valve Material Type" appears to have been added to this page in this edit.

Posting this here to double check that there isn't some more recent official source which "Valve Material Type" comes from, before I change it on the page. Note that anything post-2008 would have potentially just copied the name from this page, so ideally it'd be something from around that time. - Luke18033 (talk) 23:05, 4 May 2023 (PDT)

Make your material folder names more than 1 character or the materials inside will break

If a folder name has only 1 character and you reference a material inside it (ex. materials/1/texturename.vtf) this will cause the material to be invalid for linux users if you use forward slashes, and windows users if you use back slashes in the path name. Thus it will be broken for some players no matter what and should always be avoided. Tested in Counter-Strike: Source. This information should probably be put as a warning on a more visible page somewhere but i'm unsure where.