View Full Version : Alpha Multiplier In Guerilla
FRain
May 24th, 2009, 04:13 AM
Hey, so I'm redoing the SomethingTeam HUD, I've got to the WEAPON hud, I know something that has to with alpha multipliers for bars of ammo, and I don't know how to calculate it or exactly what it does. My ammo bar looks like complete ASS and it has some fucked up downward multiplier gradient that I have no clue what it's doing. Halp
Masterz1337
May 24th, 2009, 01:05 PM
I believe it is multiplier=240/clip. It's different for meters with batteries through, if you need some help figuring it out you know how to reach me.
Donut
May 24th, 2009, 01:07 PM
i was thinking about this a while ago, and apparently the 240 refers to the alpha gradient in the image. doesnt the alpha have a value of 0 - 255 in photoshop? if thats the case, why do we use 240 instead of 255?
at any rate, the accepted standard is what masters said, and i think meters are 1.
Skarma
May 24th, 2009, 01:15 PM
Alpha multiplier WHAT? I thought alpha was just supposed to effect the transparency of a sprite/image.
Advancebo
May 24th, 2009, 01:26 PM
Alpha multiplier WHAT? I thought alpha was just supposed to effect the transparency of a sprite/image.
Dont post if you dont know what your talking about.
Masterz1337
May 24th, 2009, 02:35 PM
i was thinking about this a while ago, and apparently the 240 refers to the alpha gradient in the image. doesnt the alpha have a value of 0 - 255 in photoshop? if thats the case, why do we use 240 instead of 255?
at any rate, the accepted standard is what masters said, and i think meters are 1.
I think it's to avoid numbers with decimals.
Advancebo
May 24th, 2009, 02:37 PM
I think it's to avoid numbers with decimals.
But 240/32?
Syuusuke
May 24th, 2009, 03:26 PM
Dont post if you dont know what your talking about.
His post implies a question that he wants someone to answer/correct because he wants to know. He's not just blurting it out there.
Anyway this might be related. (http://www.modacity.net/forums/showthread.php?p=266934)
Advancebo
May 24th, 2009, 03:56 PM
Well in Ghosts Ammo Meter Tutorial, he states that:
A=240/c
Where A is the alpha multiplier, and c is the clip size.
Masterz1337
May 24th, 2009, 05:11 PM
But 240/32?
AFAIK, 240 is the best number to avoid (not prevent) an alpha multiplier without a decimal. You're going to have a problem with 32 in most situations. For CMT HUD we use 240 for everything but battery, and the few weapons with problems aren't even noticeable, I don't think any testers have actually noticed them either.
FRain
May 24th, 2009, 05:21 PM
I've gotten my AR to work, and my SMG is pretty damn close, except for that there is some blank space when its completely loaded.
Donut
May 24th, 2009, 05:31 PM
alright i figured something out a while ago about alpha bias. typically speaking, when you get a decimal, you round to the nearest whole integer and make up for it with alpha bias. but how does alpha bias work? i believe i may have figured it out. lets use 255 this time since it makes more sense with the values
A = 255/C where A = alpha multiplier and C = magazine size
so for a halo 3 assault rifle
A = 255 / 32 = 7.968 ~ 8
in this case, the number is so close to 8 that it should cause any problems
how about a 12 shot pistol?
A = 255 / 12 = 21.25
this gets a little complicated now. take the decimal out, and use the whole number as A
now for alpha bias
B = E * D where B = bias, E = whole number portion of A, and D = decimal portion of A. round B to the nearest whole number
so for the 12 shot pistol
A = 255 / 12 = 21.25
B = 21 * .25 = 5.25 ~ 5
Similarly, you can use the bias to shift the alpha across the icons, if that makes sense...
the multiplier for the stock pistol is 20, and each shot turns one icon off. the bias becomes a "unit" if you will, and you can set the bias to 20 to shift the alpha on the icons, so setting it to 20 will make it so the first icon is always dimmed, and the second to last shot dims the last icon.
i realize that that was kind of ridiculously impossible to read, but in my experience, that is how bias and alpha multipliers work
Advancebo
May 24th, 2009, 11:03 PM
That made some sense, the only way to see if it works is to do that and the normal way to the same meter.
Skarma
May 25th, 2009, 01:53 PM
Dont post if you dont know what your talking about.http://en.wikipedia.org/wiki/Alpha_compositing
um ok.
Donut
May 25th, 2009, 02:33 PM
posting a link to a wikipedia article does not show anything other than your ability to google. and that article doesnt mention anything about halo's alpha multipliers.
but honestly, that in itself derserves praise. nobody googles anything anymore. they just open thier mouth a spew what they think is correct. i dont see that very much here, but in other places its ridiculous. honestly, you are sitting at a computer with access to every piece of information you could possibly need. there is no excuse for coming into a discussion without any background. /rant
that wasnt even directed at you, just more of a general rant than anything else.
Skarma
May 26th, 2009, 11:42 AM
posting a link to a wikipedia article does not show anything other than your ability to google. and that article doesnt mention anything about halo's alpha multipliers.
I asked what alpha multiplier was and I said I thought alpha was transparency effect of an image. Advancebo said I didn't know what I was talking about, so I linked him to the article that explains the transparency, proving I was correct in hopes that he would read it so he could understand what alpha is too, but apparently I am this threads unofficial culprit. Cut it out with the strawmans. And nice work on alpha bias post.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.