Understanding Mask Mode

So this week I thought I’d put my tutorial hat back on and talk a little bit about ‘Mask mode’, what it is, how it works and why it works! During the process of writing it however, the lovely Gryphon Ronas also wrote an explanation about Mask Mode and well – if you can’t do it better, share it! So a big thank you to Gryph for allowing me to share this 🙂

<3 Daria

Understanding Mask Mode

When our video cards process the scene in front of us, they have to decide what is visible and what is hidden. Normally they do this very well. If everything were either transparent or opaque with nothing in between, there would be no problem. But our world is not that simple. We like things that are sheer, and shaded. That’s where it can get tricky.

The problem we have with layers disappearing is not new at all. We used to see it with things like a wall that has a window in it – all on one prim and done with texture. If you put a tree outside, sometimes that tree would appear to come inside. You would see it between you and the wall, not outdoors where it belongs. We notice it more now on our bodies because our bodies are a much more difficult thing to render than a tree and a wall.

Second Life software uses an interface, a set of instructions, to talk to your video card that is called OpenGL. It’s a pretty popular one, it has been around since 1992. Despite its age, it’s not actually outdated or obsolete. But some of the highly complex situations we encounter daily in SL are a bit tricky for it. One of those is multiple layers of transparency, like tattoos and stockings, for example. OpenGL gets a bit confused sometimes. The things we do daily here were not even dreamed of when OpenGL, or SL for that matter, were born. Fortunately, we do have a workaround.

There are 2 kinds of transparency in use. First we have Alpha Masking. This is an all-or-nothing thing. Think of alpha layers on the classic avatar. It’s either opaque or it’s invisible, there is no in between. This is perfect for some things. But things like tattoos and sheer stockings need something more. For that we have Alpha Blending. This is built in to the texture and called an Alpha Channel. This channel has 256 possible values ranging from fully transparent to fully opaque. That’s where shadows, sheer fabric, and tattoos come in.

The problem comes in when we put to mesh faces close to one another and give each one an 8 bit alpha channel (Blended Alpha). The video card now has to decide which one is in front, and it has to combine the opacity of the two. Due to the way OpenGL works, sometimes the card decides that the texture behind is completely hidden so it does not show it at all. This is why sometimes you can turn the layers off, then back on again starting with the tattoo layer and they will show up.

** SIDENOTE ** You can wear 5 tattoo layers and stack sheer clothes over them until the cows come home on a classic avatar and this glitch will never happen. The reason is because your card is not rendering those individually as it is with a mesh body. No matter how many clothing layers you have on your classic avatar, it’s all one texture, baked on the server and sent to you.

OK, so what is Mask Mode for? Remember, your video card gets confused with stacked Blended Layers. But adding a Masked Layer between them acts like a full stop for the calculations. Think of it as dividing a pile of white papers by slipping a sheet of red paper into the middle of the pile. With that marker in there, you can easily tell where the upper half and the lower half of the pack are. A Masked Mode layer acts like the red paper, telling the video card what is what with the layers.

An example of how to use the Mask Mode is to wear a tattoo on the tattoo layer and sheer stockings on the pants layer. Chances are, the tattoo will disappear. Add something on the Underwear Layer, and turn on the Mask Mode on your Lara HUD. Your tattoo will now show up beneath your stockings the way it’s supposed to. That Masked Layer in between the two worked like our red piece of paper in the pile of papers in the last paragraph, allowing both blended layers to render properly.

This glitch has been around for years, no video card, no software, and no product is fully immune to it. SL gives us tool to combat it, but those are not something we as end users can employ. The best thing we can do is choose our applier layers carefully and plan ahead to overcome the problems that can crop up. Once you have done it a few times, it will become routine.

9 thoughts on “Understanding Mask Mode

  1. so… do i get this right… let’s say I’m wearing a tattoo, and I want to wear a partially transparent pants layer on top, or maybe even partially sheer mesh clothing, i could apply a 100% transparent texture to underpants, set it to mask mode, and all is well?

    • In theory, yes! In practice though I’ve found that if I’m wearing two layers, one of them has to be mask mode for the other to show up, the ‘slip between’ mask mode layer still seems to glitch for me, but I’d be interested to hear how you go!

  2. I’m curious how many tattoos we can get away with on a maitreya body…. say like you wanted one for your back , one for your hand and then one for say your leg…is that possible at all?

  3. I am all about planning ahead. I have questions about applying my layers. I joined your FB group but figured I’d create an account here too bc I love your blog! It’s been so helpful! So…. I purchased a Slink Physique HG Body/Hands/Feet and a Logo Quinn Head. My customization HUDs are not fully fully rendering to my screen, so I am working on building the avatar at the moment and will adjust skin, make-up, and shape later on a different computer maybe? Please correct me or advise! Also with the mesh bodies, when do you Wear a layer and when do you Add a layer?

    1. SL Standard Avatar (Remove clothing? Does it matter?)
    2. Apply Slink Alpha
    3. Apply Body
    4. Apply Hands & Feet
    5. Apply Omega Applier — which I need to check if I have this properly Installed as I am seeing these need to be installed rather than attached?
    6. Apply Logo Alpha Layer
    7. The daggone system eyelashes always come through and I have to find where they are attached and detach!
    8. Apply Head, Eyes, Lashes, Eyebrows… Trying to think of all the add-ons from memory atm!
    9. Apply Logo Omega Applier

    I noticed with the Add vs Wear that affects the skin rendering so I think I’ve got that! Interested in understanding the Mask Mode too! Thanks for whatever advice you can give me!

    • Hey Ktdiddle! Okay so by layers do you mean the items you’re wearing or are you talking about mesh body layers? to wear your body and head do the following:
      1) Wear the full body alphas to hide your system body and head/eyelashes (you can just wear one called ‘invisible avatar’, it’s in your inventory by default, just wear that)
      2) Add your slink body
      3) Add your slink hands
      4) Add your slink feet
      5) Add your mesh head (if you want to use omega, make sure it’s the Omega labelled quinn head), and the eyes and everything that comes with it that you want to wear
      6) Add the Omega installer for slink and press it to install it into everything you’re wearing at once (for additional hands and feet, wear those and install it too)
      7) Now you have a body and head, tweak the shape any way you want to
      8) Apply any skin you want to your body (make sure it’s a slink or omega applier) then to your logo head (a logo or omega applier)
      9) Now you can play with your mesh head HUD to put on makeup/change lashes and such and get dressed!

  4. Regarding:
    “** SIDENOTE ** You can wear 5 tattoo layers and stack sheer clothes over them until the cows come home on a classic avatar and this glitch will never happen. The reason is because your card is not rendering those individually as it is with a mesh body. No matter how many clothing layers you have on your classic avatar, it’s all one texture, baked on the server and sent to you.”

    I totally do not get why they had killed baking behavior. Also, all that finger pointing to OpenGL “glitches” sounds more like excuse for not fixing, than really unbeatable problem. Ironically it isn’t even a glitch or bug of OpenGL, it is just general cons of alpha sorting.. Server side baking is good example of solving “unsolvable” problem and I believe creative LL dev could come up with more workarounds to deal with it instead of lazy throwing us in face of cons of alpha sorting.

    By the way, suggested workaround (with mask in a middle) is not working.

    If you are like me, who time after time wants dirt on my skin on top of permanent tattoos, some blood may be desired in some instances also – the only thing working is drawing own tattoos or buying fullperm so you can do photoshop “baking”. If you can’t do that, flood LL with complains, so they could get reason to try to reconsider their current stance. 🙂 As they had put efforts into Bento, they may change their mind about making tattoos useful with Bento also.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: