how did the lindens do it?
|
Jinne Ling
Registered User
Join date: 23 Jun 2007
Posts: 24
|
09-21-2008 19:24
I have a tree that has a shadow prim on the ground. I want to put some plants under the tree, but I"m having problems. If I leave the shadow prim quite dark, you can't see anything above it because of the darkness of the shadow. If I make the shadow prim more transparent, more is visible above it, but the plants above it become partially transparent and sometimes disappear altogether, depending upon one's vantage point. I've noticed that the Linden-created plants in the Library can hold their own above the shadow -- they do not become semi-transparent or disappear. My question is how did the Lindens do it? Or ... Are there any other ways to make an object hold it's full color in such a situation?
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
09-21-2008 19:53
From what you said, it sounds as if your vegetation has a 32-bit texture. You are seeing the alpha sorting problem when you superimpose your shadow prim, which is also 32-bit, against it. The reason you didn't notice the problem earlier is that your shadow prim was dark enough to hide it. The reason that Linden vegetation doesn't create the same problem is that it uses a 24-bit texture. That is, it has no bits that potentially contribute to transparency. Your easiest solution is to use the same strategy .... avoid vegetation with transparency in this particular location. To understand more about this particular problem, read the sticky on alpha channels and transparency at the top of this forum and then do a search in the forum's archives for "alpha sorting."
|
Jinne Ling
Registered User
Join date: 23 Jun 2007
Posts: 24
|
09-21-2008 20:53
Thanks for your response, Rolig. Is there any way to have a 24 bit texture WITH transparency? I've tried to create a semi-transparent texture in my Paint Shop Pro as a 24 bit PNG file, but when i put that texture on a prim in SL (and under the same tree), it is semi-transparent too. Perhaps I've misunderstood what you are saying. In order to have plants under the tree, as I want, the prims of the plants will have to have transparent parts ... No?
I'm not talented enough to make a sculpted plant, if that would make a difference ...
Or am I missing the boat altogether on this?
|
Peggy Paperdoll
A Brat
Join date: 15 Apr 2006
Posts: 4,383
|
09-21-2008 21:10
I'm not exactly sure how this might work in your situation, but since your plant texture contains transparency it must be 32 bit. And if the Linden tree is also 32 bit the alpha sorting glitch will be there when viewed from angles where the textures are in line with the camera and each other. You might try putting some 24 bit texture between the plant and the tree so that, at least that angle the glitch will not happen. Something like a vase or maybe a bench that do not contain an alpha channel.
Just a thought.
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
09-21-2008 21:36
Peggy's right. A 32-bit texture has 8 bits each for the three color channels R-G-B, and another 8 that SL interprets as transparency -- another "color" dimension. If a texture only has 24 bits, then SL won't give it any transparency. The sorting problem arises when you have TWO textures with transparency and your video card can't figure out which one is in front of the other one. Peggy's suggestion of putting a third non-transparent texture between the two is a good one, if you can do it. That way, the video card can sort out their visual ordering in space.
You mention saving your image as 24-bit PNG. You should be aware that it is possible for a PNG file to accidentally include a few pixels that have 32-bit depth. If so, then the texture gets saved as 32-bit even though you may have meant it to be 24 bits. Watch the file parameters as you save it to be sure that isn't happening.
|
Jinne Ling
Registered User
Join date: 23 Jun 2007
Posts: 24
|
09-22-2008 04:57
ok. so now i'm back to my original question. how did the lindens do it? the trees, plants and grasses in the inventory library must be partial transparencies, yet they show up against the shadow prim with no transparency showing at all. how did they do this? hey, eric!!! btw, thank you peggy for the suggestion. if i can't find a way around this transparency thing, i might try some rocks ... actually, i might try some rocks anyway.  ) thanks
|
Peggy Paperdoll
A Brat
Join date: 15 Apr 2006
Posts: 4,383
|
09-22-2008 19:27
If you save a texture that is completely opaque at 32 bit OpenGL will interpete the texture to contain transparency.......your video card will see it as a transparency too. If the tree you are asking about is the same as many trees I've seen in SL that are Linden plants they do contain transparency.......around the edges of the prim so the branches and leaves don't simply look like a picture on a box. That means the trees were saved at 32 bits. Even though you cannot see any transparency in the tree it's still a texture that OpenGL and your graphics card interpete to be a transparent texture.
When I first started making textures I mistakenly uploaded textures at 32 bit (not knowing it would cause problems) regardless of whether I needed transparency or not. I experienced the alpha sorting glitch a lot with the textures I made. My brick siding would bounce front to back with my marble floor.........a kind nieghbor told me my mistake. I went back to my textures and resaved at 24 bit and never had the problem again.
|
Osprey Therian
I want capslocklock
Join date: 6 Jul 2004
Posts: 5,049
|
09-22-2008 20:14
Linden trees are some kind of mesh object that is stored locally (I think). I don't know why they perform so well despite their transparency. It's magic.
|
Azadine Umarov
Registered User
Join date: 7 Apr 2007
Posts: 31
|
09-22-2008 20:41
From: Osprey Therian Linden trees are some kind of mesh object that is stored locally (I think). I don't know why they perform so well despite their transparency. It's magic. This might be purely rumour, but I seem to recall hearing that the Linden trees were created very early in SL development, when some of the specs were different than they are today, allowing the building of such unique objects that, by all appearances, can no longer be built. At least that was the impression I had, given that they show up on inspection as single-prim objects. Perhaps someone older and more obsessive than I will recall more specific details?
|