Help with textures for Propper created props

  • If you're asking a question make sure to set the thread type to be a question!

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
I've just got propper working but I suspect I have missed something, or I've not set something up correctly.

In short when I compile my models get the model files just fine, but not the textures for them. Instead Propper 'converts' the .vmt files for all the individual textures by swapping the "LightMappedGeneric" for "vertexlitgeneric". It does not adjust the "$basetexture" paths at all.

For example, if I were to make a example_prop using wood texture, a glass texture and a metal texture, I'd end up with the following item:
  • example_prop.dx80.vtx
  • example_prop.dx90.vtx
  • example_prop.mdl
  • example_prop.phy
  • example_prop.sw.vtx
  • example_prop.vvd
  • wood_texture.vmt
  • glass_texture.vmt
  • metal_texture.vmt
I've highlighted the textures in bold because they are not the texture files I expected to receive. Because of this I have a couple of questions, namely:
  • Is this normal for propper? and
  • How do I make it generate the normal example_prop.vmt & example_prop.vtf for a model?
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
Hi, Werewolf.

Yes, this is normal. Propper doesn't generate VTFs because they already exist in your materials folder. If you use stock TF2 materials in your models, then those will be loaded from the VPKs when the map is run.

If you want to use custom materials, then you would put them in:
  1. The Propper materials folder
  2. Your TF2 custom materials folder
  3. Pack them in to the map
... using the same directory structure in each case. Typically this would be materials/models/your_map.

Does this help? If not, tell us more about what you need to do and we'll see about finding the best way.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
I knew about using custom textures and where to put them already, all I wanted to know was if propper was outputting the right files or if it was doing something different because I had somehow set it up wrong.

As I asked before, how do I make it generate the normal example_prop.vmt & example_prop.vtf for a given model?

Like for example if I download and look at the files for EArkham's Egypt Sphinx & Assets, you see in the tf/models/props_sphinx folder:
  • sphinx_head.dx80.vtx
  • sphinx_head.dx90.vtx
  • sphinx_head.mdl
  • etc
Then in the tf/materials/models/props_sphinx folder it has:
  • sphinx_head.vmt
  • sphinx_head.vtf
I want my generated props to have textures in the same format, NOT just spit out new versions of the .vmt files for the 'ingredient' textures.
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
Open the generated .VMT and change the path to however you like.
 
May 25, 2015
390
307
If I remember correctly, Propper copies all the vmts used on the model to make sure they have VertexlitGeneric. It doesn't however generate a texture sheet based on the model name. All the textures will have the same name but moved to another folder and using VertexlitGeneric as a shader.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
As someone on Reddit has just said to me, "a proper modeling tool would use UVs to map a texture onto the model".

THIS is what I'm asking about. How do I do that!?
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
I included information about custom files because I presumed you were doing something unusual. I hoped to answer any further questions you had before you needed to post them. I also asked you to explain a bit about what you're trying to do, so we could understand better.

I did answer your questions in my post. You asked if the behaviour was normal, I said it was. You asked whether it would be possible for Propper to generate VTFs for your models, I told you no, Propper won't do it.

Propper isn't a modeling tool, it's a compiler. It takes your VMF and converts it in to a Source prop. The modeling tool in this case would be Hammer, and as a result you are restricted to using brushes and pre-existing flat VTF files in your models. If you were to use something like Blender, then it would give you total control over your texture usage. As you'll have seen when opening a texture file designed for a model, it's basically a map of all of the faces of the model. This is advantageous for us, because we can set our static props to have their own lightmaps, but Propper models sadly aren't compatible with this.

So the solution you seek would be to use Blender. I think it's possible to export Propper models in to modeling tools. You could begin there and create your own UV textures later on, using VTFs exported to TGAs, but it would require a lot of work, if you weren't painting the model textures directly.
 
May 25, 2015
390
307
But its not doing that. It's spitting out the same individual textures instead of ONE unified texture.
Yes. This is what Propper does. Propper doesn't merge the individual texture files into one texture sheet. It will however copy the existing .vmt files to new ones that have VertexlitGeneric as their shader to work with models.
Summary: Propper does not merge files, it will however copy them.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
So if Propper is not capable of doing UV mapping, how else can I do it? worMatty said Blender can which I have, but is there a generally easier method or is it a complex job no matter what?
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
I don't really see what the problem is. Even if you did merge the texture files into a single model sheet, you wouldn't really be saving space unless you let it cut down your resolution... which is something you could just do anyway. For what it's worth, the one and only time I exported models from Hammer, I made my own model sheet and used that when I built the model, adjusting the alignments until it lined up the way it was supposed to. I don't know if that would be an option for you or not; I suppose it depends on how simple of a model this is.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
Well, that depends on what you mean by UV mapping. All models have a UV map that defines where on the 2d texture a 3d vertex should exist. It also isn't a rare occurence that a model have multiple textures.
Well given that nearly all of the models available for download here on this site have similar file structures. The model files themselves, then the .vmt and .vtf. There may be extra textures for alternate skins or bumpmaps, but never the original textures. I used EArkham's pack as example of this.

I therefore assumed that if I create a model and wanted to pack it into my map, that the texture files for that model would need to be in that format. Alternatively if I wanted to post a model here for download, that I would have to have my textures in that format.
 
May 25, 2015
390
307
Having one texture file per model is usually more convinient, but not necessary. Several stock models in Source games share textures and have multiple texture files. Models created from Propper, unless you use only one texture throughout the entire model, are bound to have multiple texture files. But it's no danger in it. You only need to pack the models and vmts that Propper spits out, as the vtfs already exists in the game unless you used custom textures, in wich case you should have included them anyway. I hope this helps.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
Brush models, the ones Propper produces, simply refer to existing textures. Each face is configured to use a specific position and angle of the source texture. They work just like a brush in a map. The special textures that come with complex models like the sphinx_head have been hand-painted to provide small detail for the model, including fake shading known as ambient occlusion, which simulates depth without needing to use fancier shading, or more triangles in the game. Notice that the brick pattern at the bottom of its VTF is warped slightly. This is because when it is wrapped around the model, it becomes straight. This texture has been hand-painted for this model.

This very brief video shows the process of creating a model in Blender and creating a UV texture for it. The modeler 'cuts' and 'unwraps' sections of the model and moves them on to a square, ready to be used as a template for painting. The sword model uses the same set of face images for its opposite side, in a mirror fashion. This cuts the work of the artist in half, allows the sword parts in the texture to be larger because there are less of them, which allows for finer painted detail.

The processes of creating a brush model and a 'proper' model run in opposite directions. Brush models use existing textures and apply them to their faces, like moving a photograph around until it lines up correctly. Traditional models are drawn out in 3D, and face textures painted for them later. The high level of detail in a traditional model texture makes them very unlikely to be used in any other models, so they are model-specific.

Brush models made with Propper don't need to be distributed with VTFs if they use the ones in TF2. This is part of what makes them so attractive and handy. They use up hardly any space in the BSP, and they can dramatically reduce the number of brush sides used in the map. cp_gothic is a museum of brush models.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
That too. If you're using stock textures, don't even worry about it. In fact, some of the stock models that look like brushwork — the wooden doorframes and the wooden studs in 2fort's red hayloft — use the same stock wooden beam textures as you use for brushwork.
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
What I think is going on here is @Werewolf has some gaps in understanding the fundamentals of how models, materials and textures work.

A model is a mesh, a list of triangles that make up its shape.
Each vertex in that list of triangles has information like its normal so you know what way it's facing as well as a UV coordinate. In the Source engine model format it also stores a material ID so we know the head and body of a character are meant to use different materials (which is useful because their UVs would overlap otherwise!). So every vertex has a position, a normal vector, U and V coords, and a material ID.
The model file stores some extra info too, like a filepath for each material ID. These are defined by the author of the model.

A texture is a standard 2D image file. Just that. It might have 1, 3 or 4 channels. That is to say, grayscale, RGB or RGB+Alpha.

A material defines how one or more texture files are combined and with what additional maths to render correctly onto the screen.


Then there's some standards Source engine stuff generally adheres to:
Model files go in subfolders of /models
Materials and textures go in relevant subfolders of /materials
Model specific materials go in subfolders of /materials/models

That last distinction makes it east to blacklist /materials/models when looking for materials to use in Hammer, it also provides a delineation between geometry materials and model materials to anyone browsing those files. It's not a requirement, but it helps a ton with big games.

Because most models are authored manually we have a choice over what to name the materials for it. a prop named "window_01" may have materials called "window_01_glass" and "window_01_frame" so that casual observers can see that they're logically grouped together. If another prop wants to reuse those materials, it's not going to rename them, it'll just point to those files.

So far I've been explaining normal methods.

Propper is an automated tool, so it takes info for each vertex from hammer. The position and normal are obvious, the material though doesn't exist because hammer uses one set of materials for brushes and models need another. So it makes a new file for you. It just copies the name of the material that was applied to the brush and changes some settings to make it a model material. The UVs are defined by how you aligned that material in hammer.

The only thing that's really different from any normal model is that, just the fact the files are named something different and you may have more of them than normal.

Most of the models available for download on this site were authored manually in a 3D package, and so had manually created UVs rather than automatically generated ones, and because they're usually more unique models that don't reuse existing textures the best way to manage textures and materials for such models is a single file, hence the naming convention difference you're seeing.

If you want to pack anything into your map, Propper will work absolutely fine for you. If you want to distribute that model, it's still fine. Propper was designed to be usable in exactly this way! The naming convention is only for convenience!

(That said, if you want to distribute propper models, you should probably look into learning to model in a 3D application, because if it can be made with propper, then any of us could just make it ourselves in hammer!)