Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Transparency problems with building textures

Ruth Irata
Registered User
Join date: 24 Jun 2008
Posts: 1
11-15-2008 03:58
Hi can anyone help me please. I normally work on clothes, using PSP X2, and sometimes CS3.
My wife has recently asked me to help her with textures for her buildings. So, ive been uploading textures for her as TGAs and/or PNGs. The problem is that although the transparent parts come through ok - the windows and doors, untfortunately the "solid" parts, the walls come through as about 75% transparent too.
Now i understand that this is a problem with the alpha channel causing problems, so have stopped using TGAs for wall textures. I also understand that PNGs can include "accidental" alpha channels if even only one pixel is partially trans and not 100% trans.

Has anyone any advice please???

Id be so grateful

thanks
rosie Gastel
Registered User
Join date: 1 Dec 2006
Posts: 80
11-15-2008 04:40
pngs in CS3 WILL save with an alpha channel, unless you use "save for web device" or something like that, instead of the usual "save as"

TGA's is a bit easier to set alpha's in a way, as you just flip to the channel view and look at the alpha channel anything not pure white, is gonna be a bit see through. I find it best to start with that with either solid black or white totally and remove the bits I want to either show or alpha, depending which I'm doing at the time.

so say a window in a wall, would start with pure white on the alpha, then use selection in the regular channel to get the window shape from the picture, and just shade that in a very dark grey to black for the window

chosen fews sticky on transparencies in the texturing forum explains how to use the alpha channel a lot better then this
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
11-15-2008 05:50
It's not the file format that's the issue. It's the bit depth. SL doesn't even preserve the original file format, anyway. It uploads everything as JPEG2000.

What you want to make sure of is that no two surfaces with 32-bit textures overlap in 3D space. Make sure each and every surface that does not absolutely need transparency in it has a 24-bit texture on it. It's common for those new to texturing to assume "more bits" must somehow be better than "less bits", so they save everything as 32-bit. Don't do that. Use appropriate bit depths for your desired purpose, always.

In Photoshop, if you're saving as TGA, you'll get a popup dialog asking you to assign a bit depth at the time of save. Choose 24-bit if you don't need transparency. Chose 32-bit only if you absolute, positively, must have transparency in the texture.

PSP makes the process a little more automatic. If you've created an alpha channel, the TGA will automatically be outputted as 32-bit, and if you haven't, it will automatically be 24-bit. Problems arise when you've created an alpha channel without realizing it, most commonly by saving a mask or saving a selection. To ensure your images remain 24-bit, delete all alpha channels before you save. (Image -> Delete Alpha Channel -> Delete All Alpha Channels)

If you're saving as PNG, accidental 32-bit depth is a very common problem. If any pixel in the image is less than 100% opaque, the image will end up as 32-bit. To avoid this in Photoshop, always use Save For Web, not just Save, to output your PNG's, and uncheck the Transparency box if you want 24-bit. For PSP, I'm not sure the exact method. It's in there somewhere, though. If I get a little time to look for it, I'll edit this post later.




Just so you know, the way this all works is each channel in the image contains 8 bits of data (per pixel). Three color channels (red, green, blue) times 8 bits in each gives you a total of 24. To get 32 bits, it's the three color channels plus one additional channel, for a total of four. Four times eight is 32. We call this fourth channel "alpha", no matter what it's for. (In SL, alpha channels are used only for transparency, but in other programs, they're used for all kinds of things.)
Almia Thaler
IMA Shyguy!! 0o0
Join date: 3 Jun 2008
Posts: 173
11-16-2008 01:33
what chosen few has said is positive except for one thing

PSP does not make it automatic on the exporting of .png

if you look closely when saving you'll see a button that says customize or somethign like that.

click that.
it will bring up a menu of specific controls.

if you want to save it as a png with no alpha go to the transparencies tab and select no alpha/transparency

then click ok.
this will insure that your images are saved at 24bit not 32bit and the alpha channel is gone.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
11-16-2008 10:35
Thanks, Almia. I knew it had to be in there somewhere. :)
Dr Debruyere
Anna
Join date: 12 Jul 2008
Posts: 43
Chosen few said files are converted to JPEG2000
11-19-2008 11:26
Oh I have a question! When I save my files they are various sizes. 256x256, 512x512, etc. Does it matter really in terms of final resolution if an image is 1024x1024? Its a lot larger. Also various file formats take up more or less space. If SL converts them all to JPEG anyway, shouldn't I just use that? I use PS, mainly for dress design. I really want to know what file size and format I should be using for clothing parts, without wasting server space, hard drive space, and also, that are fast loading. TY.

Anna
Almia Thaler
IMA Shyguy!! 0o0
Join date: 3 Jun 2008
Posts: 173
11-19-2008 13:19
the absolute bare minimum on any texture is 64x64

the true maximum on textures for prims should be no larger then 512x512

now if you were making art like a painting a print size image of like 1280x1280 or smaller is ok

but 512x512 has enough pixels in it for it not to be to badly blurred by the conversion process done by sl.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
11-19-2008 14:01
From: Almia Thaler
the absolute bare minimum on any texture is 64x64

Not sure where you're getting that. You can go as small as 8x8 for SL.

From: Almia Thaler
the true maximum on textures for prims should be no larger then 512x512

There are plenty of times when 512x1024 or 1024x1024 is justifiable. The rule of thumb I usually promote is this. About 80% of your textures should be 256x256 or smaller, about 15% should be 512x512, and about 5% should be 1024x1024. Follow that, and you'll usually have a very good balance between detail and performance.

From: Almia Thaler
now if you were making art like a painting a print size image of like 1280x1280 or smaller is ok

Normal "good" quality print is 300 dpi. 1280x1280 makes for roughly a 4.25x4.25" print, or about 1/6 of a letter-size piece of paper. That's hardly suitable for printing a painting, unless it's for a pocket-size book or something.

If you're looking to do a poster size print, then you'd want something like 7200x10,800 (24x36" at 300 dpi).

None of that is relevant for SL, though, obviously, since SL requires powers of two, and just a small set of them at that.

From: Almia Thaler
but 512x512 has enough pixels in it for it not to be to badly blurred by the conversion process done by sl.

So do all the other allowed sizes. For 128x128 and smaller, there's a lossless compression option if you really need it (which usually you don't, except for sculpt maps). For 256x256 and larger, the normal slightly lossy compression scheme works just fine.
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
11-20-2008 08:58
From: Dr Debruyere
Does it matter really in terms of final resolution if an image is 1024x1024?

Anna


Yes, it matters a lot. Even though they are all converted to JP2000, a large texture uses more space than a small one. Also, the textures are uncompressed in your graphics card, so a 1024x1024 == four 51x512 == 16 256x256 == 32 128 x 128 and so on.

Use the smallest texture that gives you an acceptable result.
_____________________
So many monkeys, so little Shakespeare.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
11-20-2008 11:17
And, since you said you are creating textures for clothing, work on them in PS as 1024 x 1024 images, but always upload them no larger than 512x512 pixels. There's nothing to be gained by uploading a dress texture larger than that.
Monique Binstok
Registered User
Join date: 5 May 2008
Posts: 87
11-21-2008 08:46
Is the overlapping transparency issue the reason why when viewing my character in a shower through glass it sometimes losses it’s hair? Is there any way to avoid this or do I just have to live with it or remove the glass?
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
11-21-2008 10:18
Yes, Monique, that's most likely the reason. To avoid the problem, either put 24-bit textures on your hair (which might not be desirable, since you'd lose any fringe effects you might have in it), or lose the glass. Short of rewriting certain parts of the graphics engine, and subsequently bringing frame rates to a crawl, the only way to deal with transparency sorting issues is to work around them.
HD1080I Aeon
Registered User
Join date: 15 Nov 2007
Posts: 1
oh crap
12-04-2008 15:26
From: Chosen Few
Yes, Monique, that's most likely the reason. To avoid the problem, either put 24-bit textures on your hair (which might not be desirable, since you'd lose any fringe effects you might have in it), or lose the glass. Short of rewriting certain parts of the graphics engine, and subsequently bringing frame rates to a crawl, the only way to deal with transparency sorting issues is to work around them.


Untill i read this post i thought it was just me. This one issue of transparency needs ( like lettering a sign over a semi clear cloth where the alpha was in the png ) has cost me dozens of hours juggling distances and such. All wasted time since its always going to surface sort fail if any alphas overlap in a view angle. This means that Machinima with flycam ( which i have heavily invested in here - bought and island even ) was essentially never going to work. I would have paid a couple grand for someone to tell me this first and just done it in MAYA. Shoot me.
Damanios Thetan
looking in
Join date: 6 Mar 2004
Posts: 992
12-04-2008 17:46
From: Dr Debruyere
Oh I have a question! When I save my files they are various sizes. 256x256, 512x512, etc. Does it matter really in terms of final resolution if an image is 1024x1024? Its a lot larger. Also various file formats take up more or less space. If SL converts them all to JPEG anyway, shouldn't I just use that? I use PS, mainly for dress design. I really want to know what file size and format I should be using for clothing parts, without wasting server space, hard drive space, and also, that are fast loading. TY.

Anna


JPEG is not JPEG2000. The latter is a newer format, with among other things less artifacts on scaling.
But it doesn't matter much in what format SL stores your data. Because:

1. You want to store your originals in the format that preserves the most information, because when you want to rework something, or use (part) of the texture in a new texture/design, you don't want to get artifacts. (The 'xerox' problem).

Plus, as I said, JPEG <> JPEG2000, so when you upload a JPEG, you get a 'double' compression, first the JPEG compression of the original, then the JPEG2000 compression on upload, resulting in more artifacts and uglier textures in world.

2. The resolution does make a difference, although not so much on server storage or bandwidth, but on display.
All textures are again uncompressed when they are used to display stuff by your graphics card. So that 512x512 texture is blown up to take 768KB of video memory, while a 256x256 only takes 192KB. (And your gfx card often stores multiple versions too, for different distances.)

With dozens or up to hundreds of textures in a scene, you can imagine the amounts of memory that takes if they're all hi-res. And to use a 512x512 texture and have 3/4MB of video memory eaten to display for instance a small doorknob (which usually only shows as a few pixels on your screen), is simply not very wise ;)
_____________________
Katnipsox Magic
Registered User
Join date: 8 Oct 2008
Posts: 116
12-05-2008 22:02
I have this same problem with clothing. Everything looks great till I upload it to SL then the color is different and it is so transparent you can see the av's nipples which is ok if its for lingerie but I have this problem with everything but black (usually) and lace type textures. Ive tried adding more layers but it doesnt seem to matter, it still comes out transparent. I usually save the clothing as a TGA file.
So if I get rid of the Alpha file will the clothing be less transparent?
_____________________
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
12-05-2008 22:40
If you remove the alpha channel information and save your clothing as a 24-bit TGA file, you will have no transparency anywhere ..... including anywhere that you wanted the define the shape of a neckline, sleeves, cutouts, etc. You need transparency for those things. If your clothes are all ending up partially transparent, it's because you have made the alpha channel image incorrectly. Unless you plan to have partially transparent areas, there should be no gray anywhere in the alpha channel -- only pure white or dead black. Read the sticky on transparency in this forum VERY carefully and work through Robin Wood's very nice tutorial at http://www.robinwood.com/Catalog/Technical/SL-Tuts/SLTutSet.html.