From cd3b9816c2b3e2dbe0fcb9dad07ea37c3d95b7fd Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 22 Mar 2021 15:15:42 +0100 Subject: [PATCH 1/2] [xna] Fixed an example shader fx compile error (occurring under some setups) at a `pow()` call. --- spine-xna/example-content/SpineEffectNormalmap.fx | 1 + 1 file changed, 1 insertion(+) diff --git a/spine-xna/example-content/SpineEffectNormalmap.fx b/spine-xna/example-content/SpineEffectNormalmap.fx index ff86b8bcb..365ef76ee 100644 --- a/spine-xna/example-content/SpineEffectNormalmap.fx +++ b/spine-xna/example-content/SpineEffectNormalmap.fx @@ -47,6 +47,7 @@ void GetLightContributionBlinnPhong(inout float3 diffuseResult, inout float3 spe diffuseResult += lightDiffuse * max(0.0, dot(normal, -lightDirection)); half3 halfVector = normalize(-lightDirection + viewDirection); float nDotH = max(0, dot(normal, halfVector)); + specularExponent = max(0.00001, specularExponent); // prevent fx compiler error at pow() below specularResult += lightSpecular * pow(nDotH, specularExponent); } From fdd3a663efea73708c055e188cfe4dc93fd5e38d Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 24 Mar 2021 19:27:15 +0100 Subject: [PATCH 2/2] [unity] Fixed binary .skel.bytes file incorrectly being reported as .json (and import being aborted). Closes #1867. --- .../Asset Types/SkeletonDataCompatibility.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs index 5abf7cc10..2eb9c8c74 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs @@ -170,21 +170,13 @@ namespace Spine.Unity { string fileText = file.text; const int maxCharsToCheck = 256; int numCharsToCheck = Math.Min(fileText.Length, maxCharsToCheck); - if (fileText.IndexOf("\"skeleton\"", 0, numCharsToCheck) != -1 || - fileText.IndexOf("\"hash\"", 0, numCharsToCheck) != -1 || - fileText.IndexOf("\"spine\"", 0, numCharsToCheck) != -1) - return true; - - int jsonCharCount = 0; - const string jsonChars = "{}:\","; for (int i = 0; i < numCharsToCheck; ++i) { char c = fileText[i]; - if (jsonChars.IndexOf(c) != -1 || char.IsWhiteSpace(c)) - ++jsonCharCount; + if (char.IsWhiteSpace(c)) + continue; + return c == '{'; } - if (jsonCharCount > numCharsToCheck / 10) - return true; - return false; + return true; } public static CompatibilityProblemInfo GetCompatibilityProblemInfo (VersionInfo fileVersion) {