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> = {
[BlendMode.Normal]: "normal",
[BlendMode.Additive]: "additive",
[BlendMode.Multiply]: "normal",
[BlendMode.Screen]: "normal",
[BlendMode.Multiply]: "multiply",
[BlendMode.Screen]: "screen",
}

View File

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