The Watcher on 30/9/2012 at 15:11
I'm in the midst of going through several of my architectural textures, switching them from gif/pcx to dds and in some cases using 512x512 instead of 256x256 versions of key textures. Doing this, of course, means that textures that were at scale 15 now need to be at scale 14, and I'm really not looking forward to individually changing the scale for each of the, for example, the 1165 faces that one wall texture is on. :nono:
Anyone know of a way that I can either make all faces with a given texture have a given scale, or a way to batch set the scale?
ZylonBane on 30/9/2012 at 15:54
From
material-format.txt:
Code:
terrain_scale <int> [<int>]
---------------------------
Virtual texture dimension for terrain surfaces, can be specified as a single value for square textures
or as width and height. The terrain scale should always be less than or equal to the real image size and
a power of two (1, 2, 4, 8, 16, 32, 64, 128 etc.).
This param can be used to update textures used in
existing missions with higher resolution ones, by specifying the original texture dimension as the
terrain scale. It's also useful when using higher resolution textures to keep the engine texture scaling
at sane levels so lightmapping works correctly.
Ex:
terrain_scale 64
terrain_scale 128 128
redleaf on 30/9/2012 at 17:19
What I have done to globally replace some textures in a mission is to create a mtl file in my fam folder where the new texture resides. I have only used mtl files for scaling so far. It seems you can use them for a lot of other properties as well?
This is going to sound very simplistic to you advanced guys, but I want to write it so that someone who has never done anything like this before and reads this will be able to follow it..
I want to replace an old 128x64 texture globally across my map with a new 1024x512 texture. I want it to fit as nicely on the map surfaces as the previous one did without having to go around and reconfigure and rescale every surface.
My new texture is called TEXTURE01.png.
1. In the same fam folder in which my new texture resides, I create a .txt file and specify the scale that I need that texture to be in my map.
So I type:
terrain_scale 128,64
[just type one number if horiz and vert scale measurements are the same]
I save it as a .mtl file, using the same name as my new texture (Save As "TEXTURE01.mtl"). You don't want to include the extension in the name. And I don't think you need the quotes if using Notepad++.
In DromEd, I then add that texture to my Texture Editor [Textures>Add Family or Add A Single Texture (string argument)].
Then I bring up the Texture Editor [F7] and, on a surface that has the old texture on it, noting the number of the old texture first, I place the new texture.
I now make note of the new texture's number.
If the old texture was no. 32, and the new one no. 44, then under Extras>Swap Texture> (texture_change string argument) I will replace the example text "Texture1,Texture2" with "32,44". Hit Enter.
All the old textures are globally replaced with the new texture. The new texture fits on the surfaces exactly as the old one did, thanks to the mtl file.
That's how I've been handling it. Does anyone know of an alternate or easier way?
ZylonBane on 30/9/2012 at 17:28
Umm... if you want to globally replace a texture, why faff about with saving the replacement under a new name? Dark asset replacement almost never requires that.
redleaf on 1/10/2012 at 12:07
Quote Posted by ZylonBane
Umm... if you want to globally replace a texture, why faff about with saving the replacement under a new name? Dark asset replacement almost never requires that.
It isn't required. Just a personal preference for several reasons. One is so that the original texture is still available if I want to use it for anything, Another is because my texture names often reflect where they came from (eg: 3MDWall01 means I got the texture from 3MD). Just makes crediting easier for me. And when it gets filed in my Custom Textures folder, I can be sure it won't overwrite another texture of the same name.
Nameless Voice on 8/10/2012 at 01:15
Quote Posted by ZylonBane
From
material-format.txt:
Code:
terrain_scale <int> [<int>]
---------------------------
Virtual texture dimension for terrain surfaces, can be specified as a single value for square textures
or as width and height. The terrain scale should always be less than or equal to the real image size and
a power of two (1, 2, 4, 8, 16, 32, 64, 128 etc.).
This param can be used to update textures used in
existing missions with higher resolution ones, by specifying the original texture dimension as the
terrain scale. It's also useful when using higher resolution textures to keep the engine texture scaling
at sane levels so lightmapping works correctly.
Ex:
terrain_scale 64
terrain_scale 128 128
This is...
awesome.
We could use this to make texture mods to replace terrain textures with high-res versions, without needing to rebuild the missions. I could create a version of the EP with upgraded terrain textures (assuming someone could actually make them.)
I guess you've already considered using it to get those SHMUP monitor textures into the stripped missions in SS2?
Yandros on 8/10/2012 at 04:35
I discovered it this weekend too, and I agree it's awesome. I've dropped some replacements into Codex and can't believe how easy it is.
voodoo47 on 8/10/2012 at 06:50
Quote Posted by Nameless Voice
SHMUP monitor textures
it's SHEMP. :sly:
blaydes99 on 8/10/2012 at 17:10
Quote Posted by redleaf
What I have done to globally replace some textures in a mission is to create a mtl file in my fam folder where the new texture resides. I have only used mtl files for scaling so far. It seems you can use them for a lot of other properties as well?
This is going to sound very simplistic to you advanced guys, but I want to write it so that someone who has never done anything like this before and reads this will be able to follow it..
I want to replace an old 128x64 texture globally across my map with a new 1024x512 texture. I want it to fit as nicely on the map surfaces as the previous one did without having to go around and reconfigure and rescale every surface.
My new texture is called TEXTURE01.png.
1. In the same fam folder in which my new texture resides, I create a .txt file and specify the scale that I need that texture to be in my map.
So I type:
terrain_scale 128,64
[just type one number if horiz and vert scale measurements are the same]
I save it as a .mtl file, using the same name as my new texture (Save As "TEXTURE01.mtl"). You don't want to include the extension in the name. And I don't think you need the quotes if using Notepad++.
In DromEd, I then add that texture to my Texture Editor [Textures>Add Family or Add A Single Texture (string argument)].
Then I bring up the Texture Editor [F7] and, on a surface that has the old texture on it, noting the number of the old texture first, I place the new texture.
I now make note of the new texture's number.
If the old texture was no. 32, and the new one no. 44, then under Extras>Swap Texture> (texture_change string argument) I will replace the example text "Texture1,Texture2" with "32,44". Hit Enter.
All the old textures are globally replaced with the new texture. The new texture fits on the surfaces exactly as the old one did, thanks to the mtl file.
That's how I've been handling it. Does anyone know of an alternate or easier way?
Hey redleaf, any chance you could boil it down and put numbers next to each step :D etc.? I'm sure a lot of level builders will want to learn this skill.
EDIT: Looks like Nameless Voice has given the ideal solution. Highly recommended.
Nameless Voice on 8/10/2012 at 21:43
That's much, much too complex.
The better solution:
Suppose you want to replace civicb2/mold09, a 128x64 texture (it's clearly visible at the start of miss1.mis) with a nice 1024x512 texture.
1) Create a civicb2 folder in fam.
2) Save your 1024x512 texture as mold09.png in that same folder.
3) Create a text file and name it mold09.mtl, with a texture scaling matching the original texture's size.
Code:
terrain_scale 128 64
4) Done. No need to modify the mission in any way. This is a drop-in replacement which will even work with stripped missions.
It works because of the new image type priorities.
Quote Posted by Modder's Notes
Image Type Priorities
---------------------
Aside from the new image formats, the priority (which type can override another) has been slightly adjusted.
The priority order is as follows, where the first has the highest override priority:
.DDS
.PNG
.TGA
.BMP
.PCX
.GIF
.CEL
Another change, to make texture overrides work seamlessly with objects and meshes, is that the image type specified
in the object/mesh files is disregarded. For example if object ARROW.BIN uses a texture named ARROW.GIF, the game
will search for any image named ARROW, starting with ARROW.DDS, then ARROW.PNG etc. until it finds an existing
file. Consequently it's a bad idea to create another object (usually for an FM), that uses a different image with
the same name but different image type. For example if you create a new object that uses an image called ARROW.PNG,
then the original arrow object will use that image too instead of ARROW.GIF.