PDA

View Full Version : Texture patcher for legacy textures


Ropethunder
04-08-2011, 10:43 AM
The transparency bug we experience now as either black splotches or missing transparencies is the result of inherited cludge from earlier versions of EQ where new requirements did not update old specifications. You can see this problem inconsistently across as black swirls, spots, or swaths of color missing or transparency (see stumps in Swamp of No Hope). This is also the cause of many shoes appearing completely black.

I've written a tool which extracts bitmaps from a .s3d pak file and patches them to correct this error.

The legacy issue is the result of the method of evaluating transparent pixels being changed over and over until the first (and very old, at which point) version no longer functions.

The first release of EverQuest was based off of a OpenGL/Glide engine and most likely did not use any form of texture clamping. This would be the basis for how textures and their transparent color would be handled.

http://i.imgur.com/UULvWUC.png

All legacy .bmp textures used the first index in their 8-bit color palette to denote the transparent color within the texture. This color also matches a large portion of the texture which suggests that the original engine would bleed neighboring pixels into the visible area. This is most likely why no single color was chosen to be transparent across all textures.

By the time Kunark was released, the EverQuest engine had transitioned from OpenGL to DirectX and advances in rendering technology had solved the texture clamping problem. Magic pink (0xff00ff) now become a common theme to denote transparent pixels.

I don't know if texture transparency broke when the engine was transitioned to DirectX or later when .dds become the new format of choice. Regardless, I hope you enjoyed learning a little bit about EQ's history and why things are the way they are.

Textures which should have transparency but do not (such as some helmets, stumps in Swamp of No Hope, and various other things) can be fixed by setting the first index in the palette to magic pink.

http://i.imgur.com/U4szL8k.png

At some point all of the textures which should not have transparency began to take the first palette texture and attempt to use it as a transparent pixel. The result was that color drawing as black on the surface of the model. This can be seen most prominently on shoes which utilize only one color.

Textures with a full 8-bit palette will have their first index matched with the nearest color in the palette and will be blended with it at 50% opacity. The old color pixels will then be mapped to the new one, eliminating any pixels being mapped to palette index 0.

Textures with a partial palette like shoes which may have two colors (brown and black, for example), would not be suitable candidates for this solution. Instead, their palettes will be expanded to encompass mapping the old palette color to a new index and all pixels will then be updated accordingly.

The tool provided, "transpfx.exe" provides several command line parameters to customize how the patching will proceed and which files will be affected:

Usage: transpfx file [options]
Options:
--help Display this information.
-all Removes transparency from all supported texture files.
-mp <file[,..]> Update the specified entires to use magic pink for
transparency in their color palette.
-rt <file[,..]> Remove transparency for the specified entires.
-skip <file[,..]> Skip the specified entries.
-o <file/path> Specifies the location and/or name of the new pak file to
be written to disk.
-q Do not display output while parsing.

Unfortunately, the information as to which images "should" be transparent is contained in the .wld files which I have yet to parse. For the time being you can selectively turn on or off transparency for the target textures. The "patch.bat" file provided will automatically create and restore a backup of your old .s3d file so that you can patch and re-patch without having to create your own backups or reinstall EverQuest.

Don't ask me why "some" legacy textures work, such as trees and some helmet textures (high elf male ear pieces). I have no idea. There is probably something being evaluated in the .wld files that I don't know about yet.

No textures, pixels, or diffs are included with this tool so it is 100% free from Sony's copyrights. Feel free to download, link, or mirror it wherever you like.

Textures fixed in this release:

* Enable transparencies for half elf male helmets
* Enable transparencies for human male/female helmets
* Fix black areas on wood elf male helmet
* Fix black eye of zomm
* Fix transparencies for stumps in Swamp of No Hope
* Fix various feet textures which appear black or with black splotches

Here are some glamor shots of what's been updated. Please feel free to post screenshots of your own for texture bugs or if you just want to show off your new mug. :)

http://i.imgur.com/786TWvT.png

Savok
04-08-2011, 11:26 AM
Will this work on the updated Velious released textures as well as the classic files?

Labyrrinth
04-08-2011, 11:35 AM
Wow, nice work :):)

nilbog
04-08-2011, 12:04 PM
Pure win.
http://blogs.psychcentral.com/mentoring-recovery/files/2011/03/i-love-u.jpg

Lazortag
04-08-2011, 03:53 PM
Ropethunder is totally legit. I downloaded his first transparency patch and it fixed all the half elf/human helms perfectly. I don't wear a helm but I like to see people's eyes when I look at them.

guineapig
04-08-2011, 03:55 PM
I'm looking forward to trying this out when I get home!

Ropethunder
04-08-2011, 04:03 PM
Will this work on the updated Velious released textures as well as the classic files?

This tool selectively updates the targeted .bmp files in the .s3d pak file. It should not cause problems with any custom texture packs.

Muergan
04-08-2011, 08:10 PM
I downloaded this and extracted to my EQ directory. I then clicked on the batch file and a dos window popped for a sec then closed. My game now crashed upon character select have to do a reinstall... did i do something wrong ?

Ropethunder
04-08-2011, 08:23 PM
I downloaded this and extracted to my EQ directory. I then clicked on the batch file and a dos window popped for a sec then closed. My game now crashed upon character select have to do a reinstall... did i do something wrong ?

What is your operating system and which version of EverQuest are you using? The batch file is using extensions that only exist in Windows 2000 and above, in case you're some how trying to run it in an older operating system.

To fix your EverQuest installation, search the directory for *.old. Your old .s3d files should still be there. The patcher is supposed to roll back the changes if a problem occurs and display a diagnostic error.

Instead of double clicking on the batch file, open a command prompt in that directory and then run it. That will make sure that you will see all of the information as it appears without the window closing by itself. You will probably have to rename the .old files to .s3d files first.

Ropethunder
07-24-2011, 09:03 PM
Updated the link in the first post with some bug fixes. Now with superior error handling. :)

If you have any errors, please paste the output you get from the command line.

Raxus
01-29-2012, 11:39 PM
http://www.project1999.org/forums/showthread.php?p=534865#post534865

i was directed to this post by nilbog. i used the batch file and i still have my problem on darkelf plate and certain highelf female hair. any ideas? on how to fix?

Chrushev
01-30-2012, 02:37 PM
http://www.project1999.org/forums/showthread.php?p=534865#post534865

i was directed to this post by nilbog. i used the batch file and i still have my problem on darkelf plate and certain highelf female hair. any ideas? on how to fix?

The specific texture has to be adjusted.

Raxus
02-06-2012, 10:05 AM
ran bat file. didn't seem to help by itself. Ran CMD on transpfx to try and add magic pink or otherwise screw things until i got an improvement.

C:\program files (x86)\sony\everquest>transpfx file [options]
transpfx: Multiple files encountered where only one was expected.

i think this is an error msg. what did i screw up =/
------------------------
on a side note, does anyone have the files patched up that work on their comp that they can share? might be easier just to copy/paste dump rather then patch it.

Casey
02-06-2012, 11:24 AM
Extracted to Everquest folder. Ran the exe, unsuccessful files not found.

Edit : For whatever reason, it worked anyway despite the error.

LaMort
03-01-2012, 03:42 AM
transpfx error

cant finf transpfx.exe ?

copy in eq folder and just click path?

Ogre
06-09-2012, 03:55 PM
got here from the thread nilbog bumped, file download doesnt seem to work anymore any mirrors out there?

maximum
06-12-2012, 12:10 PM
Anyone have a viable copy of the ZIP that they can post online?

Chrushev
06-13-2012, 12:13 PM
Anyone have a viable copy of the ZIP that they can post online?

Its part of my installer (see my signature) use the option (10)

maximum
07-13-2012, 06:02 PM
Its part of my installer (see my signature) use the option (10)

I still would like an independent, stand-alone copy. If anyone has the original ZIP, I will make a mirror download. Send me a PM or something.

Portsche
07-13-2012, 06:13 PM
I still would like an independent, stand-alone copy. If anyone has the original ZIP, I will make a mirror download. Send me a PM or something.

Nilbog is working on re-releasing it with updated fixes here (http://www.project1999.org/forums/showthread.php?t=34503).

maximum
10-13-2014, 02:31 PM
Bump.

Danelorn
10-07-2019, 01:16 AM
Bump. Looking for a copy of this if anyone can help.

Ropethunder
01-09-2025, 01:57 AM
Added the original release as an attachment on the first post, in case anyone still needs this.