Akven on 4/5/2019 at 19:27
Is there is some automatic batch script to MASSIVELY create .mtl files with terrain_scale x y???!!! I'm creating ESRGAN texture update for Thief Gold, all fam textures already done. But I need some tool to create .mtl files without editing them by hand.
And another question: what textures do need env_map or illum_map in .mtl and what should be there? I think glasses and windows need some sort of illumination map, do they?
R Soul on 4/5/2019 at 22:04
Try this:
(
https://www.mediafire.com/file/7c8av135th4opsv/mtl.zip/file)
I wrote a program to go through each texture and write its dimensions to an mtl file using the same folder structure. I don't think in C# there's an inbuilt way of reading .pcx files so I first used IrfanView to convert them all to .gif, which can be read.
Akven on 5/5/2019 at 09:30
Thanks a lot. Do you by any chances have mtl files for mesh and obj?
R Soul on 5/5/2019 at 12:55
Object/mesh textures are mapped differently. A texture that fits exactly onto a rectangular object face will always fit no matter how big the texture is.
terrain_scale is therefore only for terrain textures. For objects we have tile_factor (see doc\material-format.txt).
It's only for obj, not mesh. E.g. if an original object texture has 4 stone blocks in a square (2x2), and you make a replacement texture which is twice the size and has 16 blocks (4x4), you should use tile_factor 2 so that the renderer keeps the original blocks the same size.
Disclaimer: I haven't used that code enough, or recently enough, to be confident that what I've said is 100% correct, but it's something like that.
Here's the program I used to create the mtl files:
(
https://www.mediafire.com/file/ybqeiyhb81og8oj/MTLFileGenerator.zip/file)
Note it comes with two text files specifying the extracted textures dir and the dir in which the mtl files will be created - the program will create the latter itself. To prevent the program overwriting any previous work (e.g. if you modified some mtl files or you're running it again for T2 textures) it'll won't do anything if mtl folder exists.
It writes the terrain_scale with the original dimensions. tile_factor isn't something that can be done automatically because it depends on what's been done with the new images.
Nameless Voice on 14/5/2019 at 18:44
You want to have the terrain_scale set to the size of the original texture, always.
If your replacement texture doesn't match at that size (for example, your replacement has a 2x2 grid of different variations of the texture), then you need to use tile_factor to compensate for that.
I have a program for viewing and comparing a "new" and "old" version of a texture, which also automatically creates .mtl files when you view them, but I'm not sure if that would be of much use to you
Edit: You can find that program here: (
https://www.ttlg.com/forums/showthread.php?t=140187&page=21&p=2226222&highlight=texturecomparer#post2226222)
Akven on 2/6/2019 at 15:40
Thanks, I only upscale original textures by 4x, so tile_factor isn't used.
I also intended to use illum_map and env_map.
I already done about 2/3 of the illuminations maps for all the lighted glasses and windows.
I think of some simple reflection (enviromental) map for metals, glass and bronze
Something like this:
terrain_scale blahdiblah
tile_factor bluh bluh
force_opaque
edge_padding 0
render_pass
{
texture tex\envmaps\diagenv
alpha 0.5
shaded 1
blend SRC_ALPHA ONE
uv_source ENVIRONMENT
uv_mod SCALE 2 2
}
render_pass
{
texture $texture
shaded
}
I really liked the result. Just need to sort metals from everything else.
Also, new question, can I do several render passes for illumination maps with different alpha? So it would be like the light has some pulse rythm. For Voltage indicators in fam/metal for example. There was some example of animation done with render passes in documentation.
Or can I set different alpha for all the mtl files for animation textures? Documentation in NewDark says that only the first of the mtl file for animation is used.
ZylonBane on 3/6/2019 at 03:49
Quote Posted by Akven
Thanks, I only upscale original textures by 4x, so tile_factor isn't used.
Or can I set different alpha for all the mtl files for animation textures? Documentation in NewDark says that only the first of the mtl file for animation is used.
Every render pass can have its own everything. What part of the documentation says that?
Akven on 3/6/2019 at 16:46
Quote Posted by ZylonBane
Every render pass can have its own everything. What part of the documentation says that?
material-format.txt
"For animated textures only the base/root texture of the animation should have a material file."
ZylonBane on 3/6/2019 at 17:39
Ah, that's what you meant. Yes, it has to work that way because the material system includes features for control of animated texture sequences. To try to assign a MTL to each frame of an animation would be madness. If you want an animated glow effect, just add it as another render pass, synchronized with the main animation.