[starling] Fixed tint black shader. See #1003

This commit is contained in:
badlogic 2017-10-05 14:15:48 +02:00
parent d0cc44bfdb
commit 38c8c870e8
2 changed files with 4 additions and 3 deletions

View File

@ -54,10 +54,11 @@ package spine.starling {
var fragmentShader : String = [
tex("ft0", "v0", 0, texture), // ft0 = texture2d(texCoords)
"mul ft1, ft0, v1", // ft1 = texColor * light
"sub ft3.xyz, ft0.www, fc0.xyz", // ft3 = texColor.a - 1
"sub ft2.xyz, fc0.xyz, ft0.xyz", // ft2.xyz = (1 - texColor.rgb)
"mul ft2.xyz, ft2.xyz, v2.xyz", // ft2.xyz = (1 - texColor.rgb) * dark.rgb
"mul ft2.xyz, ft2.xyz, ft1.www", // ft2.xyz = (1 - texColor.rgb) * dark.rgb * alpha
"add ft2.xyz, ft2.xyz, ft1.xyz", // ft2.xyz = (1 - texColor.rgb) * dark.rgb * alpha + texColor.rgb * light.rgb
"add ft2.xyz, ft2.xyz, ft3.xyz", // ft2.xyz = ((texColor.a - 1.0) + 1.0 - texColor.rgb)
"mul ft2.xyz, ft2.xyz, v2.xyz", // ft2.xyz = ((texColor.a - 1.0) + 1.0 - texColor.rgb) * dark.rgb
"add ft2.xyz, ft2.xyz, ft1.xyz", // ft2.xyz = ((texColor.a - 1.0) + 1.0 - texColor.rgb) * dark.rgb + texColor.rgb * light.rgb
"mov ft2.w, ft1.w", // ft2.w = alpha
"mov oc, ft2"
].join("\n");