Trenchbroom v2019.6 on Windows 10
Trenchbroom should load shaders that are in nested "directories" within the shader file. For example, if the shader file defines two shaders "textures/a/shaderone" and "textures/a/b/shadertwo", then both should be loaded. Currently it only loads the shaders in the root "directory".
Load a shader file with the directory structure described above, only the shaders in the root "directory" appear in the texture collection. In particular I found this attempting to use the "skies" shaders from "Wrath: Aeon of Ruin"
I'm happy to look at making a PR for this, but I'm not sure in general what TB's strategy for nested texture directories is?
Yeah, can confirm when I set up a Wrath game config. I just get "textures\skies" in the Texture Collections -> Available folder list. So I can't actually select any sky texture other than "cubesplash"
Just to be explicit about the problem, the skies.shader contains shader entries like:
textures/skies/hub1/hub1_sky_
{
...
}
and these seem to be discarded by TB because the path contains 4 elements instead of 3.
Looking at the skies.shader, it looks like we should be listing these folders in the Collections -> Available UI:
"textures\skies\e1m1"
"textures\skies\e1m2"
"textures\skies\hub1"
"textures\skies\devsky"
I'm happy to look at making a PR for this, but I'm not sure in general what TB's strategy for nested texture directories is?
That would be great. I'm not familiar with the code for this. @kduske can you think of any problems with supporting shader paths that aren't exactly 3 elements? (IIRC we also don't support 2 element shaders like "textures\abc", or at least we didn't.. can't find the issue for that.)
I'll look into it when we have 2020.1 out.
I don't see a reason why this shouldn't work, it's just a matter of the UI not allowing you to select the corresponding texture collections. I think rather than fixing this particular problem, we should make it so that texture collections can be arbitrarily nested. And while we're at it, we can also make it so that it picks up loose textures in the root folder.
My proposal would be to scan whatever textures folder we find (from game config or set by user, see #2958) and add a texture collection for every directory we find, independent of the level of nesting. And we even add a texture collection for the root folder itself.
I forgot that TB will assign texture names from that last two components of the texture path, this needs to change as well.
Still doesn't work when files are loaded from the file system instead of from a pak file.