• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: VWR-505
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Finish
Priority: Normal Normal
Assignee: Unassigned
Reporter: beatfox xevious
Votes: 6
Watchers: 7
Operations

If you were logged in you would be able to see more operations.
1. Second Life Viewer - VWR

Alpha-sorting of prims reversed, causing 'solid, non-alpha' prims to disappear.

Created: 23/Apr/07 01:21 AM   Updated: 07/Jun/09 11:40 PM
Return to search
Component/s: Avatar/Character, Graphics
Affects Version/s: 1.14.0.x, 1.15.0.x, 1.18.3 Release Candidate, 1.18.0, 1.18.1.2, 1.18.2.0
Fix Version/s: None

File Attachments: None
Image Attachments:

1. screenshot-1.jpg
(335 kB)

2. screenshot-2.jpg
(280 kB)
Environment: Windows XP Home, NVIDIA GeForce 7600 GT
Issue Links:
Relates
 

Linden Lab Issue ID: SL-56272


 Description  « Hide
Steps to reproduce the bug:
1) Under Edit > Preferences > Graphics Detail, set the Object Mesh Detail slider to the middle.
2) Rez a sphere. Set its size to .290 for all 3 axes. Color it green, and set its Transparency to 2.
3) Rez another sphere. Set its size to .284 for all 3 axes. Color it red, and set its Transparency to 2.
4) Set both spheres to the same location. Link them together, making the green sphere the root.
5) Attach the object to your Nose. Edit it so that it is above your head and you can see it clearly.
6) Move your camera around and view it from different distances & angles. Repeat with your avatar facing various directions.

Observed results: In certain cases, the inner (red) sphere is rendered on top of the outer (green) sphere.

Expected results: The outer sphere should be rendered on top in all cases.

Note: I (Beatfox Xevious) have an object called "bear head" where this bug seems to happen much more frequently, though I'm not sure why (relevant prims have same settings as test object described here)... maybe it has to do with the total number of prims? Anyway, please let me know if you want a copy to check out.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
ari blackthorne added a comment - 06/Jul/07 07:50 AM
This is not just for spheres or attachments - there is something wrong with sorting layers where alpha channels are concerned and this have been true since about 5 updates ago.

Reproduce:

Create a large box (a 'wall') - add texture that includes an alpha channel - such as an exterior wall with a window.

Plase another prim in front of it, such as a tall cylinder (call it a pillar). Texture as desired - full opacity, no alpha...

Viewing it straight on will appear as it is supposed to. Changing angle (only a few degrees off to either side) and an entire chunck of the cylinder will disappear - as the the entire 'wall' prim was placed infront of it - even though it is not.

This freaky situation occures with attachments, too (such as prim dress skirts and things)

Highly irritating, but worse is that my nuilds appear 'sloppy' and I am questioned all the time. Tired of blaming it on SL - which, unfortunately, is the honest answer.


ari blackthorne added a comment - 06/Jul/07 07:52 AM
I changed the title of this issue to better reflect the real problem. it affects all prims that use a texture with an alpha channel for transparency - 'rezzed' prims and attachments alike (sich as prim clothing)

IBME Swindlehurst added a comment - 13/Jul/07 03:45 PM
Viewed Front on.

IBME Swindlehurst added a comment - 13/Jul/07 03:48 PM
Clock viewed from an angle.

Daedalus Young added a comment - 26/Sep/07 04:21 PM
Transparency and real-time 3D environments just don't go well together if you have 2 objects that are both in front of eachother. Avoid prims with transparency intersecting.
Placing two prims on the exact same location (or at larger distances, almost exact) as described in the repro will also trigger z-fighting. Avoid placing two or more faces on the exact same location.

I couldn't repro ari's "wall with pillar" either without using a texture with alpha channel (doesn't have to actually use the alpha) on both the wall and the pillar and placing them partially inside eachother (thus having them both in front of and behind eachother at the same time, which, as I said, should really be avoided).


Dark Otsuzum added a comment - 09/Jan/08 03:17 PM
I find incorrect sorting of alpha textures particularly annoying... I use apha textures to create complex objects (e.g. aircraft) to save on prims...after all my hard work, the effect is spoilt by alpha textures appearing through opaque objects that should obscure them.

My graphics (NVIDIA GeForce FX5600XT) drivers are up-todate.I do wonder if the problem is peculiar to certain graphics cards, or experienced by allSL residents?

Can LL comment?


Daedalus Young added a comment - 09/Jan/08 05:49 PM
You don't need a LL comment on this, this is not an error specific to SL.
See http://www.opengl.org/wiki/index.php/Alpha_Blending

"The upshot of this is simply that you can't simply render translucent objects in any order without special consideration. If you have enough translucent surfaces moving around in a sufficiently complex manner, you will find it very hard to avoid errors with acceptable realtime algorithms."

Basically: to avoid it, you will have to use more prims. Maybe in 20 years when we have ultra-mega-giga-supercomputers this issue will be solved, don't expect it soon.


Necrotic Lunasea added a comment - 10/Mar/08 03:58 AM
Whether this is worth anything to anyone, I found the solution that solves this issue completely.

ISSUE DUPLICATION SETUP:
1) Rez a cube and resize it to, say 1m wide, 1m tall, and .10m thick and place any texture either on the front face or across all faces.
2) Rez another box on the front face of the main prim and place a texture on that prim, but this time with some form of transparancy in the image.
3) Flatten that second box so that it's about .10m thick also.
2) Rez another box on the front face of the main prim and place a texture on that prim, but this time with no transparancy in the image.
3) Flatten that second box so that it's about .10m thick also.

OBSERVED ISSUE:
When you move your camera around from side-to-side, you will see the disappearance noted in this reported issue, but ONLY of the prim that now has the transparancy as its texture while the other prim remains visible from all angles.

      • NICE, HUH? ***

Now for the coolest part!!!
ISSUE RESOLUTION SETUP:
With all the steps above having been performed or everything deleted and repeated exactly the same, this time, you will not texture the main prim using the viewer's texture selection tool, but rather this, instead;

1) Locate the same texture in your inventory that you would have chosen using the texture selection tool, but this time, right click on that texture and click on the option entitled, "Copy Asset UUID".
2) Now, go to the main prim's contents tab and create a new script and insert the following code in the state_entry() event so that your code looks like this;

default
{
state_entry()

{ key faceTexture = "PASTE_YOUR_COPIED_UUID_BETWEEN_THESE_QUOTES"; llSetPrimitiveParams([PRIM_TEXTURE, 4, faceTexture, <1.0, 1.0, 0.0>, <0.0,0.0,0.0>, 0.0]); }

}

3) Click the 'Save' button in the code editor window.

OBSERVED ISSUE:
NOW, the moment that the script finishes compiling and saving, you will see the main prim's face change to the texture you got the UUID from, except THIS TIME, when you move your camera around from side-to-side, the issue is gone and the alpha based image remains visible 100% of the time.

That's the (workaround) solution!
Hopefully a Linden will read this and be able to see that a fix can now be developed for this problem as this is a MAJOR pain in the a** for many builders.

Have fun, folks.


Charlton Waisman added a comment - 01/Apr/08 02:51 PM - edited
In addition to Necrotic Lunasea's really, really clever solution (where you have the texture in your inventory) other workarounds include rezzing a solid non-transparent object inside the prim with the transparent textures. This works better for walls with windows and other textures with straight or simple curved edges, but completely fixes the problem, at least for those parts of the alph texture 'backed' by the non-transparent prim. I do this in my builds when using alpha textures that have windows or alpha edges in/on them. It does not matter how thick the inner prim is, nor whether all sides of the inner prim are non-transparent - just as long as the texture on the face of the inner prim that is immediately behind the alpha textured face of the outer prim is non-transparent and non-alpha.

One side benefit of this approach was that it improved our builds, all be it at the cost of more prims, because it lead us to put windowsill's and door frames into walls, etc thus eliminating that horrible paper-thin look that alpha-windowed wall textures deliver.

Mind you, now I am going to start using Necrotic's solution. It should be very useful for plants.

By the way, who decided this issue was resolved? It most definately is not resolved. Neither work around is really aceptable and the problem still exists.


elleon bergamasco added a comment - 12/Apr/08 11:32 PM
Sorry... I may be being a bit dense, but I REALLY was hoping the fixes mentioned here work. If you follow the series of events by Necrotic, you end up with 3 prims instead of 1, and it looks like the prim with the transparency (say a window) is sandwiched in between 2 other prims, one of which is opaque, thus blocking the view from the window? I tried both of these fixes, and neither of them worked... including making an opaque prim inside the window but hollow where I wanted to see through the window... I still had alpha sorting issues...
Am I missing something? Through experimentation I did find that if you have an opaque texture on one side, and a texture with alpha on the other, this does not seem to happen. But then, that's not at all realistic...your building would have windows on the inside, but not the outside? Anyway, is this a clue? When the competing textures are on the same prim?

Necrotic Lunasea added a comment - 27/Apr/08 03:22 PM
Charlton. Thanks for the comments

Elleon,

That was merely a suggestion to use to try to proven the point of the fix. In actuality, one would only need to do this with 2 prims.
Recently though, I had discovered that the root of the problem was seated in the type of image that you were uploading as a texture. This actually determined whether the problem still existed or not.

It would appear that when you upload a PNG file (with alpha/transparancy in use) as a texture and then use that texture as the main texture that other prims would be sitting atop of, that the problem still remained, even using my workaround. But when you upload that same image from a non alhpa based file, like that of a JPEG...the problem is gone.

I hope this helped a tad also.