Jump to content

Recommended Posts

Hi Everyone. 

I have transparency problems in a subject that you will see in the pictures below. There is no problem in the first picture. But the object looks wrong when the camera angle changes. As in the second picture. Please Help.

Sample_01Sample_02

 

Share this post


Link to post
Share on other sites

That's alpha sorting (sometimes called the "alpha glitch"). It's a rather common problem in SL, but it's not an SL issue per se.  It's a factor in any environment that uses OpenGL. You have three choices:

1. Do not use 32-bit textures at all unless you really need transparency.  It's a waste of system resources and can create the sorting problem if you have two textures reasonably close to each other.

2. Use Alpha Masking instead of Alpha Blending unless you are trying to create partial transparency (translucency). Alpha masking is more efficient anyway and will not result in a sorting issue.

3. Avoid overlapping alpha blending 32-bit textures as much as possible and keep your fingers crossed.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

Rolig had the answer to this particular case of course: never upload textures with an alpha channel unless they really need transparency.

But since she mentioned the alpha glitch, there is a trick that sometimes work but not many people seem to know about.

The alpha glitches occurs because the viewer has problems deciding which of the two transparent surfaces is closest to the camera. If they are far away from each other, there won't be any problems, if they are close, you get alpha glitch. So keep the surfaces well apart and the problem is solved. But there is one catch that often causes problem but can also occasionally be taken advantage of: the viewer doesn't calculate the distance from the surface but rather from the center of the object it's part of. Your pictures show that very clearly. In the first picture, the center of the log pile is closer to the camera than the center of the vegetation so it looks right. In the second picture however, the center of the vegetation mesh (or prim?) is closest and it is shown in front of the log.

There are several ways to shift an object's center away from the visible parts. With prims we can use pathcut or slice, with sculpts we can move all the vertices towards one edge in a image editor and with meshes we can add invisible "balance triangles".

A good example is the classic semitransparent curtain behind a semitransparent window. that combination is always tricky since the two surfaces will always be very close to each other. Add an extra triangle with a separate face to the curtain mesh, postion that triangle so it ends up well inside the room and far away from the window and texture it with a full transparent texture and alpha masking. Job done!

Edited by ChinRey
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

This is an intriguing solution. I don't need to worry about alpha sorting much myself these days, so it hadn't occurred to me that adding an extra triangle to a mesh object might work.  I'll have to try that one.

As with so many things we do in SL (and RL, for that matter), our choice of strategies is rarely as simple as we would like.  There are tradeoffs in almost any situation. Adding that extra triangle might solve an alpha sorting problem at the cost of modifying the object's bounding box or L.I., for example, or affect the way that the object moves. You'd have to evaluate whether any of those potential downsides is worth worrying about on a case by case basis. If it turns out that the effects are insignificant, at least you kept them in mind.  Your best tools in design are imagination, awareness, and a large toolbox of strategies.

  • Thanks 1

Share this post


Link to post
Share on other sites

ChinRey's suggestion is a clever trick, but I can't stress enough that if your texture doesn't use an alpha channel, make sure it does not have one when you save it for uploading. Whether or not SL renders the alpha channel (as Rolid pointed out, you can disable it in the edit panel) it does add to the file size of the texture, which means it will eat up more VRAM.

Most content in SL eats up  so much more VRAM than it needs that it's fair to say that most performance issues in SL come down to VRAM bloat. Not uploading textures with useless alpha channels is one good way to reduce that in your own content.

 And if you do need the alpha channel, try to use masked whenever possible. Not only does it get rid of the alpha sorting glitch, but it's far easier to render than the default "blended" mode. A lot of sim creators have seen a very noticeable framerate boost in their sims simply by setting all of the alpha textures they use to masked and reserving "blended" for limited cases (ie: water and light effects).

Edited by Penny Patton
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...