|
Post by ravasheen on Jul 19, 2019 14:28:37 GMT -5
So I am making a rug that isn't perfectly square so I have added an alpha to it. The rug looks fairly good up close, but when I zoom out or at certain angles I see black edges. I found this thread that talks about the same issue and they mentioned changing the alpha threshold/alpha blended. However, I modified this and didn't see any changes in game. I am wondering: 1) What does alpha blended do? 0 vs 1? 2) What does alpha threshold do? 0 vs 128? 3) Any ideas how to fix this? Package file and images below. Thanks! Package File LinkNo Black Edges: Black Edges:
|
|
|
Post by lavsm on Jul 20, 2019 0:22:05 GMT -5
I believe that alpha blended 1 means that the texture has a translucent (grayscale) alpha, rather than just transparent/opaque. Alpha mask threshold means that any color in the alpha equal to or over the chosen value (0-255) will be opaque, and under will be transparent. In my experience setting the threshold higher can sometimes make the edges look smoother. In this case I think the black edges are caused by the edges of your alpha lining up exactly with those of your texture. With this type of object it is helpful to work in .dds, because it allows you to make the alpha a few pixels smaller than the main texture, helping to eliminate this problem. The rugs look nice though.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Oct 31, 2021 19:21:53 GMT -5
I believe that alpha blended 1 means that the texture has a translucent (grayscale) alpha, rather than just transparent/opaque. Alpha mask threshold means that any color in the alpha equal to or over the chosen value (0-255) will be opaque, and under will be transparent. In my experience setting the threshold higher can sometimes make the edges look smoother. In this case I think the black edges are caused by the edges of your alpha lining up exactly with those of your texture. With this type of object it is helpful to work in .dds, because it allows you to make the alpha a few pixels smaller than the main texture, helping to eliminate this problem. The rugs look nice though. but isnt that essentially the same thing? albeit, alphathreshhold works for colored things, and blended only works for black & white? im still confused over the differences.
|
|
|
Post by Fwecka (Lolabellesims) on Nov 8, 2021 5:19:55 GMT -5
TL;DR. AlphaBlended makes it so that your object will use an alpha channel. AlphaMaskThreshold tells the game how to interpret the colors in your alpha. Read on for a more in-depth and maybe-not-correct explanation. Enabling AlphaBlended just makes it so that your mesh can utilize an alpha channel for transparency. Take a look at this tutorial. 0 = false and 1 = true. So if AlphaBlended was set to 0 it would be disabled; 1 would mean it's enabled. If you use Ctrl + Shift + C you can bring up a window in Studio and you can enter a cheat code (type "help" for a list of codes). Alphalpha adds and enables AlphaBlended. It's just a quick way of doing what the tutorial describes. It's a shortcut. The general rule for the alpha channel of a texture is that anything in the alpha channel that's pure white will NOT be transparent--will be fully rendered in-game--while anything pure black will be completely invisible in-game. The alpha channel only works in greyscale, meaning it will only use black or white or levels of grey, no colors. So, if you wanted your item to have no transparency you'd make your alpha white--not the whole area, just where your UV islands are. Here's an example of what I mean. Ignore what's written there. I was having issues with the alpha channel not saving correctly. If you wanted your item to be completely invisible you'd paint the whole alpha channel black. If you wanted some transparency you'd use grey. Darker grey means more transparency; lighter grey means less transparency. AlphaMaskThreshold. That one I'm not entirely sure of. I think that it sort of evens out the black or white or grey in the alpha. For instance, you might have areas at the edges of your alpha channel that are blurred a bit. Like if you have a curved edge in an image sometimes you'll get feathering instead of a crisp edge. The feathered areas won't be the same color as the rest so AlphaMaskThreshold somehow fixes that? ¯\_(ツ)_/¯ This is what I mean by a feathered edge. In graphics world, colors represent numbers. It's always about numbers and math, math and numbers. I'm not sure what the number range is. I think white represents 0 while black represents the highest number which I believe is 128 (not sure, trying to google, finding very little info). So, say for instance your alpha channel was 50% grey, but at the edges, because of feathering, the color is, say 60% grey (a darker grey). You don't want the feathering because it messes with how the transparency looks at the edges of your item. I think you can tell the game that any color darker than 50% grey should be treated as if it were pure black. This forces the game to treat the edges as if they were crisp with no feathering. AlphaMaskThreshold is what you use to give the game instructions on how to treat feathered edges. This is as near as I understand it and I hope it makes some sense. Hopefully, I didn't get any of it wrong. I struggle with it, too.
|
|
|
Post by qolygonal on Nov 8, 2021 8:03:57 GMT -5
AlphaMaskThreshold. That one I'm not entirely sure of. Lavsm has already given an explanation of what it is. GIMP User Manual. Fully applicable to the game. White - #ffffff, rgb(255, 255, 255). Black - #000000, rgb(0, 0, 0).
|
|
|
Post by Fwecka (Lolabellesims) on Nov 11, 2021 5:48:49 GMT -5
AlphaMaskThreshold. That one I'm not entirely sure of. Lavsm has already given an explanation of what it is. GIMP User Manual. Fully applicable to the game. White - #ffffff, rgb(255, 255, 255). Black - #000000, rgb(0, 0, 0). You always find information and tutorials I can never find. I saw what Lavsm wrote but I guess it just didn't come together in my head—sometimes, I'll read something and it just doesn't take and I have to go back and read it again and again before it'll sink in. It's maddening. And It never even occurred to me to look at the GIMP manual 🤦♀️ I was trying to find something that explained it all in very concrete terms but couldn't find it. I think I get it now. In short, AlphaThreshold makes blurred edges crisp. Not in reality—your image will still have blurred edges—but in terms of how the game interprets the texture. And it determines where in a blurred or feathered edge the cutoff takes place. It determines where the transition takes place. The screenshot helps qolygonal an image like that is what I mean when I say I was hoping for a concrete explanation. I think I wasn't finding much because I had included "Sims 4" in my search terms thinking that AlphaThreshold was something specific to the Sims games.
|
|
|
Post by ravasheen on Apr 10, 2022 1:08:05 GMT -5
thank you everyone for your replies (3 years later). this post came up on a google search and i was like hey i remember posting that!! i wanted to add to this with some knowledge ive learned over the years - a cool option to use with this as well for anyone else who is curious. if you add an alphablended setting (float) to the material settings in model LOD you can get a ~really~ nice edge especially on rugs. to look at an example check out the circle rug from paranormal pack in debug!
|
|
|
Post by ravasheen on Apr 10, 2022 1:10:27 GMT -5
Lavsm has already given an explanation of what it is. GIMP User Manual. Fully applicable to the game. White - #ffffff, rgb(255, 255, 255). Black - #000000, rgb(0, 0, 0). You always find information and tutorials I can never find. I saw what Lavsm wrote but I guess it just didn't come together in my head—sometimes, I'll read something and it just doesn't take and I have to go back and read it again and again before it'll sink in. It's maddening. And It never even occurred to me to look at the GIMP manual 🤦♀️ I was trying to find something that explained it all in very concrete terms but couldn't find it. I think I get it now. In short, AlphaThreshold makes blurred edges crisp. Not in reality—your image will still have blurred edges—but in terms of how the game interprets the texture. And it determines where in a blurred or feathered edge the cutoff takes place. It determines where the transition takes place. The screenshot helps qolygonal an image like that is what I mean when I say I was hoping for a concrete explanation. I think I wasn't finding much because I had included "Sims 4" in my search terms thinking that AlphaThreshold was something specific to the Sims games. this image is really helpful - thanks! also you can actually preview the alphamaskthreshold values and what it will look like in blender if anyone needs help setting that up, ping me!
|
|
|
Post by ravasheen on Apr 10, 2022 1:34:19 GMT -5
I believe that alpha blended 1 means that the texture has a translucent (grayscale) alpha, rather than just transparent/opaque. Alpha mask threshold means that any color in the alpha equal to or over the chosen value (0-255) will be opaque, and under will be transparent. In my experience setting the threshold higher can sometimes make the edges look smoother. In this case I think the black edges are caused by the edges of your alpha lining up exactly with those of your texture. With this type of object it is helpful to work in .dds, because it allows you to make the alpha a few pixels smaller than the main texture, helping to eliminate this problem. The rugs look nice though. i mentioned this in my previous reply but alphablended actually blends the edges a bit. whenever you do a phong shader, it will be essentially fully transparent/opaque (except blending at the edges). to have some sort of semi-transparency you need to use phongalpha or glass shader. i know this is a late reply but just responding in case anyone else comes across this post
|
|