alpha + alpha = zero?
|
|
Vakis Oranos
Deuteri Zoi
Join date: 13 Sep 2006
Posts: 75
|
02-06-2007 10:34
No the title doesn’t refer to some kind of eccentric mathematical expression however I hope that this is the right section to post my question (the other possible could be on the “building” or the “technical issues”).
I apologise if the question was answered already but after a thorough search of the forum I couldn’t find a similar thread, so here it goes. I will try to explain the problem with an example.
Let’s say that you have a transparent window (or any other prim with an alpha texture on it, e.g., a wall) and you put another prim which also has a texture with an alpha transparency (e.g. a product display). The display appears normally only under certain viewing angles and disappears completely when viewed from other viewing angles (especially when viewed from the sides). Is there any solution for this problem?
The only “dirty” trick I could find is to decrease the transparency of the window/wall in order the display to be visible from all the angles. However if I lease a shop or a booth at a mall, it’s not always possible for the owner to change the transparency of the walls/windows, so the only solution is to use displays without alpha textures.
Any help would be greatly appreciated.
|
|
Namssor Daguerre
Imitates life
Join date: 18 Feb 2004
Posts: 1,423
|
02-06-2007 12:00
You have discovered the infamous alpha sorting bug that has been part of SL since day one. The only way to avoid this is not to use two alpha textures next to one another, otherwise the renderer will get confused and start to flicker between front/back back/front.
|
|
Vakis Oranos
Deuteri Zoi
Join date: 13 Sep 2006
Posts: 75
|
02-06-2007 12:24
So *this* is the infamous alpha flickering that is supposed to be resolved on v2 (or v3) of SL. However (correct me if I'm wrong) this problem doesn't appear with, e.g., skins and undershirt tattoos when both have alpha transparency. Ah well.. I guess we learn from our mistakes... now I have to make and upload again 100+ textures and give LL 1000+ L$ 
|
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
02-06-2007 13:02
From: Vakis Oranos So *this* is the infamous alpha flickering that is supposed to be resolved on v2 (or v3) of SL. I'm not sure where you heard it's supposed to be resolved. To do so would break a ton of existing content. The alpha sorting glitch is common to all OpenGL apps, and its implications go well beyond just Second Life. From what I understand, the "fix" for it has been well known for many years, a very simple bit of coding, but deciding whether or not to implement the change is a huge issue. Lots of objects are built specifically to take advantage of the glitch. "Fix" it, and you can say goodbye to the established methods for creating fire, trees, bushes, and a lot of other things. Don't fix it, and you just need to careful in your work-flow to work around it. So you know, the glitch is present in all video games, and even in professional 3D modeling programs costing thousands of dollars. Very powerful programs like Maya do allow you to turn it on and off at will, but that's far from the norm. Most programs include the glitch. It's pretty much become an expexted standard at this point. If you ask professional game artists how they deal with alpha sorting, by the way, the most common answer you'll get is "we avoid it at all costs". In other words, they design their geometry and texturing scheme so that transparent objects never overlap. When they do overlap, it's done on purpose, and for the same reasons that it's done on purpose in SL. Again, objects like trees and plants traditionally depend on it in order to keep the poly count to a minimum. Take a look at the all the vegetation in World of Warcraft, for example. Up close, it's pretty easy to see that each plant is just a handfull of intersecting planes, each with an alpha texture on it. Second Life trees are made the same way. Without the glitch, you'd have to model every single branch, and that's a ton of really unimportant polygons (or prims) to have to include. The conventional wisdom since the disnosaur days of graphics is that the glitch is the lesser of the two evils. From: Vakis Oranos However (correct me if I'm wrong) this problem doesn't appear with, e.g., skins and undershirt tattoos when both have alpha transparency. That's because clothing/skin layers don't work the way prims work. You're not looking at separate objects with the clothing and skin. All those textures go onto one single object, the avatar mesh, and then they're baked into one set of textures.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
|
Wilhelm Neumann
Runs with Crayons
Join date: 20 Apr 2006
Posts: 2,204
|
02-06-2007 15:20
its a bug and its annoying and i hate it and try to ignore it as much as possible 
|
|
Vakis Oranos
Deuteri Zoi
Join date: 13 Sep 2006
Posts: 75
|
02-07-2007 02:02
Thank you for the very useful information Chosen. I read about the "fix" on the official blog but I can't recall in which thread. Perhaps it was just a reply of a resident and not on the official to-do list of LL. I’m not a coding expert but I suppose that in a few years perhaps it would be possible for SL and other 3D games, to turn the alpha flickering on and off on individual objects and not to the whole game, so objects like trees and fires will remain intact. As for breaking tons of existing content, the alpha flickering would be a minor annoyance compared to a future update of the avatar UV templates which is more possible to happen sooner or later based on the posts I’m reading here 
|
|
Erin Talamasca
Registered User
Join date: 18 Sep 2005
Posts: 617
|
02-07-2007 03:14
From: someone Without the glitch, you'd have to model every single branch I'm not trying to be awkward, honest! But isn't it the glitchy part of the bug the flicker, as opposed to how we can make trees look ok from most angles and see through parts of them? As a kid I used to make paper cut-out trees using the same method  I'd always thought of it as a nifty way to make low poly scenery, not a problem with alpha sorting. Have I misunderstood something?
|
|
Vakis Oranos
Deuteri Zoi
Join date: 13 Sep 2006
Posts: 75
|
02-07-2007 04:19
Hmmm… You have a pretty good point here. Since the transparent prims can be perfectly visible *without* the flickering when we face them directly from angle 0, if you put many transparent prims one after the other (even with some distance between them) then the transparent prims that they are behind the first prim, are still perfectly visible *without* again the flickering/disappearing glitch. So I suppose that 3-4 intersecting transparent prims used to make a tree or a fire could still have the same visual effect even without the alpha flickering glitch. Perhaps Chosen can enlighten us on that. 
|
|
Jennifer McLuhan
Smiles and Hugs are Free
Join date: 22 Aug 2005
Posts: 441
|
02-07-2007 04:57
I have noticed something for a while that I have wondered about, Is this part of what we are speaking about? In several places, I can see objects which are placed on the wall or near the wall, from the other side of the wall. For instance, I have a mirror hanging on the inside of a wall. Sometime, outside in the courtyard, I can see the mirror on the outside. The same thing applies for some gas lanterns on the courtyard side of the wall, I sometimes see parts of them on the inside. I have flowers on a table in one room, they may show through the wall in the next room, but not the table? It is only at certain angles that I see this. I have confirmed the location of the offending objects. They do not stick through the wall. The mirror, for instance, is about 3-6 inches from the wall. I have never asked anyone else if they see what I see. Too embarrassed, I suppose. Jen
|
|
Vakis Oranos
Deuteri Zoi
Join date: 13 Sep 2006
Posts: 75
|
02-07-2007 05:21
Yes, this is what the alpha-flickering is all about Jennifer. Probably your wall texture has windows painted on it so the texture designer had to add an alpha transparency for the windows. The result is that also the wall functions as a transparent prim with objects which also have textures with alpha channels. There is no need the objects to stick on the wall, any object up to a certain distance from the wall will be visible under certain angles resulting to that “embarrassing” effect, even more embarrassing when you have a wall that is supposed to be opaque 
|
|
Jennifer McLuhan
Smiles and Hugs are Free
Join date: 22 Aug 2005
Posts: 441
|
02-07-2007 13:10
Thanks Vakis. I am glad it wasn't me. I built the house and designed the textures. LOL Jen
|
|
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
|
02-07-2007 17:34
Bit of useful info on the alpha sorting - the texture which will be displayed in front is whichever object is closest to the camera (using the prim's position as you'd see in the editor, not the apparent one) and can often be taken into account when building.
Chosen, hasn't this bug been fixed in most things since per-pixel z-buffers were introduced?
|
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
02-07-2007 19:05
From: AJ DaSilva Chosen, hasn't this bug been fixed in most things since per-pixel z-buffers were introduced? I don't know the answer to that. Perhaps the "well known fix" that I was referring to is the z-buffer thing. I don't know. Maybe someone more knowledgeable on the mechanics of graphics can answer. I know someone who teaches VR graphics in RL, and has no shortage of experience in SL. I'll see if I can get him to respond here. In the mean time, what I do know is the glitch is present in games, it can be turned on and off in Maya, and it's present in other 3D modeling programs I've used. My understanding has always been it's one of those things everyone just lives with.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
|
Xenius Revere
Registered User
Join date: 13 Jun 2005
Posts: 15
|
Z buffer
02-07-2007 19:21
Hi all, Just a quick reply to this based on what I know of real-time engines vs renderers. The z-buffers mentioned by AJ DaSilva do exist in renderers for 3d art apps. Basically what they do is compare the distance of each drawn pixel on the screen to those of objects waiting to be drawn, and when appropriate draw over or occlude the proper part of objects being drawn. There problem with this is that there is no computationally cheap way to ensure the proper drawing order of transparent/partially transparent objects. There are may tricks that are performed in next-gen engines to avoid this problem, some of them using shaders, others relegating all alpha-ed object to particular step in the drawing process. There is however no current easy way of dealing with alphaed objects that collide/intersect with each other on a per pixel basis for a real-time engine. The computation involved is simply to intense. The best way to deal with such things in SL are as follows: 1. Keep prims with alpha channels away from each other Failing that: 2. Keep prims with alpha channels from intersecting unless you want odd results (ie. the way trees look) 3. Keep their overall perimeters (a radius equal to the longest side of the prim) from intersecting. As long as there's no intersections of the above type, there should be no alpha sorting issues. I hope this was helpful  -Xen
|
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
02-07-2007 19:28
Thanks, Xenius. That makes a lot of sense.
Oh, and in case anyone happens to be wondering, yes, Xenius is the guy I mentioned in my last post. He is smart. He will make us strong.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
|
Skye McArdle
Resident Dragon
Join date: 26 May 2006
Posts: 132
|
02-08-2007 06:00
From: Chosen Few Thanks, Xenius. That makes a lot of sense.
Oh, and in case anyone happens to be wondering, yes, Xenius is the guy I mentioned in my last post. He is smart. He will make us strong. Wish we had a rep system.. as it is.. +1 virtual rep for the Pakleds reference! We look for things... things that make us go. xD and thank you Xenius, for the explanation. 
|