Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Adding fashion transparency to 1.3.6

Initiate Mage
Joined
Mar 14, 2021
Messages
4
Reaction score
0
As far as I've been able to find, it seems that it's been several years since anyone tried to deal with fashion transparency in 1.3.6, so I'm hoping that with new discoveries and tools etc, it might now be possible.

Originally, the alpha in a DDS was used as the tint mask. Later, transparency in fashion was added, which required using the alpha layer for transparency instead, and adding a whole new texture file to be used as the tint mask instead. What tells the game to handle this differently? As far as I can tell, the files are all the same, only the presence of the extra tintmask file is different. (Do we know what each channel of this extra file does? B is the tintmask, but what about R and G?)

I've read that a .ecm is what controls transparency (DestBlend), however, I can't find that fashion has one. The only .ecm related to a fashion item that I've been able to find is for the dropped item model/textures. This includes the items that should have transparency. I checked both my 1.3.6 files and files from a 1.4.6 client.
Is it possible to add a .ecm to a fashion item? I've seen (albeit with dead images) that some creative things are possible with editing a .ecm, in the Kristkos' thread "playing with colors and transparency". I imagine, though, that through that method we would lose the ability to dye fashion items. With how reliant certain items are on transparency to look right (for example, the Corsair's Coat) it might be a worthy trade-off.

Transparency in the game must be possible, as it's used in landscape objects, like skeletons, and on mounts. Is it a different setting within the .ski files, perhaps? I do not have any experience with 3d stuff, so trying to work out that one myself has been fruitless as I don't know what I'm looking at in Blender.
Opening .ski for a mount in notepad++ does have references to .dds, which might be hiding the answer, but it's mostly not any form of readable text - is there a way to convert it to be readable?

This is all the info that I've been able to put together - no doubt I'm missing some things, as I've only been at this whole modding thing for a week or so :) Even if we can't find a way to do it, I think it would be helpful for the future to have all of this information in the one place, at least.
 
Last edited:
Newbie Spellweaver
Joined
Dec 14, 2019
Messages
30
Reaction score
232
For the record, we managed to achieve fashion transparency in pw 1.3.6 by modifying the pixel shader for fashion, see the code below. That's fashionrender.txt inside shaders.pck. In general, the shader is what reads the alpha channel of the texture and uses it as tintmask for RGB channels. The alpha channel is then set to 1 (no transparency at all). The modified shader below checks for full magenta RGB color - RGB(1, 0, 1) - on the texture, and sets full transparency for those pixels in game. There's a slight threshold for variance of the magenta color to properly handle mipmapped or scaled textures.

Code:
ps.1.4

def c4, 1.0, 0.0, 1.0, 0.0
def c5, 0.4, 0.4, 0.4, 0.325

// c0 is the fashion color
// t0 is the base texture

texld r0, t0

mul r1, r0, c0
lrp r2, r1.a, r1, r0
mul r2.rgb, r2, v0
+mov r2.a, v0.a
sub r0, r0, c4
dp3_sat r1, r0, r0

add r0.rgb, r2, v1
sub r1.a, r1.a, c5.a
cmp r0.a, -r1.a, c4.a, r2.a
 
Upvote 0
Back
Top