Jump to content

Why do my textures with a transparent edge have a white border in SL?


You are about to reply to a thread that has been inactive for 277 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'm new to this...


I've made a texture for a rug, and given it a transparent border to make it look a little more natural around the edges.

In Paintshop Pro, everything looked good but when I uploaded the texture to SL and put it on a prim, there was a thin white border around the rug where the transparency started. That is, around the edge of rug itself where the alpha layer changed from opaque to transparent.

I thought I had not cropped (with the alpha layer that is) close enough to the rug itself because the original image did have a lighter background colour around the rug. So, I did it over and made absolutely certain (by both making the outer edge of the rug image red, and putting the result against a black background in PSP) that the final image had no light edge to the rug. None, whatsoever.

On uploading again, the exact same thing happens. I see a thin white edge all around the actual rug, nicely antialiased with the rug edge but it makes my rug look rubbish. It's as if the alpha layer opaque parts (which are white in the mask in PSP) are being antialiased with the edge of the rug.

So, before I waste more money uploading another version, does anyone know why this might be happening and how to avoid it?

Link to post
Share on other sites

It may be the file type you've selected to save your texture.  Try using .PNG to save the file.  I'm not a PSP user so am not sure if you use save or export.  Also, you can use 'local textures' to test your your file before uploading.  It's a tab on the Texture Picker window and you 'add' your file from your hard drive.  That way you don't have to keep paying the L$10 to upload until you've gotten it right.


There are loads of tutorials on getting rid of 'halos' on textures.  Google is a great place to look and choose a tutorial that makes sense for you.  Robin Wood has some easy to follow tutorials at

http://www.robinwood.com/Catalog/Technical/SL-Tuts/SLPages/WhiteHalo2.html


Best of luck to you.

Link to post
Share on other sites

Not sure what your problem is. I haven't had that issue.

 

Just wanted to say there is NO reason to waste money testing. You can use LOCAL textures  in the texture pane. Just ADD the texture you want to test and then click on it in the list. It will appear "as if" it was on the object. No one but you can see it.

 

Save money :D.

Link to post
Share on other sites

I'm baffled, Vulpinus!

I'd get behind the .PNG/.TGA suggestions, except that you said "I see a thin white edge all around the actual rug, nicely antialiased with the rug edge". Saving as JPEG would leave no transparency in your rug at all and you'd see a crisp, straight, white border right to the edge of the prim.

I do highly recommend Chic's suggestion to use local textures. The beauty of local textures is that they update automatically when you save new versions. You needn't keep uploading, just make your change in PSP, save it, and watch it magically appear in-world.

 

Have you opened your exported image in PSP to examine it? I'd expect the issue to be apparent there. I've never seen SL mangle a texture. What I see before upload is what I see after.

Good luck!

Link to post
Share on other sites

that can be a side effect of the automatic resampling at lower levels of detail. a common workaround is to set the texture repeats to very slightly less than you need. so if you would normally want repeats 1.0, use .99 instead. this "overscan" moves the hard edges out of the visible area.

 
 
Link to post
Share on other sites

it would help if you post a picture of the rug and point the problem.

if your texture still look ok when you open the texture in sl (not on the prim, the texture itself) then i suspect its a problem of the sides of the rugs.

if the edge of your texture are supposed to be transparent, then you will see the other sides thru it and so if you apply your texture over ALL the sides, you will see thru the transparency what's on the vertical sides.

i would set the whole rug as 100 % of transparency. Then, i would select the upper face and would revert the transparency to 0 %, and same for the bottom side. You can also do it side by side, but since a rug is extra thin, the faster is still to do as i just said.

Of course, your vertical sides will be transparent, but its a rug, so its thin, noone will notice. it"s the tiny price you ll need to pay for having transparent edges on the main sides :)

Of course i can be wrong, and your problem being not coming from the lateral faces... Without a pic its pretty hard to guess.

Link to post
Share on other sites

Thanks for all the replies folks.

I wish I had known I could test things with local textures... D'oh! I did try going on the beta grid to test but after being refused login attempts for over half an hour I gave up; I have passed the 'test' and have been there before. I'll play to my hearts content now I know though!

Anyway...

The texture is saved from PSP in .tga format, 32 bit with the alpha. I read up on how to do that first. Loading the .tga back into PSP looks perfect; no white border. If I put a temporary black layer behind it to show up any whiteness, still nothing.

I did try the suggestion to slightly change the repeat, but then I lost the ragged edge of the rug in order to lose the white border so it doesn't work for me.

The prim is set transparent on all faces other than the top, and I've re-done that several times to make sure.

...Ahh, I've just remembered to look at the texture itself in SL. Looks OK at first (I had already checked it), but when I do a screenshot and paste that into PSP and zoom in, I can see very feint antialiasing where the white border is showing.

That is definitely not evident when I load the tga file into PSP though.

I've uploaded four photos to show what I mean:

 

The problem in SL:

test1.jpg

 

TGA file reloaded into PSP, showing transparency:

Test2.jpg

 

As above but against a black layer to check for white:

test3.jpg

 

The magnified screenshot of the texture file from my SL inventory, showing antialiasing:

test4.jpg

 

Link to post
Share on other sites

Just to clarify this:


tga file reloaded into PSP: Transparency is correct, no rug-edge antialiasing, no white border.

texture applied in SL: white border, due to below:

texture file as shown in SL and magnified: rug edge is now antialised where the transparency begins.

 

It looks like the image is being antialiased when uploaded to SL although I'm going to check further since obviously it isn't happening to anyone else... (I bet it's another PSP 'feature' that I'm about to discover)

Link to post
Share on other sites

What you're seeing is a very common problem in SL.  Here's a page that will explain how and why this happens and how to fix it... link.

If you don't feel like reading all that and just want a quick solution to fix this particular texture, I'll tell you how to do that.  What you do is create a layer underneath the rug layer and flood fill it with a color that's as close to the red on the edge of the rug as you can get, then merge it with the rug layer and save as either tga or png, it doesn't matter... that's it.

Hope this helps ...Dres

  • Like 1
Link to post
Share on other sites

Have you actually checked the link in the very first answer in this thread, about the white halo?

Try to fill a layer under your texture with a red color. The color of the edges of your rug. Then save that out as 32 bit tga.

The alpha channel will take care of your transparency. It doesn't need to show in your paint app.

Actually there are a couple of ways to "solidify" the texture, hence filling the surrounding area with the color of the pixel on the edges.  In Photoshop we have that wonderfully Solidify Filters from flaming pear.

Anyway, a manual way to fill the canvas is to copy the rug-layer, blur it a bit, and pull it under the rug layer. Then copy the blured layer and merge it with the other blured layer. It should extend the bluring automatically. At least it works that way in Photoshop. Repeat that 5, 6 seven times. Then save it out as a 32 bit tga again.

Link to post
Share on other sites

We must have been writing our posts at the same time and I unfortunately missed the link in the second post here.  I'm surprised so many people don't know about the white halo effect... I learned about it years ago when I attended one of Robin's Alpha 101 classes at the Builder's Brewery.  She's an invaluable asset to SL.

...Dres

Link to post
Share on other sites

I'm now inclined to think SL is screwing up the texture when it's applied. Your image of the texture in inventory shows that the alpha channel is working as intended. I see a very slight lightening of the grey checkerboard square behind the rug's corner (that's a problem, more later), and even less along the bottom edge, where I see a redding of the white checkboard squares (that's a good thing).

Yet we see a very definite white border once the texture is applied in world. It looks to me like the alpha channel is being thresholded. Any alpha channel pixel that's not full transparent is made full opaque. That's not the desired behavior. I'll guess that if you selected a section of your alpha channel and made it 50% transparent (paint it grey?), you would see that section of the rug as translucent in inventory, but opaque on a prim.

Also, if you look closely at the lower right corner of your rug in the inventory snapshot, you'll see a bit of white halo on the grey checkerboard square. This suggests the edge of the rug is not flooded with red as you mentioned. Double check that. Absent the alpha channel, your rug should be red out to the edge of the canvas. Dragging slowly into the edge of your rug from outside on a grey checkerboard square, my color meter detects a very slight shift towards white. I can't see it easily until I magnify that area of your inventory snapshot.

So, I think we may be seeing a mix of two problems:

  1. The viewer is thresholding the alpha channel upon texturing, but not in the inventory view.
  2. Your rug image isn't red-filled to the canvas edge.

You can fix #2 in PSP. You might be able to fix #1 by switching viewers.

There's also a third possible problem.

           3. I have no idea what's I'm talking about!

;-).

ETA: I see others have linked to something which (I haven't read it) will suggest the problem is entirely #2. I've never encountered this problem myself because I always flood out from the edges of alpha selections to avoid this problem. So it's possible that SL has been doing #1 all along and I've never noticed it.

Link to post
Share on other sites

The problem is entirely #2, as you put it.

The issue arises because, when you upload a texture with transparency and an alpha channel, then upload it into SL, SL basically turns the image opaque (giving it a white background, by default), then subtracts the alpha channel from it.  What results is a "white halo", because the pixels on the edge show through no matter what you do.

The fix is to make sure there's no transparency in the image except for the alpha channel, which is why you fill the transparent part with a matching color, then let the alpha channel subtract what it needs to from that.  That way, though there will still be (as there always will) a halo, it will match your texture instead of being white.

...Dres

Link to post
Share on other sites


Dresden Ceriano wrote:

The problem is entirely #2, as you put it.

The issue arises because, when you upload a texture with transparency and an alpha channel, then upload it into SL, SL basically turns the image opaque (giving it a white background, by default), then subtracts the alpha channel from it.  What results is a "white halo", because the pixels on the edge show through no matter what you do.

The fix is to make sure there's no transparency in the image except for the alpha channel, which is why you fill the transparent part with a matching color, then let the alpha channel subtract what it needs to from that.  That way, though there will still be (as there always will) a halo, it will match your texture instead of being white.

...Dres

I've a tool in Photoshop that automatically expands the edges of object to avoid this problem, which is not particular to SL. I've always designed with this in mind, which is why I've not encountered this problem here after six years of building with alpha textures.

What's bugging me about Vulpinus' example images is the mismatch between the inventory view of his texture and its application in-world. You'd expect to see the same halo in both places. Perhaps the grey squares of the preview checkerboard background simply aren't dark enough. It would be interesting for Vulpinus to lay his rug on an approximation of the inventory window background checkboard in-world.

Link to post
Share on other sites

Problem solved.

The colours-to-the-edge bit was the clue, but...

I had read the link in the second post, and had in fact already done the procedure manually before posting here as the very first thing I tried to correct the issue. Nice to know I had got it right. That's what I meant by putting a red border around the rug. Also nice to have a plugin now to do it for me, so thanks for the link.

That however made no difference.

The issue was a very simple one, I forgot to remove the layer that I used to generate the alpha channel. Well, not so much forgot but the instructions I read  didn't say to do so, and I didn't realise that it was no longer wanted once I had used it to generate the alpha channel. So, it was being flattened with the image and that's where the white background was coming from. Shame it didn't show in the file when reloaded locally; I would have figured it out a lot sooner.

Thanks for the help everyone, I now have a nice rug and have learned a few extra things in the process (like not to waste money uploading stuff, lol)

 

Link to post
Share on other sites


Vulpinus wrote:

Problem solved.

The colours-to-the-edge bit was the clue, but...

I
had
read the link in the second post, and had in fact
already done
the procedure manually before posting here as the very first thing I tried to correct the issue. Nice to know I had got it right. That's what I meant by putting a red border around the rug. Also nice to have a plugin now to do it for me, so thanks for the link.

That however made no difference.

The issue was a very simple one, I forgot to remove the layer that I used to generate the alpha channel. Well, not so much forgot but the instructions I read  didn't say to do so, and I didn't realise that it was no longer wanted once I had used it to generate the alpha channel. So, it was being flattened with the image and that's where the white background was coming from. Shame it didn't show in the file when reloaded locally; I would have figured it out a lot sooner.

Thanks for the help everyone, I now have a nice rug and have learned a few extra things in the process (like not to waste money uploading stuff, lol)

 

Yeah, I know you'd said you flooded red to the edge, but the evidence was against you!

When working with alpha textures, it's often the case that it'll only look right in practice if it looks wrong in PSP/PS. It took me years to get comfy with working in the alpha channel.

I still wonder if the difference between the inventory view and in-world view of your texture isn't indicative of something approaching a "bug".

Link to post
Share on other sites
  • 2 weeks later...

I had the same issue, the other day. A helpful person in chat explained me how to get rid of it. :)

1) For starters, use a *black* background layer (which you'll disable later on, of course), instead of white: that way you'll immediate see the halo-ing without having to upload first.

2) 'Adjust levels' is your friend! Use it to throttle down the 'white' slider, until all halo-ing is gone.

It's actually surprisingly easy, once you know how. Hope it helps you too!

Link to post
Share on other sites
  • 5 months later...

For the past month I am unable to upload tga files with transparent...the transparent turns white. These are files I have uploaded before. I also made a video on how to make a layer mask, so I know how to do it. LOL. Has something changed in SL or the latest Firestorm viewer that I'm not aware of? LOL 

 

NEVER MIND. IT'S NOT WHITE ONCE UPLOADED. SHEESSSSSSSSSSSSSSSSSSSSSS

Link to post
Share on other sites
  • 5 years later...
You are about to reply to a thread that has been inactive for 277 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...