Merge branch 'EsotericSoftware/3.6' into 3.6

This commit is contained in:
Stephen Gowen 2017-10-05 15:31:22 -04:00
commit 6c81a6e392
3 changed files with 5 additions and 3 deletions

View File

@ -291,6 +291,7 @@ public class SkeletonViewer extends ApplicationAdapter {
// Pose and render skeleton.
state.getData().setDefaultMix(ui.mixSlider.getValue());
renderer.setPremultipliedAlpha(ui.premultipliedCheckbox.isChecked());
batch.setPremultipliedAlpha(ui.premultipliedCheckbox.isChecked());
skeleton.setFlip(ui.flipXCheckbox.isChecked(), ui.flipYCheckbox.isChecked());

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");