Ver Fonte

[unity] Changed default sRGBTexture attribute at spine atlas texture import back to true. This creates consistent and correct look in linear and gamma color space which is more important than rare mipmap problems. The potential problem of incorrectly generated mipmaps at pma textures will be reported by warning message, no longer prevented via default settings.

Harald Csaszar há 6 anos atrás
pai
commit
2a361cd46d

+ 2 - 2
spine-unity/Assets/Spine Examples/Spine Skeletons/spineboy-unity/spineboy.png.meta

@@ -34,8 +34,8 @@ TextureImporter:
   serializedVersion: 4
   mipmaps:
     mipMapMode: 0
-    enableMipMap: 1
-    sRGBTexture: 0
+    enableMipMap: 0
+    sRGBTexture: 1
     linearTexture: 0
     fadeOut: 0
     borderMipMap: 0

+ 2 - 6
spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs

@@ -286,8 +286,8 @@ namespace Spine.Unity.Editor {
 			
 			// 'sRGBTexture = true' generates incorrectly weighted mipmaps at PMA textures,
 			// causing white borders due to undesired custom weighting.
-			if (texImporter.sRGBTexture && texImporter.mipmapEnabled) {
-				Debug.LogWarningFormat("`{0}` : Incorrect Texture Settings found: When enabling `Generate Mip Maps`, it is strongly recommended to disable `sRGB (Color Texture)`. Otherwise you will receive white border artifacts on an atlas exported with default `Premultiply alpha` settings.\n(You can disable this warning in `Edit - Preferences - Spine`)", texturePath);
+			if (texImporter.sRGBTexture && texImporter.mipmapEnabled && PlayerSettings.colorSpace == ColorSpace.Gamma) {
+				Debug.LogWarningFormat("`{0}` : Problematic Texture Settings found: When enabling `Generate Mip Maps` in Gamma color space, it is recommended to disable `sRGB (Color Texture)`. Otherwise you will receive white border artifacts on an atlas exported with default `Premultiply alpha` settings.\n(You can disable this warning in `Edit - Preferences - Spine`)", texturePath);
 			}
 			if (texImporter.alphaIsTransparency) {
 				int straightAlphaValue = material.GetInt(STRAIGHT_ALPHA_PARAM_ID);
@@ -966,10 +966,6 @@ namespace Spine.Unity.Editor {
 							continue;
 						}
 
-						// Note: 'sRGBTexture = false' below might seem counter-intuitive, but prevents mipmaps from being
-						// generated incorrectly (causing white borders due to undesired custom weighting) for PMA textures
-						// when mipmaps are enabled later.
-						texImporter.sRGBTexture = false;
 						texImporter.textureCompression = TextureImporterCompression.Uncompressed;
 						texImporter.alphaSource = TextureImporterAlphaSource.FromInput;
 						texImporter.mipmapEnabled = false;