Показать сообщение отдельно
Старый 14.01.2007, 01:32   #11
HolyDel
 
Регистрация: 26.09.2006
Сообщений: 6,035
Написано 1,474 полезных сообщений
(для 2,707 пользователей)
Re: Flags для текстур. Поясните все их значения.

нет, ето не имхо, хотя и я загнался чуть.
(color1*color2)/255
color1*color2/127
вот из справки:
Alpha: 
This blends the pixels according to the Alpha value. This is rougly done to the formula: 
Rr = ( An * Rn ) + ( ( 1.0 - An ) * Ro ) 
Gr = ( An * Gn ) + ( ( 1.0 - An ) * Go ) 
Br = ( An * Bn ) + ( ( 1.0 - An ) * Bo ) 
Where R = Red, G = Green, B = Blue, n = new pixel colour values, r = resultant colour values, o = old pixel colour values. 
Alpha blending is the default blending mode and is used with most world objects. 
Multiply: 
This blend mode will darken the underlying pixels. If you think of each RGB value as being on a scale from 0% to 100%, where 0 = 0% and 255 = 100%, the multiply blend mode will multiply the red, green and blue values individually together in order to get the new RGB value, roughly according to: 
Rr = ( ( Rn / 255.0 ) * ( Ro / 255.0 ) ) * 255.0 
Gr = ( ( Gn / 255.0 ) * ( Go / 255.0 ) ) * 255.0 
Br = ( ( Bn / 255.0 ) * ( Bo / 255.0 ) ) * 255.0 
The alpha value has no effect with multiplicative blending. Blending a RGB value of 255, 255, 255 will make no difference, while an RGB value of 128, 128, 128 will darken the pixels by a factor of 2 and an RGB value of 0, 0, 0 will completely blacken out the resultant pixels. An RGB value of 0, 255, 255 will remove the red component of the underlying pixel while leaving the other color values 
untouched. 
Multiply blending is most often used for lightmaps, shadows or anything else that needs to 'darken' the resultant pixels. 
Add: 
Rr = ( Rn * An ) + Ro 
Gr = ( Gn * An ) + Go 
Br = ( Bn * An ) + Bo 
The resultant RGB values are clipped out at 255, meaning that multiple additive effects can quickly cause visible banding from smooth gradients.
(Offline)
 
Ответить с цитированием