Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

alpha Sorting glitch question about other buildings

Ciaran Laval
Mostly Harmless
Join date: 11 Mar 2007
Posts: 7,951
07-11-2009 12:59
Ok so there is a lot of info about the alpha sorting glitch and I'm trying to get my head around it all as disappearing walls are annoying.

How far apart do textures need to be to cause this glitch? Is it line of sight? I'm wondering because I was replacing textures to non alpha ones to try and work out what was going on and then had to change a texture on the building behind to stop it happening, is this a line of sight issue? I thought it was just for textures in close proximity or overlapping.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
07-11-2009 13:31
The alpha sorting glitch happens because SL is only calculating one point as the distance to a texture. I don't know what point that is, but let's say it's the center of the face. If you have an object at an angle, then it's possible another texture will be closer than the part of the face that it occludes, but further than the center of the entire face. When that happens SL renders the wrong texture.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Ciaran Laval
Mostly Harmless
Join date: 11 Mar 2007
Posts: 7,951
07-11-2009 13:38
In terms of distance it doesn't seem to be what a layman would consider distance, is that right?

What I'm asking is whether an object that appears to be further away (because it's on another parcel for a start) might be rendered as closer by the client for some reason and therefore creates this glitch whereas another time it may not do so?
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
07-11-2009 13:54
It's not simply a line of sight issue. The question is whether any parts of the two textures are angled in such a way that it's potentially hard for your graphics card to tell which one should occlude the other one. If two 32-bit textures are far enough apart that there's never any question that all points on one surface are farther away from you than any points on the other surface, there's no problem. When the two are close together, there's an ambiguity, so the textures flicker back and forth as your system tries unsuccessfully to resolve it.

I'm too lazy to work through the trig to determine what the "safe" distance should be, given the sizes of two objects. You can do an experiment, though, by texturing a pair of prims, placing then a known distance apart, and moving your camera around so that you see them from this orientation --> = to this one --> \\ and finally this one --> ||. See how far apart they have to be before there's no alpha sorting problem, then repeat the experiment with a larger pair of textured prims. The larger the prims are, the farther they ought to be separated before the problem goes away.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Ciaran Laval
Mostly Harmless
Join date: 11 Mar 2007
Posts: 7,951
07-11-2009 13:56
Rolig thank you very much, size matters!! I didn't realise that, that explains a lot.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
07-11-2009 13:57
The behavior isn't always entirely predictable, but usually it is. There are two main factors in play. One is how close is the center of each object to your camera. The other is how forward facing is each object, relative to your camera. Some funky math incorporating those factors will determine which object appears to be in front, and which one appears to be in back.

The best solution to the problem is not to try to predict it, but rather simply to work around it. If your neighbor's wall is interfering with yours, either build yours differently, put something opaque in between, or talk to your neighbor about working together to make sure you both have the best possible viewing experience. If any or all of that means redesigning your build, so be it. That's just life in SL.
_____________________
.

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.
Ciaran Laval
Mostly Harmless
Join date: 11 Mar 2007
Posts: 7,951
07-11-2009 14:02
Thanks Chosen, for my current project I think i'll just do away with the alpha textures, the windows are dirty and hard to see through anyway so to avoid the issue I'll just save them without the alpha channel and see how that goes.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
07-11-2009 18:40
From: Ciaran Laval
In terms of distance it doesn't seem to be what a layman would consider distance, is that right?

What I'm asking is whether an object that appears to be further away (because it's on another parcel for a start) might be rendered as closer by the client for some reason and therefore creates this glitch whereas another time it may not do so?
No.

The glitch is only due to the fact the SL renders each alpha face as if the whole face or object was at the same distance from you. It doesn't render it any differently based on what parcel or sim it's on.

With Windlight it got worse, it's like the earlier rendering engine based the distance on the contiguous face of the object, and since Windlight it's based on the position of the whole object itself.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-11-2009 20:50
distance actually seems to be calculated based off of the prim center from my testing, and the sorting you'd expect seems to occur only when the prims share the same center coordinates. and then only in 2 cases for sure.

case one:
prims intersect at their center only (like many of the plants in SL, but you want to make them super thin using the prim paper trick (minimize z axis, slice/dimple to .49/.51) for best effect.

case two:
prims do not intersect at all, one is inside the other (generally set one to be the size of the hollow of the other)... I make some rather nice 2 prim tables, stools, and filigree balls this way, by texturing the inside of the larger prim, and the outside of the smaller, with a few extra details for the top, and high outside edge of the outer prim. I suppose I should make a video of this, but haven't felt like keeping up with yet another free account to use for uploading.

case three plus???
the trick MAY work for different shapes, I've never actually tried on on mismatched shapes, sculpties, or offset intersects because I never came up up with a design that would need it... ymmv on those happy testing
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
07-11-2009 22:42
From: Void Singer
distance actually seems to be calculated based off of the prim center from my testing,
That was my guess, based on the way the problem got so much worse with Windlight. It used to be based on the face center. Which is one reason it doesn't work well for crossed-prim plants the way it used to.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore