collapse

* Notice

Important notice (31 July): We have recently recovered from a nearly two day downtime due to an attack. No data was lost or stolen but the server has been reinstalled as a precaution. Please let us know if you encounter any issues. We apologise for the unacceptable inconvenience. Please read here for more information.

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Re-texturing All of VtMB  (Read 8715 times)

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re-texturing All of VtMB
« on: January 15, 2017, 07:09:00 am »
So, one of my many projects in this mod is to re-texture the entire game.

Yep, I'm bloating my mod with an entire set of larger textures.

I have been reading a bunch of threads.

The basic idea of this seems to be doubling or quadrupling(?) the size of the texture? Like getting at least one dimension to about 2048 in the case of wall textures etc.?

What do you guys recommend? Also what else do you apply to the textures in general to make them look better? Sharpening filter after the resize? I guess it's situational but if any of you have a clear idea of how to make all textures look better in general, please do share.
« Last Edit: January 15, 2017, 06:03:35 pm by Icicle »

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #1 on: January 15, 2017, 07:32:59 am »
It looks like increasing the size of the texture, duplicating the original layer overtop it then applying the sharpening filter to that, then setting opacity to 50%, will produce better results than just sharpening alone. This way the sharpening won't make it pop out at you too much but the quality will improve. I will experiment. Advice would be appreciated.

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #2 on: January 15, 2017, 07:47:27 am »
Yeah, that seems to be the magic. I'm going to figure out a way to script GIMP so I can just automatically resize/extra layer/sharpen layer/opacity 50%/merge all/save

Also I don't need to do the spec mask textures, that saves some time and file size bloat.

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #3 on: January 15, 2017, 11:13:45 am »
Here's the original texture of the Asp Hole door:



Run the Gimp script I made:



Now the Asp Hole door texture becomes this:



I can now transform this script into a batch operation and then do multiple files at once if I want.

I might not though, maybe not everything will look good with the same amount of sharpening? Not sure yet.

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #4 on: January 15, 2017, 12:33:32 pm »
Ok, now there's a problem with updating the textures to a larger size.

All the textures in the map have scale and offset settings. These become wrong once you double the texture size.

However, if you change the X/Y Texture Scale to half for each (for example the most common 0.25 becomes 0.125),

and you change the X/Y Texture Shift to double for each,

the texture will look normal.

But there's the problem:

You have to go through the WHOLE map of every map that uses the texture you changed, and update these things.

That's kind of insane, but I figured out a way to get it done.

First of all you need to have every map in the game decompiled to .VMF format, the format loaded up in Hammer.

These VMFs are in text format so what I can do is write a script that seeks through every file, finds places with: material" "BRICK/ASPDRA" (for example, an Asp Hole brick texture)

and if it finds one like that, alter the "uaxis" and "vaxis" entries just beneath it, like so:
      side
      {
         "id" "875"
         "plane" "(945 96 80) (945 96 8) (850 96 8)"
         "material" "BRICK/ASPDRA"
         "uaxis" "[1 0 0 -264] 0.25"
         "vaxis" "[0 0 -1 576] 0.25"
         "rotation" "0"
         "lightmapscale" "16"
         "smoothing_groups"
      }

The script just has to halve the X scale and Y scale, and double the X texture shift and Y texture shift.

Then it saves the file, and you can load it up in Hammer, everything should look fine, compile the map...bam...enhanced textures, in everything!

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #5 on: January 15, 2017, 12:49:29 pm »
Nevermind!

I found a MUCH easier way.

When you double the texture size, this line has to be added into the material .vmt file:

Code: [Select]
"$basetexturetransform" "center .5 .5 scale 2 2 rotate 0 translate .5 .5"
It does the doubling/halving stuff for you, so the scale and offsets in the map remain correct!

Wow, it's gonna be so easy to improve the textures in this game now

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #6 on: January 15, 2017, 12:56:10 pm »
Before:


After:


The door/bricks aren't as blurry. They retain some grain. I think it's more noticeable at higher resolutions - these are 1024x768.

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #7 on: January 15, 2017, 01:01:28 pm »
Here's the same thing but in 1600x900. The difference is more noticeable, but since the image uploading service I used scaled them down to 1280width, it's still hard to see.

Before:


After:
« Last Edit: January 15, 2017, 01:03:18 pm by Icicle »

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #8 on: January 15, 2017, 01:05:38 pm »
Might have to drop the sharpening level a bit, I see a little bit of these rainbow artifacts from it on the door.

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #9 on: January 17, 2017, 11:06:55 pm »
Ok so I've worked out a set of small changes to apply to each texture that won't cause weird artifacts to appear, and makes the game slightly more visually stimulating instead of washed-out looking.

Obviously it can't be a drastic change, or things would look wrong, so it's very subtle and many people might not even notice without thinking about it/comparing.

1. Double the texture size using the best interpolation (best-looking scale-up resize)
2. Duplicate the layer
3. Some sharpening
4. Tiny bit more contrast
5. Tiny bit more saturation
6. Very mild soft glow effect to enhance vividness of color scheme
7. Set new/upper layer opacity to 50%, where the changes are applied, so it's sampled/mixed with the original look in order to avoid anything too crazy.

The result is that when you walk really close to something, instead of the pixels exploding into a blurry mess that looks like garbage, you get a semi-blurry mess that looks more recognizable.

I can't do better than this, the upper limit is 2048 pixels.

Anyway, I'm making my GIMP script that does these changes auto into a batch script now.

I've also made a powershell script that automatically edits the VMT file and puts in the extra line so the textures remain properly fitted to the surfaces in the game.

Then I'm putting it into a context menu option.

Originally I bumped the Windows max limit of context menu items from 15 to 100, but that's not enough...so I increased it to 500. Now I can do ALL textures in a folder at once.

The workflow goes like this:
1. Open a VPKContent\materials\folder (for example bricks or asphalt).

2. Use the windows Search in the top right corner of this folder window, type: *.* -ref -normal -bump (this excludes all _ref and _normal and _bump files, so we won't accidentally process any spec masks or bump masks)

3. Copy all the TTH/TTZ/VMT files in the search results to the project's same folder path (/materials/folderblahblah)

4. Close VPKContent/materials/folderblahblah window to avoid confusion
    Now working in project folder/materials/folderblahblah

5. Select all the TTH files, right-click > Convert to .TGA (bloodlines SDK)

6. Select all the .TGA files just made, right-click > Use GIMP VtMB Texture Enhance

7. With the .TGA files still selected, right-click -> Convert to .TTZ (overwrites the existing textures with Bloodlines SDK)

8. Select all the .VMT files of these textures, right-click > Use Powershell VMT Update Script ... then all the VMTs will be updated

done, enhanced textures for very little work
« Last Edit: January 18, 2017, 01:16:57 am by Icicle »

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #10 on: January 18, 2017, 12:46:43 am »
lol ok, maybe doing 200+ textures at a time is a bad idea.

My computer is decent but all that image work simultaneously makes it chug pretty hard lmao

I think each operation on the .tga image is a separate process, and then you consider its doing it to 200 files at once, no wonder it pops up weird errors about memory allocation and stuff haha

so I'll have to do like ~30 to ~50 at time...

but it works!
« Last Edit: January 18, 2017, 12:53:33 am by Icicle »

Offline SpardaSon21

  • Fledgling
  • *
  • Posts: 4
  • Reputation: +0/-0
Re: Re-texturing All of VtMB
« Reply #11 on: January 18, 2017, 12:52:33 am »
I ended up lurking here to follow the Antitribu mod, and everything you're showing off finally has me motivated to post.  I'm loving the work you're doing to update this game and keep it fresh after all these years, so keep it up.

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #12 on: January 18, 2017, 01:28:23 am »
heheh

took 1/2 an hour to do the entire bricks texture folder...

I mean I could automate this so it does everything for me but I like to oversee it a little in case of mistakes or problems

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #13 on: January 18, 2017, 02:09:29 am »
aha, yes I knew it... some manual input in the process is good.


the /materials/blends/ folder has $basetexture and $basetexture2 lines, well the VMTs need two additions in that case, $basetexturetransform and $basetexturetransform2

automating the process means this woulda slipped past me and maybe made it into the release without me noticing

Offline Icicle

  • Methuselah
  • ****
  • Posts: 461
  • Reputation: +19/-3
Re: Re-texturing All of VtMB
« Reply #14 on: January 18, 2017, 02:41:24 am »
after doing about 5 of these texture folders, including building/brick/asphalt, I decided to take a look around the LA downtown hub... it does indeed look much nicer.

FYI, I'm being careful to preserve any files here that are from the Unofficial Patch, i.e. ones that already replace the originals. If they are textures they are getting resized too, but I'm just saying that Wesp's fixes aren't getting lost here
« Last Edit: January 18, 2017, 03:22:03 am by Icicle »

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal