mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
Add support for multiply and screen blend mode.
This commit is contained in:
parent
e4f6d229c1
commit
9af308b2df
@ -137,7 +137,7 @@ function toC3Filter (filter: TextureFilter): TextureSamplingMode {
|
||||
export const BlendingModeSpineToC3: Record<BlendMode, BlendModeParameter> = {
|
||||
[BlendMode.Normal]: "normal",
|
||||
[BlendMode.Additive]: "additive",
|
||||
[BlendMode.Multiply]: "normal",
|
||||
[BlendMode.Screen]: "normal",
|
||||
[BlendMode.Multiply]: "multiply",
|
||||
[BlendMode.Screen]: "screen",
|
||||
}
|
||||
|
||||
|
||||
@ -120,7 +120,7 @@ class MyDrawingInstance extends SDK.IWorldInstanceBase {
|
||||
this.update(0);
|
||||
let command = this.skeletonRenderer.render(this.skeleton);
|
||||
while (command) {
|
||||
const { numVertices, positions, uvs, colors, indices, numIndices } = command;
|
||||
const { numVertices, positions, uvs, colors, indices, numIndices, blendMode } = command;
|
||||
|
||||
const vertices = this.tempVertices;
|
||||
const c3colors = this.tempColors;
|
||||
@ -142,7 +142,7 @@ class MyDrawingInstance extends SDK.IWorldInstanceBase {
|
||||
}
|
||||
|
||||
iRenderer.ResetColor();
|
||||
iRenderer.SetAlphaBlend();
|
||||
iRenderer.SetBlendMode(spine.BlendingModeSpineToC3[blendMode]);
|
||||
iRenderer.SetTextureFillMode();
|
||||
iRenderer.SetTexture(command.texture.texture);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user