mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge branch '4.0-beta' of https://github.com/esotericsoftware/spine-runtimes into 4.0-beta
This commit is contained in:
commit
6e5dd10a81
@ -378,7 +378,7 @@
|
|||||||
* `GetRemappedClone()` now provides an additional parameter `pivotShiftsMeshUVCoords` for `MeshAttachment` to prevent uv shifts at a non-central Sprite pivot. This parameter defaults to `true` to maintain previous behaviour.
|
* `GetRemappedClone()` now provides an additional parameter `pivotShiftsMeshUVCoords` for `MeshAttachment` to prevent uv shifts at a non-central Sprite pivot. This parameter defaults to `true` to maintain previous behaviour.
|
||||||
* `SkeletonRenderer` components now provide an additional update mode `Only Event Timelines` at the `Update When Invisible` property. This mode saves additional timeline updates compared to update mode `Everything Except Mesh`.
|
* `SkeletonRenderer` components now provide an additional update mode `Only Event Timelines` at the `Update When Invisible` property. This mode saves additional timeline updates compared to update mode `Everything Except Mesh`.
|
||||||
* Now all URP (Universal Render Pipeline) and LWRP (Lightweight Render Pipeline) shaders support SRP (Scriptable Render Pipeline) batching. See [Unity SRPBatcher documentation pages](https://docs.unity3d.com/Manual/SRPBatcher.html) for additional information.
|
* Now all URP (Universal Render Pipeline) and LWRP (Lightweight Render Pipeline) shaders support SRP (Scriptable Render Pipeline) batching. See [Unity SRPBatcher documentation pages](https://docs.unity3d.com/Manual/SRPBatcher.html) for additional information.
|
||||||
* Sprite shaders now provide four `Diffuse Ramp` modes as an Inspector Material parameter: `Hard`, `Soft`, `Old Hard` and `Old Soft`. In spine-unity 3.8 it defaults to `Old Hard` to keep the behaviour of existing projects unchanged. Note that `Old Hard` and `Old Soft` ramp versions were using only the right half of the ramp texture, and additionally multiplying the light intensity by 2, both leading to brighter lighting than without a ramp texture active. The new ramp modes `Hard` and `Soft` use the full ramp texture and do not modify light intensity, being consistent with lighting without a ramp texture active.
|
* Sprite shaders now provide four `Diffuse Ramp` modes as an Inspector Material parameter: `Hard`, `Soft`, `Old Hard` and `Old Soft`. In spine-unity 3.8 it defaults to `Old Hard` to keep the behaviour of existing projects unchanged. From 4.0 on it defaults to `Hard` for newly created materials while existing ones remain unchanged. Note that `Old Hard` and `Old Soft` ramp versions were using only the right half of the ramp texture, and additionally multiplying the light intensity by 2, both leading to brighter lighting than without a ramp texture active. The new ramp modes `Hard` and `Soft` use the full ramp texture and do not modify light intensity, being consistent with lighting without a ramp texture active.
|
||||||
|
|
||||||
* **Changes of default values**
|
* **Changes of default values**
|
||||||
* `SkeletonMecanim`'s `Layer Mix Mode` now defaults to `MixMode.MixNext` instead of `MixMode.MixAlways`.
|
* `SkeletonMecanim`'s `Layer Mix Mode` now defaults to `MixMode.MixNext` instead of `MixMode.MixAlways`.
|
||||||
|
|||||||
@ -29,30 +29,28 @@
|
|||||||
|
|
||||||
package com.esotericsoftware.spine;
|
package com.esotericsoftware.spine;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.GL20;
|
import static com.badlogic.gdx.graphics.GL20.*;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||||
|
|
||||||
/** Determines how images are blended with existing pixels when drawn. */
|
/** Determines how images are blended with existing pixels when drawn. */
|
||||||
public enum BlendMode {
|
public enum BlendMode {
|
||||||
normal(GL20.GL_SRC_ALPHA, GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA), //
|
normal(GL_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE), //
|
||||||
additive(GL20.GL_SRC_ALPHA, GL20.GL_ONE, GL20.GL_ONE), //
|
additive(GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE), //
|
||||||
multiply(GL20.GL_DST_COLOR, GL20.GL_DST_COLOR, GL20.GL_ONE_MINUS_SRC_ALPHA), //
|
multiply(GL_DST_COLOR, GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), //
|
||||||
screen(GL20.GL_ONE, GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_COLOR), //
|
screen(GL_ONE, GL_ONE, GL_ONE_MINUS_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
|
||||||
;
|
|
||||||
|
|
||||||
int source, sourcePMA, dest;
|
public final int source, sourcePMA, destColor, sourceAlpha;
|
||||||
|
|
||||||
BlendMode (int source, int sourcePremultipledAlpha, int dest) {
|
BlendMode (int source, int sourcePMA, int destColor, int sourceAlpha) {
|
||||||
this.source = source;
|
this.source = source;
|
||||||
this.sourcePMA = sourcePremultipledAlpha;
|
this.sourcePMA = sourcePMA;
|
||||||
this.dest = dest;
|
this.destColor = destColor;
|
||||||
|
this.sourceAlpha = sourceAlpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSource (boolean premultipliedAlpha) {
|
public void apply (Batch batch, boolean premultipliedAlpha) {
|
||||||
return premultipliedAlpha ? sourcePMA : source;
|
batch.setBlendFunctionSeparate(premultipliedAlpha ? sourcePMA : source, destColor, sourceAlpha, destColor);
|
||||||
}
|
|
||||||
|
|
||||||
public int getDest () {
|
|
||||||
return dest;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static public final BlendMode[] values = values();
|
static public final BlendMode[] values = values();
|
||||||
|
|||||||
@ -110,7 +110,7 @@ public class SkeletonRenderer {
|
|||||||
alpha = 0;
|
alpha = 0;
|
||||||
}
|
}
|
||||||
blendMode = slotBlendMode;
|
blendMode = slotBlendMode;
|
||||||
batch.setBlendFunction(blendMode.getSource(pmaBlendModes), blendMode.getDest());
|
blendMode.apply(batch, pmaBlendModes);
|
||||||
}
|
}
|
||||||
|
|
||||||
float c = NumberUtils.intToFloatColor((int)alpha << 24 //
|
float c = NumberUtils.intToFloatColor((int)alpha << 24 //
|
||||||
@ -222,7 +222,7 @@ public class SkeletonRenderer {
|
|||||||
alpha = 0;
|
alpha = 0;
|
||||||
}
|
}
|
||||||
blendMode = slotBlendMode;
|
blendMode = slotBlendMode;
|
||||||
batch.setBlendFunction(blendMode.getSource(pmaBlendModes), blendMode.getDest());
|
blendMode.apply(batch, pmaBlendModes);
|
||||||
}
|
}
|
||||||
|
|
||||||
float c = NumberUtils.intToFloatColor((int)alpha << 24 //
|
float c = NumberUtils.intToFloatColor((int)alpha << 24 //
|
||||||
@ -348,7 +348,7 @@ public class SkeletonRenderer {
|
|||||||
alpha = 0;
|
alpha = 0;
|
||||||
}
|
}
|
||||||
blendMode = slotBlendMode;
|
blendMode = slotBlendMode;
|
||||||
batch.setBlendFunction(blendMode.getSource(pmaBlendModes), blendMode.getDest());
|
blendMode.apply(batch, pmaBlendModes);
|
||||||
}
|
}
|
||||||
|
|
||||||
float red = r * color.r * multiplier;
|
float red = r * color.r * multiplier;
|
||||||
|
|||||||
@ -88,7 +88,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
|
|||||||
OldHard = 2,
|
OldHard = 2,
|
||||||
OldSoft = 3,
|
OldSoft = 3,
|
||||||
|
|
||||||
DefaultRampMode = OldHard
|
DefaultRampMode = FullRangeHard
|
||||||
};
|
};
|
||||||
|
|
||||||
MaterialProperty _mainTexture = null;
|
MaterialProperty _mainTexture = null;
|
||||||
@ -643,7 +643,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
|
|||||||
|
|
||||||
if (EditorGUI.EndChangeCheck()) {
|
if (EditorGUI.EndChangeCheck()) {
|
||||||
if (rampMode == eDiffuseRampMode.NoRampSpecified)
|
if (rampMode == eDiffuseRampMode.NoRampSpecified)
|
||||||
rampMode = eDiffuseRampMode.DefaultRampMode;
|
rampMode = eDiffuseRampMode.OldHard;
|
||||||
|
|
||||||
SetDiffuseRampMode(_materialEditor, rampMode);
|
SetDiffuseRampMode(_materialEditor, rampMode);
|
||||||
mixedRampMode = false;
|
mixedRampMode = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user