Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Texture Compression

Changeling Fate
Beautifully Flawed
Join date: 18 Dec 2003
Posts: 181
07-06-2004 15:35
Since 1.4, the texture compression of SL is a bit too much, in my opinion. I can understand why we'd want to compress the ridiculously huge uploads, but when a standard 512x512 is compressed beyond use, it's more than a bit frustrating.


I've filed a bug report, but LL is rather slow these days, so i thought i'd put my problem up here as well to see if there's any insight from other users. Any suggestions/help would greatly be appreciated.

I've uploaded several fully body skin tattoos that are supposed to be one solid color. here's an example of what i am talking about - that texture is supposed to be SOLID purple; that amount of noise is rendering it completely unusuable. (texture is originally quite a bit darker - i've upped the brightness for display here.)

Here's the part that utterly confuses me. That noise only seems to be appearing on my screen - or in my client. I've passed the texture to a couple of friends, and they see no noise at all. When they applied the texture to themselves - they saw it as clean; i saw it as noisy. When i applied the texture to myself - everyone saw it as noisy.

I did check my video drivers - they are up-to-date. Video card is an nvidia geforce 5900. My computer exceeds all of SL's requirements in all departments. I compared video/display settings with those friends, and they are comparable.

Recap: texture noise, but only when rendered by my client. Any ideas as to what's up?? What might i be missing?
_____________________
Piprrr Godel
Code Wrangler
Join date: 25 Sep 2003
Posts: 54
JPEG is a lossy format
07-06-2004 17:13
JPEG is a "lossy" compression format. That is, images are altered from the original to improve compression efficiency.

You can either increase the JPEG "quality" in whatever image editor you're using, or try a lossless format like GIF, PNG, or TIFF. (I'm not sure of those what are Second Life palatable formats.)

Still, the image should be rendered in a consistent manner from client to client regardless of the image's quality. Have you tried comparing client settings? Graphics hardware? Graphics hardware settings?
_____________________
I'm taking reality in small doses to build immunity.
Eddy Stryker
libsecondlife Developer
Join date: 6 Jun 2004
Posts: 353
Re: JPEG is a lossy format
07-06-2004 17:34
From: someone
Originally posted by Piprrr Godel
JPEG is a "lossy" compression format. That is, images are altered from the original to improve compression efficiency.

You can either increase the JPEG "quality" in whatever image editor you're using, or try a lossless format like GIF, PNG, or TIFF. (I'm not sure of those what are Second Life palatable formats.)

Still, the image should be rendered in a consistent manner from client to client regardless of the image's quality. Have you tried comparing client settings? Graphics hardware? Graphics hardware settings?


Piprrr, I'm not trying to follow you around in the forums but slow down with the crazy pseudo-technical posts man!

Just so there's no confusion, yes SL converts everything you throw at it to JPEG2000 with multi-pass (three I think?) rendering. You should never save your local files as .JPG because you're compressing them once, then the server will recompress them at a different rate. GIF and PNG are vector graphic formats, NEVER EVER use them for things such as textures you would upload to SL. The SL client doesn't even understand TIFF so forget that. Use Targa (.tga) files exclusively, since they correctly store transparency in alpha channels as SL expects it to be in. It's also lossless if I recall so you don't get double-degradation. Ok, on to your problem.

JPEG compression uses a discrete cosine transform on the greyscale brightness of each 8x8 block of pixels in the image. The brightest areas are compressed the most since our eyes are more sensitive to low light levels than high ones. What this means in a nutshell; if you make a solid purple image and turn on the maximum compression possible for a JPEG, the entire thing has a single greyscale level and no part of it will get compressed more severely than another part. A few possibilities; maybe the image isn't evenly purple? Zoom in all the ways and check if maybe it's a pattern of alternating shades of purple at the pixel level. JPEG was meant for photo compression and using wildly different brightness levels inside the 8x8 blocks may confuse the algorithm and product strange DCT coefficients.

The more likely answer is your hardware or software has a problem, which explains why the image is fine in reality (no one else is seeing the problem), but your client is having difficulty. It helps to step through logically and think "hmm, no one else has a problem except for me" before filing a bug report. Your video card has the ability to do it's own texture compression, and these settings can be adjusted independently for DirectX, OpenGL, and by the application (SL, newview.exe) itself. Maybe you have a small amount of texture memory on your video card and it's heavily compressing this texture. Have you rebooted, opened the texture in SL again and verified it's not a transient problem?
Changeling Fate
Beautifully Flawed
Join date: 18 Dec 2003
Posts: 181
07-06-2004 21:05
*nods* good suggestions, and muchly appreciated.

I save my .jpgs at the lowest compression setting possible. People hate my file sizes! In PS, i have it set all the way up at 12 quality.

The background purple was done via a 'fill' - so it's a solid color - even in my original on my machine.

EVEN .tga is doing this to me, though. I thought of that, and it was one of the routes i tried to take to fix this - still getting the noise from compression.

I have rebooted, indeed. My video memory is currently at 256. None of my video/display settings have changed from the time 1.3 was running to the time 1.4 was running. I have compared settings in-game with other people and they are all identical.

Did i miss any suggestions? *chuckle* Any other ideas? What about the bit where they are seeing the noise when i apply it to myself, but not when they apply it to themselves? That part has me muddled up something fierce. They -are- seeing the noise, when it's rendered by me.
_____________________
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-06-2004 21:07
Assuming everyone else IS rendering it correctly, it's possible that it could be either power or thermal-related. What motherboard and CPU do you have?
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Changeling Fate
Beautifully Flawed
Join date: 18 Dec 2003
Posts: 181
07-06-2004 21:11
Motherboard = either asus or abit, i've got driver discs for both.
CPU = P4 2.4

It confuses me as to why it began with 1.4 though. Nothing on my computer has changed since 1.3, so it makes me believe that it's a change in SL itself? Is this not necessarily true?
_____________________
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-06-2004 21:15
Not necessarily. It could be coincidence, or SL could be doing something that took advantage of a different part of your video card or RAM. You should be able to tell what motherboard you have when your computer boots up for the very first time.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
Re: Re: JPEG is a lossy format
07-07-2004 00:09
From: someone
Originally posted by Eddy Stryker
GIF and PNG are vector graphic formats, NEVER EVER use them for things such as textures you would upload to SL.


Just a minor correction. GIF and PNG are raster formats, just like JPEG, TIFF, TGA, BMP, and nearly any other image format you're likely to run into. The only non-proprietary vector formats I can think of off-hand are postscript, Windows Metafile, and SVG.
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'
Eddy Stryker
libsecondlife Developer
Join date: 6 Jun 2004
Posts: 353
07-07-2004 00:19
Ack you're correct Carnildo. While GIF and PNG are well suited for compressing vector graphics, they are actually raster formats. I still stand by my statement that you should NEVER EVER use them for SL textures. And Changeling, no JPG either! I understand that's not the problem here, but you will live a much more fulfilled life and come that much closer to spiritual nirvana if you don't compress textures twice (even the most minimal compression settings still compress the image).
Changeling Fate
Beautifully Flawed
Join date: 18 Dec 2003
Posts: 181
07-07-2004 11:46
Catherine, It's an AOpen motherboard. Round about a year old - sorry about that, it's difficult to keep straight what's in which of the five computers in this room. *chuckle*

Noted on the .jpg, gentlemen. Since SL is limited in what files it can upload, i'd assume you recomment everyone use the .tga format then?
_____________________
Eddy Stryker
libsecondlife Developer
Join date: 6 Jun 2004
Posts: 353
07-07-2004 11:52
Correct. Targa format, no RLE compression, 24 or 32 bit depending on whether an alpha channel is present, and dimensions divisible by 8 is what I would recommend. I have a really texture heavy building in Fujin I've been working on, and this is what I've discovered through some knowledge on image formats, some reading, and trial and error.
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
07-07-2004 19:59
To build on what Eddy said:
Use 24 bit TGA if you have no transparent parts.
User 32 bit TGA only if you are using transparency.
Use dimensions that are powers of 2, and less than 1024.

Why?
If you use a 32 bit TGA it will suffer from all the alpha blending issues, even if there is no actual transparency.

SL will stretch your texture to the nearest power of 2 dimensions less than or equal to 1024 for you if you do not and that could scew your image.
_____________________
--
010000010110110101100001001000000100111101101101011001010110011101100001
--
Changeling Fate
Beautifully Flawed
Join date: 18 Dec 2003
Posts: 181
07-07-2004 22:34
I really appreciate the input about the preferred image format to be used in SL, and opinions thereof... *smile* ... but that's not what this thread is about. (I didn't know about the stretching, wow!)

To get back on track: I am seeing a compression of textures that is rendering said textures useless, regardless of which format i've uploaded them in. Others are only seeing noise in the textures when it's rendered by my client; i.e. - it's on me. Whenever they are looking at said texture independent of me, it's absolutely fine.

Any other ideas and/or suggestions to help me figure out what's going on here? Thanks!

*Edit: yes, i can spell. It's my keyboard that cannot. Really.
_____________________
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-08-2004 04:28
Hmm, upon re-reading your initial post, I now notice the key phrase "When i applied the texture to myself - everyone saw it as noisy."

Yeah, it's not hardware, it's a compression problem. The reason you can see it is likely because your gamma settings are different than everyone else's. I find it interesting that other people only saw the noise when you wore the skin though.

I suggest emailing [email]support@secondlife.com[/email] and asking how to improve this. JPEG2000 shouldn't be doing that, even at high compression rates.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Changeling Fate
Beautifully Flawed
Join date: 18 Dec 2003
Posts: 181
07-08-2004 12:27
Thanks again, Catherine. I'll do that, since the bug report hasn't been touched yet. *smile* Patience, Changeling, patience.
_____________________