mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 20:43:26 +02:00
fixes in uicreature rendering
This commit is contained in:
@@ -11,6 +11,7 @@ uniform vec4 bodyColor;
|
||||
uniform vec4 legsColor;
|
||||
uniform vec4 feetColor;
|
||||
|
||||
|
||||
vec4 calcOutfitPixel()
|
||||
{
|
||||
vec4 pixel = texture2D(texture, textureCoords);
|
||||
@@ -29,6 +30,31 @@ vec4 calcOutfitPixel()
|
||||
return pixel * outColor;
|
||||
}
|
||||
|
||||
/*
|
||||
// optimized to handle antialising
|
||||
vec4 calcOutfitPixel()
|
||||
{
|
||||
vec4 pixel = texture2D(texture, textureCoords);
|
||||
vec4 maskColor = texture2D(maskTexture, textureCoords);
|
||||
const vec4 white = vec4(1,1,1,1);
|
||||
|
||||
float headFactor = 0.0;
|
||||
if(maskColor.r > 0.1 && maskColor.g > 0.1) {
|
||||
headFactor = min(maskColor.r, maskColor.g);
|
||||
|
||||
maskColor.r -= headFactor;
|
||||
maskColor.g -= headFactor;
|
||||
}
|
||||
|
||||
float tot = headFactor + maskColor.r + maskColor.g + maskColor.b;
|
||||
vec4 outColor = headFactor * headColor + bodyColor * maskColor.r + legsColor * maskColor.g + feetColor * maskColor.b;
|
||||
if(tot < 1.0)
|
||||
outColor += white * (1.0 - tot);
|
||||
outColor.a = 1.0;
|
||||
|
||||
return pixel * outColor;
|
||||
}
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = calcOutfitPixel() * color * opacity;
|
||||
|
Reference in New Issue
Block a user