Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Fix for Messed-up Appearance Problems

Jay Lamington
Registered User
Join date: 29 Jul 2005
Posts: 6
02-11-2006 21:31
Hi,

I've tracked down the cause of the problems people were having with problems with avatar appearance (e.g. skin matching hair color and having facial hair, shirts rendering weirdly, etc). Since the fix was easy once the problem was found, I made a additional shared library wrapper for Second Life that you can use to fix the problem for yourself until Linden Labs mainlines the fix. All they have to do is add one line of code, which is basically what my fix does at runtime. I've tested this, and it works with the current Linux alpha 1.8.3(9) very nicely. Here's the (tiny) source for the fix, including compilation and usage instructions. This fix only works for the Linux alpha, not for WINE, but it might also work under WINE once LL releases an official version with it included. It's released under the public domain, since it's only a few lines of code and also to avoid any difficulties with LL incorporating it into their official client.

Since attachments are disabled in this forum, you can download it from the site below:

http://techhouse.org/~jimmy/libalphafy.tar.gz

Enjoy!
Hello Toonie
Registered User
Join date: 25 Jul 2005
Posts: 212
02-12-2006 02:10
Best hack ever. I can hardly believe SL wants an 8-bit alpha channel but doesn't ask for it!

I needed this patch to compile:

CODE

--- libalphafy/Makefile Sun Feb 12 05:19:21 2006
+++ Makefile Sun Feb 12 09:43:15 2006
@@ -5,7 +5,7 @@
all: libalphafy.so

%.so: %.o
- ld -shared -o $@ $< -ldl `sdl-config --libs`
+ gcc -shared -o $@ $< -ldl `sdl-config --libs`

%.o: %.c
gcc -fPIC -c $< -D_GNU_SOURCE `sdl-config --cflags`

Angel Sunset
Linutic
Join date: 7 Apr 2005
Posts: 636
wow!
02-12-2006 02:58
Fantastic! I was wondering about that, and wanted to get the alpha channel by an entry in .xinitrc, or in .Xresources, or by enabling alpha as default in xorg.conf.

Since SUSE has reinvented the Linux wheel, I am not going to try the patch though. I am no programmer :D

Don? Are you with us? I think this calls for applause!
_____________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kubuntu Intrepid 8.10, KDE, linux 2.6.27-11, X.Org 11.0, server glx vendor: NVIDIA Corporation, server glx version: 1.5.2, OpenGL vendor: NVIDIA Corporation, OpenGL renderer: GeForce 9800 GTX+/PCI/SSE2, OpenGL version: 3.0.0 NVIDIA 180.29, glu version: 1.3, NVidia GEForce 9800 GTX+ 512 MB, Intel Core 2 Duo, Mem: 3371368k , Swap: 2570360k
Angel Sunset
Linutic
Join date: 7 Apr 2005
Posts: 636
02-12-2006 07:08
Well, I did the patch.

And SL still runs :p

Now to try my favorite disaster skin again... :D

--- edit ---

It works! :D

Don, I hope you are watching ;)
_____________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kubuntu Intrepid 8.10, KDE, linux 2.6.27-11, X.Org 11.0, server glx vendor: NVIDIA Corporation, server glx version: 1.5.2, OpenGL vendor: NVIDIA Corporation, OpenGL renderer: GeForce 9800 GTX+/PCI/SSE2, OpenGL version: 3.0.0 NVIDIA 180.29, glu version: 1.3, NVidia GEForce 9800 GTX+ 512 MB, Intel Core 2 Duo, Mem: 3371368k , Swap: 2570360k
ninjafoo Ng
Just me :)
Join date: 11 Feb 2006
Posts: 713
02-12-2006 09:14
Gentoo amd64 : Had to patch as above to get it to compile, copied the file to the secondlife lib folder, changed my startup line to
CODE
LD_LIBRARY_PATH=lib LD_PRELOAD=lib/libalphafy.so bin/secondlife-bin

CODE

ERROR: ld.so: object 'lib/libalphafy.so' from LD_PRELOAD cannot be preloaded: ignored
fr0zen Squeegee
Registered User
Join date: 3 Feb 2006
Posts: 23
02-12-2006 11:21
Yay! It works. Thanks tons!!'

(Ubuntu 5.10, NVidia 8178)
Jay Lamington
Registered User
Join date: 29 Jul 2005
Posts: 6
02-12-2006 11:44
From: ninjafoo Ng
CODE

ERROR: ld.so: object 'lib/libalphafy.so' from LD_PRELOAD cannot be preloaded: ignored


You probably compiled it with as a 64-bit library, but Second Life is a 32-bit program, which can't be mixed with 64-bit code in the same process like this would do. If you have the tools available to compile 32-bit programs, use those to compile libalphafy.so, and then I expect it to work. If not, compile it on a 32-bit machine and transfer it over. Let me know if that still doesn't work.
ninjafoo Ng
Just me :)
Join date: 11 Feb 2006
Posts: 713
02-12-2006 13:04
From: Jay Lamington
If not, compile it on a 32-bit machine and transfer it over. Let me know if that still doesn't work.

Doh! Built it on my laptop and it works fine - cheers!
Aero6 Widget
Registered User
Join date: 10 Feb 2006
Posts: 5
02-12-2006 16:06
From: Jay Lamington
Hi,
Since attachments are disabled in this forum, you can download it from the site below:

http://techhouse.org/~jimmy/libalphafy.tar.gz

Enjoy!

Thanks! this patch worked great for me.
Matteo Morrison
Registered User
Join date: 6 Feb 2006
Posts: 1
beautiful
02-12-2006 18:24
This bug was so annoying! Thanks for figuring this out and making it available-- it works perfectly! I'm a bit of a beginner so I had to read man make to figure out I needed the -f flag. It's funny how you can recognize other Linux SL players by their hair/face color being pegged. I had to go blond to get yellow skin, which was the least horrible looking, but the bushy eyebrows really were too much!

You rock... No longer are we Linux users a mutant race. :-P
Drake Bacon
Linux is Furry
Join date: 13 Jul 2005
Posts: 443
02-12-2006 19:44
This fixes alot of places where the invisibility prim was used for digitalgrade legs (like on some furs). Now, instead of having see-through-everything, just the items wrapped in the invisiblity prim are transparent -- everything else is good!
Polka Pinkdot
Potential Slacker
Join date: 4 Jan 2006
Posts: 144
02-12-2006 19:54
Does anybody have a binary I could try? Since I'm running the linuxulator, cross compiling is a bit of a pain.
KittyFox Mistral
Registered User
Join date: 17 Oct 2005
Posts: 51
02-12-2006 20:37
From: Polka Pinkdot
Does anybody have a binary I could try?

Sure:
http://kcat.strangesoft.net/libalphafy.so
Drop it into your SL dir, and run:
LD_PRELOAD=./libalphafy.so ./secondlife
If it works, you can edit the secondlife script and prepend LD_PRELOAD=./libalphafy.so to the secondlife-bin command line.
Orenj Marat
Queen of the Null Lines
Join date: 13 Sep 2005
Posts: 15
02-12-2006 21:49
OMG it works!!! For the first time, all the clothes adjusters (shirt sleeve length, etc.) work for me, and I'm betting that if I took off my full-opaque custom skin, the normal skin shaders would fiinally work too... I've kind of grown attached to my look by now though.

Compiled without any patching required on Fedora Rawhide.

W00t!

~Orenj~
Angel Sunset
Linutic
Join date: 7 Apr 2005
Posts: 636
02-13-2006 00:54
The sliders seem to work Ok :)

One side effect I have: on one outfit: every time I go into Appearances, it needs to save my gloves, although I haven't changed anything. At first I was nervous about that, but no visbile damage has occurred :p
_____________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kubuntu Intrepid 8.10, KDE, linux 2.6.27-11, X.Org 11.0, server glx vendor: NVIDIA Corporation, server glx version: 1.5.2, OpenGL vendor: NVIDIA Corporation, OpenGL renderer: GeForce 9800 GTX+/PCI/SSE2, OpenGL version: 3.0.0 NVIDIA 180.29, glu version: 1.3, NVidia GEForce 9800 GTX+ 512 MB, Intel Core 2 Duo, Mem: 3371368k , Swap: 2570360k
Polka Pinkdot
Potential Slacker
Join date: 4 Jan 2006
Posts: 144
02-13-2006 05:52
That seems to work! Thanks. SL doesn't complain about not being able to set the alpha channels correctly anymore.
Foxy Sprocket
Linux User
Join date: 3 Feb 2006
Posts: 11
w00t :D
02-13-2006 06:33
Nice work :) I can finally wear that Penguin shirt with pride :D
Lylia Rosewood
Registered User
Join date: 9 Feb 2006
Posts: 1
02-16-2006 03:44
From: KittyFox Mistral
Sure:
http://kcat.strangesoft.net/libalphafy.so
Drop it into your SL dir, and run:
LD_PRELOAD=./libalphafy.so ./secondlife
If it works, you can edit the secondlife script and prepend LD_PRELOAD=./libalphafy.so to the secondlife-bin command line.


Thank you! That works under Debian. Finally, I can have proper underpants without having permanently white legs.

and thank you to Jay Lamington for writing the fix!
Tatty Trollop
Registered User
Join date: 15 Feb 2006
Posts: 1
02-16-2006 04:50
Worked great on my Gentoo box, thanks!
Sky Roundfield
Registered User
Join date: 10 Feb 2006
Posts: 44
02-16-2006 13:21
Thanks for the override, works perfectly on Debian unstable.
Sorens Winthorpe
Registered User
Join date: 10 Feb 2006
Posts: 1
02-17-2006 15:01
I can't seem to get the binary posted above to work on my AMD64 Gentoo box. Maybe I have to bite the bullet and try a cross compilation.
Rex Foley
Registered User
Join date: 23 Feb 2006
Posts: 3
02-24-2006 22:38
Awsome! Tested and works great!

Sorens,

To force building of an i386 32bit library, you just need to tweak the flags a bit... and you'll need a 32bit libSDL (For Gentoo, emerge emul-linux-x86-sdl). I guess you could link against the one shipped with SecondLife, but to me, this is cleaner.

CODE
# libalphafy - A hack to give Second Life on Linux proper alpha channels
# Written February 11, 2006 by Jimmy Kaplowitz <secondlife@pensezbien.org>
# Released under the public domain, although due credit is appreciated

# Added CFLAGS to force 32bit compile on amd64 platform
CFLAGS=-m32 -march=i386 -fPIC
LDFLAGS=-melf_i386 -L/emul/linux/x86/usr/lib

all: libalphafy.so

%.so: %.o
ld $(LDFLAGS) -shared -o $@ $< -ldl `sdl-config --libs`

%.o: %.c
gcc $(CFLAGS) -c $< -D_GNU_SOURCE `sdl-config --cflags`

tidy:
rm -f *.o

clean: tidy
rm -f *.so

.PHONY: all tidy clean
Zi Ree
Mrrrew!
Join date: 25 Feb 2006
Posts: 723
03-02-2006 01:24
This is so great! This small patch fixed like everything for me! Resizing clothes now work, I see my avatar finally the way everyone else sees her, and begone, black legs :D

Great job! This should definitely go into the official distribution.
_____________________
Zi!

(SuSE Linux 10.2, Kernel 2.6.13-15, AMD64 3200+, 2GB RAM, NVidia GeForce 7800GS 512MB (AGP), KDE 3.5.5, Second Life 1.13.1 (6) alpha soon beta thingie)

Blog: http://ziree.wordpress.com/ - QAvimator: http://qavimator.org

Second Life Linux Users Group IRC Channel: irc.freenode.org #secondlifelug
furahivszuri Zeluco
Registered User
Join date: 26 Feb 2006
Posts: 26
03-02-2006 17:22
Is this still needed with 1.8.4.7?

And more importantly once they build this into the client, will this fix interfere with anything?
Hel Jezebel
Registered User
Join date: 21 Jan 2006
Posts: 52
03-02-2006 21:43
From: furahivszuri Zeluco
Is this still needed with 1.8.4.7?

I just checked, opened 1.8.4.7 without this, and had the same monotone skin & hair thing. So, I'd say, yes, it is still needed.
1 2