Mdl models with transparent textures?

Hexen II mod discussion
Post Reply
User avatar
Inky
Posts: 45
Joined: Sat Apr 18, 2020 8:05 am
Location: Paris, France
Contact:

Mdl models with transparent textures?

Post by Inky »

Hi guys,

I feel very awkward asking, but I don't feel like wasting hours to figure out, in case someone out there already knows: can you have a transparent texture on a mdl model???

That should be as simple as putting any texture on a model, and some examples in the vanilla game let me think that's nothing impossible: imps have holes in their wings, some very cool waving spider web curtains can be found in underground areas... So what am i doing wrong? The supposedly transparent pixels appear black and opaque. I even tried to put a web skin on my model just to see what happens, and Quark doesn't manage to save the file (because of an "Invalid packed model structure" :shock: :?: :?: :?: )

Any help?

User avatar
Inky
Posts: 45
Joined: Sat Apr 18, 2020 8:05 am
Location: Paris, France
Contact:

Re: Mdl models with transparent textures?

Post by Inky »

PS
Also about models, my understanding is that a mdl model intrinsically has an XYZ point defined as its "origin", which decides where exactly the model is positioned in the world by the game engine, and around which rotations are performed, if any. Am I wrong ? The next (and real) question being: is there a way to move that (supposed) origin's position, in order to make the model rotate differently (say around a shoulder instead of around the spinal column, for example)???

Mathuz
Posts: 55
Joined: Tue Apr 02, 2019 6:40 am

Re: Mdl models with transparent textures?

Post by Mathuz »

It took me some time to figure out transparency as well. Easiest way would be opening the model in QME and then: View > Model Properties > Flags > By Number and check 0x00004000 flag (second column, second from the bottom), which sets the transparency. All the transparent parts of the texture need to have palette index number 255. I use Gimp to modify the texture with the right palette index.

User avatar
Inky
Posts: 45
Joined: Sat Apr 18, 2020 8:05 am
Location: Paris, France
Contact:

Re: Mdl models with transparent textures?

Post by Inky »

It works! :o :D
Wow, I would never have figured out on my own (how could anybody guess that 0x00004000 thing??? :shock: )
Thank you so much! :) :) :)

About the fine tuning of the object's origin's position, I managed to find the answer by myself. In QME too, in the Toolbox view the last button called Object Tools notably lets you Move around the X, Y and Z axis. What it does is actually moving the object "origin".

Mathuz
Posts: 55
Joined: Tue Apr 02, 2019 6:40 am

Re: Mdl models with transparent textures?

Post by Mathuz »

Your're welcome. I just checked the models with transparency and used the same flag. It worked :D

User avatar
Inky
Posts: 45
Joined: Sat Apr 18, 2020 8:05 am
Location: Paris, France
Contact:

Re: Mdl models with transparent textures?

Post by Inky »

Impressive...
But how on earth did it come to your mind that random flag may have anything to do with transparency?????? :o
Is there a help resource about those flags somewhere that I missed ? :|

Mathuz
Posts: 55
Joined: Tue Apr 02, 2019 6:40 am

Re: Mdl models with transparent textures?

Post by Mathuz »

Well, I tried all the available flags, they have various efects, mostly particles. Here is the list I saved back then. It may not be precise, but it can give you rough overview.

00000010 - red particles, two rows diverging
00000020 - red particles, falling in row
00000040 - like 00000010, only brownish
00000080 - bluish particles
00000100 - yellow particles, like sparkling
00000200 - blue particles, falling like fountain
00000400 - ?
00000800 - black particles, like evaporating smoke
00001000 - alpha channel, but somewhat different than standard 00004000
00002000 - red particles in row
00004000 - standard alpha channel
00008000 - another alpha channel, need to test
00010000 - billboarded
00020000 - blue lightning + blue particles
00040000 - brownish particles, falling
00080000 - darker blue lightning + gently falling blue particles
00100000 - brownish particles
00200000 - yellow lightning with blue and red sparkling particles in the middle
00400000 - green lightning + evaporating green and brown particles
00800000 - red particles, short row

User avatar
Inky
Posts: 45
Joined: Sat Apr 18, 2020 8:05 am
Location: Paris, France
Contact:

Re: Mdl models with transparent textures?

Post by Inky »

Wow...

Is there a chance you kept your tries somewhere on your hard drive to help seeing them in action without having to redo all the testing? :)

Mathuz
Posts: 55
Joined: Tue Apr 02, 2019 6:40 am

Re: Mdl models with transparent textures?

Post by Mathuz »

Unfortunately, no. I just used basic 1-face model and tested one-by-one all the flags. So I didn't keep the maps with all of them, I somewhat remember them based on the notes, but I realise it is difficult for others :)
There is also rotating and some other particle effects from Quake, which you can see in 'by name' category.

Post Reply