Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Reducing Transparency Problems in 32-Bit Targa Textures

Ephraim Dalglish
Registered User
Join date: 11 Oct 2008
Posts: 11
10-10-2009 20:14
I have posted on this issue in an old thread in Technical Issues, but I suspect that this may be a better place to ask. (I'd have posted here straight away had I realized the other thread was in Technical Issues.)

I have had what I gather is a not uncommon problem in my builds, with walls textured with PNG files containing transparency disappearing from certain angles. I have read the sticky on transparencies and alpha layers (which was excellent, by the way: thank you Chosen!), and two slightly earlier threads on this same subject; I have, I think, a pretty good handle on alpha channels, and on 24-bit vs. 32 bit TGA files. I have been using PNG files myself, created in PS Elements; I will clearly need to revert to TGA.

I understand that the viewer has problems viewing 32-bit textures that are in close proximity. However, my walls almost invariably DO include transparencies in them (usually windows), so, unless I change the way that I build these, prims with 32-bit textures are going to continue to adjoin each other.

Given that my walls tend to have transparencies in them, is there any way of saving or reordering the textures that will not create this problem? Or will I need to stop using transparencies in these walls?
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
10-10-2009 21:16
The only way to avoid the problem is to build around it. I'd suggest you make two versions of each texture, one at 24-bit (no transparency) and one at 32-bit (to include transparency). Then build your wall out of multiple prims. The 32-bit version will go on any prims that are in the area(s) of your window(s), and the 24-bit version goes everywhere else.

The window areas will still be vulnerable to the sorting glitch, but at least the rest of it won't. That should be a big improvement. Of course, your prim count will go up, so weight the pros and cons as you see fit.


Also, I think you get this already, but just to be clear, it makes no difference if the source image was PNG or TGA. If it's a 32-bit image, alpha sorting will always be a potential issue. If it's 24-bit, it won't. The file format doesn't make any difference to that.
_____________________
.

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.
Ephraim Dalglish
Registered User
Join date: 11 Oct 2008
Posts: 11
10-10-2009 21:43
From: Chosen Few
The only way to avoid the problem is to build around it. I'd suggest you make two versions of each texture, one at 24-bit (no transparency) and one at 32-bit (to include transparency). Then build your wall out of multiple prims. The 32-bit version will go on any prims that are in the area(s) of your window(s), and the 24-bit version goes everywhere else.

The window areas will still be vulnerable to the sorting glitch, but at least the rest of it won't. That should be a big improvement. Of course, your prim count will go up, so weight the pros and cons as you see fit.


Also, I think you get this already, but just to be clear, it makes no difference if the source image was PNG or TGA. If it's a 32-bit image, alpha sorting will always be a potential issue. If it's 24-bit, it won't. The file format doesn't make any difference to that.

Right, this does indeed confirm what I had thought (and feared). I mention going to TGA because I've had this problem with a few textures that did not (supposedly) contain any transparency: in TGA, it is easier to see that there is an alpha channel present (when there in fact shouldn't be).

The reason I had used this particular system of building/texturing was, as you imply, to save prims: I would build a wall with windows rendered transparent, and then insert hollowed square prims as sills within the windows to provide the perception of depth that would otherwise be missing if you looked through the window. A wall with, say, two windows would require possibly 7 to 9 prims rendered conventionally, but only 3 built the way I have been doing it. In some ways a rather neat system, but sadly, I will have to rethink.

Thank you for your help: I am very grateful.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
10-10-2009 21:50
You can also sometimes save the day by inserting a prim with a 24-bit texture inside the offending wall, making a sandwich out of it. That also raises your prim count, unfortunately, but you can be selective about it, putting a thin prim in the wall if it's right in front of a tree, for example, and leaving the wall alone otherwise. It's worth a shot, anyway.
_____________________
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
Siddean Munro
Artist!
Join date: 21 Apr 2007
Posts: 113
10-11-2009 03:22
If you are using png files for textures which don't have any actual transparency, you need to save them using the (in photoshop) save for web option, which gives you the chance to turn transparency off. Otherwise, save it as a 24bit targa and you will not have the glitching problem. If you just hit ctrl shift s and save as png, it will save it as if there is transparency in the file and no matter if it is a solid texture, it will still glitch against other transparent textures.

My personal filetype rule is everything as 24bit targa unless it is a transparency and then depending on how it's made, .png or 32 bit targa. :)

But as others have said, if you don't want your walls to glitch with each other, or pieces of furniture or trees, you need to build them with textures that don't have transparency. It means more prims, but you could also look around for some sculpts that might suit your purposes, like window frames and such.
_____________________
My Second Life Blog. New releases, fashion news and musings and more- http://slink.mmoportraits.com/
Ephraim Dalglish
Registered User
Join date: 11 Oct 2008
Posts: 11
10-11-2009 16:14
From: Siddean Munro
If you are using png files for textures which don't have any actual transparency, you need to save them using the (in photoshop) save for web option, which gives you the chance to turn transparency off. Otherwise, save it as a 24bit targa and you will not have the glitching problem. If you just hit ctrl shift s and save as png, it will save it as if there is transparency in the file and no matter if it is a solid texture, it will still glitch against other transparent textures.

Thanks Siddean. I have occasionally used the "Save for Web" option, but had forgotten that it gave the choice of transparencies or not. This is a good way to proceed, I think.

Rolig, thanks also. I have a few walls for which that might prove an easy solution.