Open vrad-exe opened 2 years ago
./
could also stand in for |material_dir|
Ah yeah, one advantage of the pipe replacement keys though is that they can be used in the middle of a line as well (or at least that should work...)
So for example if I were using the Patch shader (which requires the full material path including materials/
and .vmt
), I could do include "materials/|material_dir|base.vmt"
or whatever.
Which component should be improved?
Other
Describe your feature suggestion in more detail
One feature I've always wished Source had (and which I was surprised it didn't the first time I made a material) is the ability to specify texture paths relative to the location of the VMT, instead of always relative to
materials/
. This would allow moving materials around between folders without having to manually update all the texture paths in them.One way I imagine this working is similar to relative gameinfo search paths, with specific keys surrounded by pipes that could be used in VMTs and would be replaced by a relevant file path. The two I had in mind were:
|material_name|
- Path to the material relative tomaterials/
folder, minus extension|material_dir|
- Path to the directory the material is in, also relative tomaterials/
folder and without the extensionSo for example, the following VMT located at
materials/models/some_props/prop1.vmt
:would effectively behave as:
Of course the big downside with this is that materials using this feature would no longer be backwards-compatible with other Source games. I don't think this is a huge concern though, since we add new graphical features you'd probably have to modify a lot of these materials by hand anyway if you wanted to port them to a non-Chaos game. It also could potentially cause issues with random things using pipe characters being interpreted as these, but I don't see that being a problem at all since pipes are a disallowed character in Windows filenames (which Source generally follows).