Add support for multiply and screen blend mode.

This commit is contained in:
Davide Tantillo 2025-10-29 10:04:42 +01:00
parent e4f6d229c1
commit 9af308b2df
2 changed files with 4 additions and 4 deletions

View File

@ -137,7 +137,7 @@ function toC3Filter (filter: TextureFilter): TextureSamplingMode {
export const BlendingModeSpineToC3: Record<BlendMode, BlendModeParameter> = { export const BlendingModeSpineToC3: Record<BlendMode, BlendModeParameter> = {
[BlendMode.Normal]: "normal", [BlendMode.Normal]: "normal",
[BlendMode.Additive]: "additive", [BlendMode.Additive]: "additive",
[BlendMode.Multiply]: "normal", [BlendMode.Multiply]: "multiply",
[BlendMode.Screen]: "normal", [BlendMode.Screen]: "screen",
} }

View File

@ -120,7 +120,7 @@ class MyDrawingInstance extends SDK.IWorldInstanceBase {
this.update(0); this.update(0);
let command = this.skeletonRenderer.render(this.skeleton); let command = this.skeletonRenderer.render(this.skeleton);
while (command) { while (command) {
const { numVertices, positions, uvs, colors, indices, numIndices } = command; const { numVertices, positions, uvs, colors, indices, numIndices, blendMode } = command;
const vertices = this.tempVertices; const vertices = this.tempVertices;
const c3colors = this.tempColors; const c3colors = this.tempColors;
@ -142,7 +142,7 @@ class MyDrawingInstance extends SDK.IWorldInstanceBase {
} }
iRenderer.ResetColor(); iRenderer.ResetColor();
iRenderer.SetAlphaBlend(); iRenderer.SetBlendMode(spine.BlendingModeSpineToC3[blendMode]);
iRenderer.SetTextureFillMode(); iRenderer.SetTextureFillMode();
iRenderer.SetTexture(command.texture.texture); iRenderer.SetTexture(command.texture.texture);