Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

alpha overlap wierdness

Manstan Beaumont
Registered User
Join date: 30 May 2007
Posts: 247
08-12-2007 09:25
It this the norm? Where one alphaed texture overlaps the other it seems SL gets confused as to which one is on top. I ran into this same problem using tga in a game engine. Is there a solution to this? It just really looks bad, but just a slight shift in the camera angle fixes it.
Chip Midnight
ate my baby!
Join date: 1 May 2003
Posts: 10,231
08-12-2007 09:47
Unfortunately that seems to be a quirk of OpenGL and it's been that way since the very beginning of SL. It's nothing you're doing wrong and it's something that most likely will never get fixed.
_____________________

My other hobby:
www.live365.com/stations/chip_midnight
Manstan Beaumont
Registered User
Join date: 30 May 2007
Posts: 247
08-12-2007 09:53
The game I was working on was GP500 a 7 year old racing game. But we also had the option of designating a specific color as transparent. It was the only cure we found.
It's just real aggravating to be checking out a building you're working on and see the inside wall through the out side.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
08-12-2007 11:38
The only fix is to try another way to do it.. also, even if a texture is not alpha'd but saved it 32 bit targa format, it will "flip flop" depending on the angle viewed... if that is the case be sure to resave it in 24 bit (since there's no alpha), and that will cure the problem in that case.

One possible fix if your alpha'd texture is a more primitive shape (ie can be cut down into primitive shapes), u can create the shape using more than one prim, then apply the texture and adjust the texture on each prim and create the effect you want without using alpha. I did this with the clockface on my grandfather clock and it works fine, but you have to have a more primitive "shape" in your alpha texture, so it will not always be an option.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-12-2007 15:25
From: Johan Laurasia
even if a texture is not alpha'd but saved it 32 bit targa format

Just for accuracy's sake, there's no such thing as a 32-bit TGA that's "not alpha'ed". If it's a TGA that has 32 bits per pixel, it's got 4 channels, period. It cannot be otherwise.



Anyway, Manstan, as Chip mentioned, what you're seeing is a glitch in OpenGL; it's not just an SL thing. It's called the alpha sorting glitch, and it happens in every single OpenGL application in existence, from video games to high end professional 3D modeling applications. What happens is that when two surfaces with 32-bit textures overlap in close proximity, whichever object has its center point physically closest to the camera will be drawn "in front". So, as you move your camera around, objects appear to jump in front of eachother. If two objects share the same center point, then the one that will show as "in front" will be the one that most directly faces the camera. See the Transparency Guide at the top of the forum for more on this.

The only way to work around the glitch is to change your construction habits. Make sure to build in such a way that 32-bit textured surfaces do not closely overlap.

In certain situations, the glitch is actually a good thing, by the way. The way things like trees, bushes, fire, certain lighting effects, etc., are commonly constructed is to take advantage of the fact that the glitch will hide certain things on screen. This allows these kind of objects to be created using far less geometry (in SL's case, that means far less prims) than would otherwise be necessary. For example, with the gltich, you can build a convincing tree with just 3 intersecting planes, while without the glitch, you might need hundreds of individual shapes.

The glitch has been around for decades, and as Chip said, it's not likely ever to be fixed. So the onus is on each individual 3D artist to be aware of it and to plan for it accordingly for each project.
_____________________
.

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.