[ts][threejs] Fixed dark tint shader.

This commit is contained in:
Davide Tantillo 2025-02-20 15:42:54 +01:00
parent 9f819b3872
commit 219348e7f4
2 changed files with 2 additions and 2 deletions

View File

@ -309,7 +309,7 @@ const spineOnBeforeCompile = (shader: THREE.WebGLProgramParametersWithUniforms)
#ifdef USE_SPINE_DARK_TINT
#ifdef USE_COLOR_ALPHA
diffuseColor.a *= vColor.a;
diffuseColor.rgb *= (1.0 - diffuseColor.rgb) * v_dark.rgb + diffuseColor.rgb * vColor.rgb;
diffuseColor.rgb = (diffuseColor.a - diffuseColor.rgb) * v_dark.rgb + diffuseColor.rgb * vColor.rgb;
#endif
#else
#ifdef USE_COLOR_ALPHA

View File

@ -294,7 +294,7 @@ export class SkeletonMesh extends THREE.Object3D {
let darkColor = this.tempDarkColor;
if (!slot.darkColor)
darkColor.set(1, 1, 1, 0);
darkColor.set(0, 0, 0, 1);
else {
darkColor.r = slot.darkColor.r * alpha;
darkColor.g = slot.darkColor.g * alpha;