Category Archives: Educational

Everything you need to know About Alpha Layers in Second Life – Part 2

In the previous article, I talked about some of the history of creating in Second Life and the challenges we faced as creators and as customers in hiding the avatar body to prevent clipping of our skin through the clothing. Or even just hiding the body to wear a cute dragon avatar! In this article I will talk about the current state of things. Starting with…

Bakes on Mesh

In March or so of 2018, Linden Lab made the announcement that they would be implementing this new feature called “Bakes on Mesh“. Bakes on Mesh would take whatever textures were baked into the hidden, base SL avatar, and display it to whatever worn mesh items had the “Bake” flag applied to them.

A peek into our working folders

When Bakes on Mesh was announced, we at the Slink workshop had already started, and were several months into, our “More Alpha Cuts” project. Our scripts were groaning under the weight of what we had already, and adding the many requested new alpha cuts was a very daunting task, but nevertheless, we had started to break up our body and HUD into more pieces and faces, and explore what was required for the new setup.

Of course, being early adopters, and always keen to keep up with new technology, we jumped on Bakes on Mesh as soon as the project viewer became available. I read everything I could find about it. I explored all of the available options in the new viewer. I experimented, and became actively involved in development, since I was one of a few creators I knew about at the time who were using the project viewer and developing for it. I logged a number of bugs through the SL Jira. I even found a nasty little bug that caused LL to take the project viewer offline while they fixed it!

I blogged about Bakes on Mesh in April of 2018, because I felt that this was something that we couldn’t just throw out there. It needed time for SL residents to adopt and accept so I wanted to start that process as early as I could. And I knew it would really be a game changer, so I wanted to do my part in preparing SL residents for the adjustment.

An early BOM test wearing my beloved Tuli skin on my mesh head!

Bakes on Mesh has been a creative boon on a number of fronts. I strongly believe that when Linden Lab gave us the ability to upload and wear mesh items, Bakes on Mesh should perhaps have happened at the same time. It would have pushed the mesh implementation project back a few months, but it would have answered a lot of questions that never needed to be asked.

Anyhoo I digress. I settled into that project viewer like it was my new home and used it exclusively for the almost year and a half or so that it took for the Bakes on Mesh project to go from initial announcement to release.

Alpha Modes

SL has had the ability to change the way textures with alpha channels display on prim faces for some years now, and we had written into Slink’s code to always set the skin layer to mode “none”, as alpha channels on skin textures can cause some strange lighting glitches to happen. So one day I was messing about with my BOM prototype body, with the skin layer set to the alpha mode “none” as always, when it occurred to me that if a skin layer could bake to the avatar, and a shirt layer could bake to the avatar, maybe an alpha layer could bake to the avatar.

An example of how alpha masking with a mask cutoff looks while editing.

We no longer used alpha layers to hide our bodies for Bakes on Mesh enabled bodies, as that is done by BOM magic 🙂 So I put on a random alpha layer that I had floating about in my inventory and… nothing happened, other than disappointment. But then I thought “wait a minute, what if I set the alpha mode to Alpha Masking instead of None” (one of the other options available in the alpha mode mode menu) To my absolute delight, my body disappeared exactly where the alpha layer said it should, with a nice sharp edge, and no lighting glitches!

I experimented some more and worked out that changing the “Mask Cutoff” value could also make the edge of the alpha’ed section move, provided the texture was blurry! I made a new alpha layer that was a big old blurry semi transparent gradient from waist to ankles and found that I could change the alpha’ed section from *most of the legs* right up to *none of the legs* with one single alpha layer, just by changing that mask cutoff value!

This was my big aha moment. I excitedly showed it to my scripter (my very patient husband Caine), archived everything we had been working on up to that point, and started a new project called “No Alpha Cuts”

How one alpha layer can change depending on the Mask Cutoff Value

As it turns out, Bakes on Mesh has almost completely eliminated the need for HUD controlled alpha zones. There is an important exception which I will go into in a moment.

Alpha Mask/Alpha Layers

With Bakes on Mesh, we are back to using our brilliant, reliable, low avatar rendering cost, easy to create, inexpensive avatar alpha layers. All you do is wear them and your mesh body will disappear wherever the texture says it should, the same way your SL avatar body would prior to mesh implementation, prior to alpha zone HUDs and all that extra complexity.

An important change that has come along with Bakes on Mesh is the ability to wear up to 60 system layers of whatever kind you want. We are no longer limited to 5 tattoo layers, 5 alpha layers etc. We can wear any number of any kind of layer that we like. This means that if you have an alpha layer for your jeans, one for your shoes, one for your gloves, one for your shirt, one for your scalp, one for your hands, you can wear all of them at once, and they will combine in rendering on your avatar into one big, beautiful alpha layer!

Editing an alpha layer

Creating Alpha Layers

Alpha layers are also very easy to create. Everyone in SL has the tools to create a basic alpha layer, just like everyone has the tools to create a basic shirt or a basic pair of pants. All you do is right click on any folder in your inventory, select “New Clothes”, mouse on down to “New Alpha Mask” and click it! Give it a name and voila, a new alpha layer is born! You can now wear it, edit it and add your own texture to it.

I have created a couple of tutorials on how to create a texture suitable to be used as an alpha layer in Photoshop and G.I.M.P.

I will add to these tutorials with a step by step in blog format in the future.

*important caveat with GIMP alpha creation – If your erase brush is drawing with colour instead of making the pixels transparent – select “Layer – Transparency — Add Alpha Channel and it should work properly.*

Asymmetry

Now onto that important exception that I mentioned earlier. Before mesh bodies were even a thing we could imagine, we had the SL avatar. The SL avatar has a UV template that is… less than ideal. It has a great face and head layout, good torso and legs, terrible arms, hands and feet. For some reason, known only to the original creators of the SL avatar, the arms and feet are 2 islands in one, laid upon each other so that whatever is on one is automatically baked into the other. This was something we at Slink wanted to address with the Slink Physique body system, pre Bakes on Mesh, so we wrote the missing asymmetry into our bodies and 3rd party applier scripts. With Slink Physique, you could create a tattoo applier that would send different textures to the left and right arms and/or feet, and they would display properly. You could also make your arms and feet invisible, left and right, independent of the other side.

With Bakes on Mesh, unfortunately we would have to take a step backwards by going back to that forced symmetry from the SL avatar, so we thought very long and hard about what to do to keep the asymmetry that our customers have enjoyed and came up with our Asymmetry Harness.

Join me in the next installment where I go into the last remaining bastion of HUD controlled alpha cuts for the Slink Physique and Redux body systems 🙂

♥ Siddean

 

Everything you need to know About Alpha Layers in Second Life – Part 1

This is a long post, grab yourself a cup of whatever you like to drink, and settle in for a read! 🙂

The storied history of hiding the avatar in Second Life

Many moons ago, back in the olden days, we used to trudge uphill in the snow baref… wait, no, wrong story!

Back in the day when we only had the default SL avatar body, we worked around the fact that we couldn’t hide the avatar body with a variety of methods. First, we would just build bigger than the avatar body, and adjusted sliders and shoe bases to accomodate. The first real method of hiding the actual body that I remember was the Invisiprim, which used a little script that rendered the prim invisible, and any part of the avatar body it was worn on, also invisible.

Sydney With Invisiprims

Slink Sydney Overknee Boots with invisiprims

Invisiprims

The invisiprim could be a series of primitive shapes, cubes, cylinders etc, or a custom shape made in a 3d program which used a little R,G,B (red, green, blue) texture we called “sculpty”, or Sculpted Texture, to form the shape in 3d space when applied to a prim inworld. You can still find many sculpties, and invisiprims, in older shoe designs for example. They appear like big invisible blobs around your object when you select the item in edit mode. Some time ago, invisiprims were rendered obsolete, and they no longer work.

The nature of invisiprims was to obscure anything behind them that had an alpha channel, which is a property of a texture that makes it transparent or semi transparent.

Alpha Layers

Linden Lab introduced the Alpha Layer around 2012, which freed creators and consumers up from invisiprims in a big, substantial way. Now we could just wear a layer, instead of making big blobby prims to hide our avatar feet for shoes, or even our entire avatars for new bodies, animal avatars, tech avatars etc!

Alpha layers entirely replaced invisiprims with a much simpler to create and use system that could hide parts or all of the default avatar body with ease and didn’t cause transparent textures behind the avatar to disappear. They were especially useful once we had the ability to wear more than one.

Alpha texture example

An example of an alpha texture in Second Life. The checkerboard part is transparent

Creators got busy making alpha layers for their mesh clothing. Alpha layers could be painted onto a template in a painter program like Photoshop, and made to fit exactly with the clothing, so that no part of the avatar clipped outside, and the body was visible only where it was meant to be. It was a great solution. Rarely would you find a mesh outfit without a complementary alpha layer.

A year or 2 after the implementation of alpha layers, Linden Lab gave us the ability to create and wear fully functional mesh items that animated along with our avatar skeletons, and responded along with our appearance sliders! Game changer right? Yes and no. With this update, came complete mesh replacements for the SL avatar body, since we could finally change shapes with the avatar appearance sliders, however, the ability to just wear an alpha layer and have your body disappear was gone, along with the ability to just wear a skin, tattoo, makeup, etc.

So we creators had to come up with a solution. That solution was HUD controlled, scripted alpha cuts.

Early Slink Alpha HUD

An early HUD for the Slink Physique Mesh body. It has undergone a number of changes since this version

HUD Controlled Alpha Cuts

HUD controlled alpha cuts gave us the ability to turn on and off parts of our new, pretty mesh bodies, but with some significant drawbacks:

  • Each alpha cut area must be designated in the 3d program by the creator of the body, and must by design, follow the geometry of the body.
  • To be at all functional, the body must be cut into many many zones or “faces”.
  • SL creators are hard limited by the platform to 8 “faces” per single mesh.
  • 8 is obviously not enough zones to properly cater to all the varieties of clothing available in SL, so we had to break the bodies up into many, many pieces, each with 8 individual zones.
  • At final count, the Slink bodies were in 27 pieces, with 8 faces each, multiplied by 4, since we also wanted to provide layer options for tattoos, underwear and clothing.
  • Each layer had to respond to the HUD the same way so when you turned off part of your arm, the corresponding part of your tattoo would also turn off, and not come on again until you enabled it again on your HUD
  • To make any sense to the person scripting the body, the faces must never change in order. Otherwise when you think you are turning off your arm, you may be turning off your leg! This can lead to hours of pointless bug hunting. Ask me how I know 🙂
  • 27 pieces, 8 faces each, multiplied by 4, needing to respond to the same HUD commands, quickly, without glitches if you turned on and off your layers separately is a mammoth, complicated and time consuming scripting task, not to mention managing the pieces to ensure no gaps, seams, texture mismatches or errors in face assignment in the 3d program.
  • We had to provide a solution to 3rd party creators so they could script their clothing to automatically turn off bits and pieces of your body when you wore it. More scripting!
  • The scripting of the alpha zones alone constituted more than half of the required scripting for the entire body.
  • Each mesh piece, face and script contributes to your overall avatar rendering cost, (another article) which is an important number for keeping SL manageable for everyone. Lower is better.

By the time all was said and done, the layers of mesh, body pieces, faces, textures and scripts added up to a substantial avatar rendering cost JUST for the body alone. And then you start adding clothing and hairstyles, shoes and jewellery and.. well you see where this is going.

Final Alpha Layout

The most recent Slink alpha HUD with so so many cuts!

AND even all of that still wasn’t enough. Every week I would receive requests for more alpha cuts. Cuts down the front and back of the legs. Cuts down the sides of the legs. More cuts for different shirt necklines. Cuts for open front jackets, low back dresses. Jeans with lacing up the sides, teeny weeny bikinis. I could seriously see a future where I did nothing else but manage alpha cuts for the rest of my SL life.

And then came …Bakes on Mesh…

 

 

Join me in the next article where I talk about Bakes on Mesh and how we now handle hiding our avatar bits!

♥ Siddean