Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Efficient text textures

Lepton Leandros
Registered User
Join date: 31 May 2005
Posts: 23
07-31-2005 13:27
I have a prim face, lets call it 512x256, and I want to put a texture on it, and several questions have come up.

It looks like only TGA, JPG, and BMP textures are allowed. In my case, my texture is mostly some text labels, only on the bottom quarter of the face, and the whole rest of the face can be a solid color. So since there is text involved, even though it is a fairly large font, JPG is probably out. But TGS and BMP seems like it would be huge. GIF or PNG would be great for this type of texture..

When you make a TGA of 512 by 256, at 16 bits/pixel, that's a 256K file, no matter what the texture is, even a solid color. I'm using Adobe Illustrator to export to TGA and I don't see a compression option.

1) Is this how SL stores the texture, 256K uncompressed? Ouch!

2) On a texture with mostly text on a plain background, what's the best format for uploading?

3) In my case I really only need the texture on the bottom 512 by 64, is there some way to apply this to the 512 by 256 face? I guess not.

4) In my case I could use a texture with transparency - put the text on a transparent background, and give the face a solid background color. But with transparency at 32 bits/pixel, this seems like an even worse option. What's a good way to handle this? If SL compresses textures internally, this might actually be a good option, since transparent and solid areas should compress very well.
Sophia Weary
Registered User
Join date: 27 May 2005
Posts: 32
07-31-2005 13:39
It doesn't matter how you upload it, SL will recompress it into JPG2000. So upload it in TGA uncompressed. It'll look best if you create it at a close resolution to what SL scales it to, that is, powers of two.

So try to use sizes like 512x512, or 256x512, etc.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
07-31-2005 18:45
Sophia already answered the main point quite well, but I thought I'd chime in with a little more detail for you:

From: Lepton Leandros
I have a prim face, lets call it 512x256, and I want to put a texture on it, and several questions have come up.

It looks like only TGA, JPG, and BMP textures are allowed. In my case, my texture is mostly some text labels, only on the bottom quarter of the face, and the whole rest of the face can be a solid color. So since there is text involved, even though it is a fairly large font, JPG is probably out. But TGS and BMP seems like it would be huge. GIF or PNG would be great for this type of texture..

As Sophia said, SL's internal format is jpeg2000, so the source file size is pretty much irrelevant. You should avoid jpeg altogether, not just because it can fuzz text, but because it's a low-quality format (which of course is why it blurs your text in the first place). Once you upload that low-quality compressed image to SL, it will be re-compressed into jpeg2000, and it will lose quality even further. TGA is always the way to go, 24-bit if you don't need transparency, 32-bit if you do.

From: Lepton Leandros
When you make a TGA of 512 by 256, at 16 bits/pixel, that's a 256K file, no matter what the texture is, even a solid color. I'm using Adobe Illustrator to export to TGA and I don't see a compression option.

The reason you don't see a compression option is because TGA is an uncompressed format. Were you to compress it, it would no longer be a TGA. Also, I know this really isn't the question, but just for clarity sake, don't use 16-bit. For SL you want to stick to 8 bits per channel, meaning 24 bits for RGB or 32 bits for RGBA.

From: Lepton Leandros
1) Is this how SL stores the texture, 256K uncompressed? Ouch!

As has already been said, SL compresses everything to jpeg2000. You're right that it would be a big "ouch" were files to remain uncompressed. Every 512x512 image would be 768K or 1MB, which would pretty much make operation over the internet in real time impossible, and would eat video cards for lunch. Thank the pixel gods for jpeg2000. It's such a great format.

From: Lepton Leandros
2) On a texture with mostly text on a plain background, what's the best format for uploading?

Again, stick with TGA. Technically you could get away with BMP, but it's a good habit to stick with TGA at all times. TGA is the most common format used in 3D graphics.

From: Lepton Leandros
3) In my case I really only need the texture on the bottom 512 by 64, is there some way to apply this to the 512 by 256 face? I guess not.

I'm not sure what you mean by "the 512 x 256 face." If you want to put a 512x64 pixel texture on just one face you certainly can do that, or you can just offset a larger 512x256 so that only a 512x64 section of it is visible. To do the latter, just set the repeats per face to 0.125 in whichever direction the 64 should be (I'm assuming vertical) and to 1.0 in the other direction.

From: Lepton Leandros
4) In my case I could use a texture with transparency - put the text on a transparent background, and give the face a solid background color. But with transparency at 32 bits/pixel, this seems like an even worse option. What's a good way to handle this? If SL compresses textures internally, this might actually be a good option, since transparent and solid areas should compress very well.

If you put the text on a transparent background, the only way to get a solid color behind it will be either to hollow the prim and make sure the inside is not transparent, or else to put another non-transparent prim behind it. It's not a good idea to use transparency unless you really need it. SL, like many graphics applications has issues with alpha sorting. Put two 32-bit textures near eachother, and they fight for screen dominance all day long. Stick with 24-bit unless you actually do need to be able to see through something.

You're right about the compression part, in that solid areas of color and/or transparency do compress smaller than areas of high contrast, but I wouldn't let that dictate your texture-making decisions. SL is pretty good at displaying textures quickly, as long as the canvas size is not huge. Don't sacrifice image complexity just to get a little bit better compression rate. Good artwork is always worth a little extra file size. Just keep it 512x512 or smaller, and you'll always be fine.
_____________________
.

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.
Blain Candour
Registered User
Join date: 17 Jun 2005
Posts: 83
08-01-2005 15:14
Not to be argumentative but you can RLE compress a tga just fine and it most certainly would still remain a tga with compression and no loss of quality. Photoshop even prompts if you want to do this when you save a TGA. For SL it is rather pointless.
Wheel Fizz
Registered User
Join date: 26 May 2005
Posts: 36
08-01-2005 15:47
Wow is the RLE compression really that pointless for SL.I have been getting a 513kb texture down to 14kb with it checked,and I can't see any difference.

So what happens when this 14kb version is uploaded and converted to jpeg2000,is there any way to see how big it becomes on upload to SL.Like one of the columns in the Debug Texture window,Im not sure what the different columns mean.

Edit// The 513kb to 14kb compression was with a three colour image with some simple squares , which the compression algorithm must have loved.Now I tried it with a complex water caustic texture there was no difference in file size between Compressed or un compressed :P go figure.Still worth a try if its a simple image :)
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
08-09-2005 01:11
Question: Where does the recompression take place?
If on the client (i.e. a JPEG2000 is uploaded) then file size is indeed irrelevant; but if it is recompressed only at the server, then sending a smaller file would give me less upload timeouts.
ADSL lines in South Africa, after you have hit your monthly cap, are very shakey things. Spent about an hour trying to upload a texture the other day :-(
Lora Morgan
Puts the "eek" in "geek"
Join date: 19 Mar 2004
Posts: 779
08-09-2005 10:38
Also consider a smaller size. I'm not sure what your application for the sign is, but you might be able to get way with 256x128 or so. Consider very few people will study informational signs up close (unless they involved nudity), getting it "close enough" is usually better for the overall experience, considering you're saving some download time.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-09-2005 15:40
From: Blain Candour
Not to be argumentative but you can RLE compress a tga just fine and it most certainly would still remain a tga with compression and no loss of quality. Photoshop even prompts if you want to do this when you save a TGA. For SL it is rather pointless.

I stand corrected. All this time, I never noticed that little RLE checkbox at the bottom of the bit depth dialog. I didn't know Targa supported compression at all, always thought it didn't. Oooh, am I a genius sometimes. Thanks for pointing that out, Blian.
_____________________
.

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.