Project 1999

Go Back   Project 1999 > General Community > Technical Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 04-08-2011, 10:43 AM
Ropethunder Ropethunder is offline
Developer


Join Date: May 2010
Posts: 396
Default Transparency patcher for legacy textures

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.

[You must be logged in to view images. Log in or Register.]

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.

[You must be logged in to view images. Log in or Register.]

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:

Code:
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:

Quote:
* 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
http://3dfolio.com/files/transpfx_1_0_1.zip

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. [You must be logged in to view images. Log in or Register.]

[You must be logged in to view images. Log in or Register.]
Last edited by Ropethunder; 01-03-2017 at 03:25 PM..
Reply With Quote
  #2  
Old 04-08-2011, 11:26 AM
Savok Savok is offline
Fire Giant

Savok's Avatar

Join Date: May 2010
Posts: 971
Default

Will this work on the updated Velious released textures as well as the classic files?
__________________
Reply With Quote
  #3  
Old 04-08-2011, 11:35 AM
Labyrrinth Labyrrinth is offline
Kobold


Join Date: Sep 2010
Location: St Louis
Posts: 173
Default

Wow, nice work [You must be logged in to view images. Log in or Register.][You must be logged in to view images. Log in or Register.]
__________________
India - cleric
Labyrrinth - enchanter
Reply With Quote
  #4  
Old 04-08-2011, 12:04 PM
nilbog nilbog is offline
Project Manager

nilbog's Avatar

Join Date: Oct 2009
Posts: 14,460
Default

Pure win.
[You must be logged in to view images. Log in or Register.]
Reply With Quote
  #5  
Old 04-08-2011, 03:53 PM
Lazortag Lazortag is offline
Planar Protector

Lazortag's Avatar

Join Date: Apr 2010
Posts: 3,635
Default

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.
__________________
Project 1999 (PvE):
Giegue Nessithurtsithurts, 60 Bard <Divinity>
Starman Deluxe, 24 Enchanter
Lardna Minch, 18 Warrior

Project 1999 (PvP):
[50 (sometimes 49) Bard] Wolfram Alpha (Half Elf) ZONE: oasis
Reply With Quote
  #6  
Old 04-08-2011, 03:55 PM
guineapig guineapig is offline
Planar Protector

guineapig's Avatar

Join Date: Oct 2009
Posts: 4,028
Default

I'm looking forward to trying this out when I get home!
__________________
Quote:
Originally Posted by nilbog View Post
Server chat is for civil conversation. Personal attacks/generally being confrontational will not be tolerated.
Reply With Quote
  #7  
Old 04-08-2011, 04:03 PM
Ropethunder Ropethunder is offline
Developer


Join Date: May 2010
Posts: 396
Default

Quote:
Originally Posted by Savok [You must be logged in to view images. Log in or Register.]
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.
Last edited by Ropethunder; 04-08-2011 at 04:14 PM..
Reply With Quote
  #8  
Old 04-08-2011, 08:10 PM
Muergan Muergan is offline
Aviak


Join Date: May 2010
Location: New Jersey, US
Posts: 72
Default

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 ?
__________________
Mithaniel Marr:
Muergan Valiantheart <Altered Vision>
72 Paladin

Project 1999: Blue
Muergan Valiantheart <Altered Vision>
52 Paladin
Battlemage Omnipotent <Altered Vision>
26 Magician

Project 1999: Green
Pooks <The Drift>
60 Rogue
Muergan Valiantheart <The Drift>
49 Paladin
Reply With Quote
  #9  
Old 04-08-2011, 08:23 PM
Ropethunder Ropethunder is offline
Developer


Join Date: May 2010
Posts: 396
Default

Quote:
Originally Posted by Muergan [You must be logged in to view images. Log in or Register.]
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.
Reply With Quote
  #10  
Old 07-24-2011, 09:03 PM
Ropethunder Ropethunder is offline
Developer


Join Date: May 2010
Posts: 396
Default

Updated the link in the first post with some bug fixes. Now with superior error handling. [You must be logged in to view images. Log in or Register.]

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:05 AM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.