[unity] Added support for blend modes at Spine Visual Element (UI Toolkit). Closes #3019. See #1943.

This commit is contained in:
Harald Csaszar 2026-01-30 12:26:45 +01:00
parent e5f7ffbb80
commit cd22906a5b
54 changed files with 4263 additions and 73 deletions

View File

@ -366,6 +366,9 @@
- Added define `SPINE_DISABLE_THREADING` to disable threaded animation and mesh generation entirely, removing the respective code. This define can be set as `Scripting Define Symbols` globally or for selective build profiles where desired.
- Added automatic load balancing (work stealing) for improved performance when using threaded animation and mesh generation, enabled by default. Load balancing can be disabled via a new Spine preferences parameter `Threading Defaults - Load Balancing` setting a build define accordingly.
Additional configuration parameters `SkeletonUpdateSystem.UpdateChunksPerThread` and `LateUpdateChunksPerThread` are available to fine-tune the chunk count for load balancing. A minimum of 8 chunks is recommended with load balancing enabled. Higher values add higher overhead with potentially detrimental effect on performance.
- Spine UI Toolkit UPM package now supports rendering back-face triangles. Enable `Flip Back Faces` to automatically fix back-face geometry in an additional pass (defaults to enabled). Disable the setting to save additional processing overhead.
- Spine UI Toolkit UPM package now supports PMA atlas textures. At the `SpineVisualElement` expand `Blend Mode Materials` and hit `Detect Materials` to automatically assign the proper PMA or straight alpha material at `Normal Material`. Unity minimum version increased to 6000.3 which added support for UI Toolkit materials.
- Spine UI Toolkit UPM package now supports all Spine blend modes via blend mode materials and multiple materials per skeleton. Enable `Multiple Materials` (enabled by default), expand `Blend Mode Materials` and hit `Detect Materials` to automatically assign the correct PMA or straight alpha blend mode materials.
- **Deprecated**

View File

@ -100,11 +100,15 @@ namespace Spine.Unity.Editor {
public static bool IsSkeletonTexturePMA (SkeletonGraphic skeletonGraphic, out bool detectionSucceeded) {
Texture texture = skeletonGraphic.mainTexture;
return IsSkeletonTexturePMA(texture, skeletonGraphic.name, out detectionSucceeded);
}
public static bool IsSkeletonTexturePMA (Texture texture, string skeletonName, out bool detectionSucceeded) {
string texturePath = AssetDatabase.GetAssetPath(texture.GetInstanceID());
TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(texturePath);
if (importer.alphaIsTransparency != importer.sRGBTexture) {
Debug.LogWarning(string.Format("Texture '{0}' at skeleton '{1}' is neither configured correctly for " +
"PMA nor Straight Alpha.", texture, skeletonGraphic), texture);
"PMA nor Straight Alpha.", texture, skeletonName), texture);
detectionSucceeded = false;
return false;
}

View File

@ -2,7 +2,7 @@
"name": "com.esotericsoftware.spine.spine-unity",
"displayName": "spine-unity Runtime",
"description": "This plugin provides the spine-unity runtime core and examples. Spine Examples can be installed via the Samples tab.",
"version": "4.3.41",
"version": "4.3.42",
"unity": "2018.3",
"author": {
"name": "Esoteric Software",

View File

@ -29,6 +29,7 @@
//#define CHANGE_BOUNDS_ON_ANIMATION_CHANGE
using System.Linq;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
@ -36,6 +37,109 @@ using UnityEngine.UIElements;
namespace Spine.Unity.Editor {
[CustomPropertyDrawer(typeof(UITKBlendModeMaterialsAttribute))]
public class UITKBlendModeMaterialsAttributeDrawer : PropertyDrawer {
protected UITKBlendModeMaterialsAttribute TargetAttribute { get { return (UITKBlendModeMaterialsAttribute)attribute; } }
public override VisualElement CreatePropertyGUI (SerializedProperty materialsProperty) {
var container = new VisualElement();
PropertyField blendModeMaterials = new PropertyField();
blendModeMaterials.BindProperty(materialsProperty);
SerializedProperty normalMaterialProperty = materialsProperty.FindPropertyRelative("normalMaterial");
SerializedProperty additiveMaterialProperty = materialsProperty.FindPropertyRelative("additiveMaterial");
SerializedProperty multiplyMaterialProperty = materialsProperty.FindPropertyRelative("multiplyMaterial");
SerializedProperty screenMaterialProperty = materialsProperty.FindPropertyRelative("screenMaterial");
PropertyField normalField = new PropertyField();
PropertyField additiveField = new PropertyField();
PropertyField multiplyField = new PropertyField();
PropertyField screenField = new PropertyField();
normalField.BindProperty(normalMaterialProperty);
additiveField.BindProperty(additiveMaterialProperty);
multiplyField.BindProperty(multiplyMaterialProperty);
screenField.BindProperty(screenMaterialProperty);
var parentPropertyPath = materialsProperty.propertyPath.Substring(0, materialsProperty.propertyPath.LastIndexOf('.'));
var parent = materialsProperty.serializedObject.FindProperty(parentPropertyPath);
SerializedProperty skeletonDataProperty = parent.FindPropertyRelative(TargetAttribute.dataField);
Button detectMaterialsButton = new Button(() => {
DetectMaterials(materialsProperty, (SkeletonDataAsset)skeletonDataProperty.objectReferenceValue);
});
detectMaterialsButton.text = "Detect Materials";
container.Add(detectMaterialsButton);
//container.Add(blendModeMaterials);
container.Add(normalField);
container.Add(additiveField);
container.Add(multiplyField);
container.Add(screenField);
container.Bind(materialsProperty.serializedObject);
return container;
}
protected void DetectMaterials (SerializedProperty materialsProperty, SkeletonDataAsset skeletonDataAsset) {
if (!skeletonDataAsset)
return;
SerializedProperty normalMaterialProperty = materialsProperty.FindPropertyRelative("normalMaterial");
SerializedProperty additiveMaterialProperty = materialsProperty.FindPropertyRelative("additiveMaterial");
SerializedProperty multiplyMaterialProperty = materialsProperty.FindPropertyRelative("multiplyMaterial");
SerializedProperty screenMaterialProperty = materialsProperty.FindPropertyRelative("screenMaterial");
bool hasPMATextures = HasPMATextures(skeletonDataAsset);
if (hasPMATextures) {
AssignMaterial(normalMaterialProperty, "Spine-UITK-Normal-PMA");
} else {
AssignMaterial(normalMaterialProperty, "Spine-UITK-Normal-Straight");
}
if (!skeletonDataAsset.blendModeMaterials.RequiresBlendModeMaterials) {
additiveMaterialProperty.objectReferenceValue = null;
multiplyMaterialProperty.objectReferenceValue = null;
screenMaterialProperty.objectReferenceValue = null;
} else {
if (hasPMATextures) {
AssignMaterial(additiveMaterialProperty, "Spine-UITK-Additive-PMA");
AssignMaterial(multiplyMaterialProperty, "Spine-UITK-Multiply-PMA");
AssignMaterial(screenMaterialProperty, "Spine-UITK-Screen-PMA");
} else {
AssignMaterial(additiveMaterialProperty, "Spine-UITK-Additive-Straight");
AssignMaterial(multiplyMaterialProperty, "Spine-UITK-Multiply-Straight");
AssignMaterial(screenMaterialProperty, "Spine-UITK-Screen-Straight");
}
}
materialsProperty.serializedObject.ApplyModifiedProperties();
}
bool HasPMATextures (SkeletonDataAsset skeletonDataAsset) {
if (skeletonDataAsset.atlasAssets.Length == 0) return false;
AtlasAssetBase firstAtlasAsset = skeletonDataAsset.atlasAssets[0];
if (firstAtlasAsset.MaterialCount == 0) return false;
Texture texture = firstAtlasAsset.Materials.First().mainTexture;
bool detectionSucceeded;
return IsSkeletonTexturePMA(texture, skeletonDataAsset.name, out detectionSucceeded);
}
void AssignMaterial (SerializedProperty property, string name) {
Material material = MaterialWithName(name);
if (material != null)
property.objectReferenceValue = material;
}
public static Material MaterialWithName (string name) {
return SkeletonGraphicUtility.MaterialWithName(name);
}
public static bool IsSkeletonTexturePMA (Texture texture, string skeletonName, out bool detectionSucceeded) {
return SkeletonGraphicUtility.IsSkeletonTexturePMA(texture, skeletonName, out detectionSucceeded);
}
}
[CustomPropertyDrawer(typeof(BoundsFromAnimationAttribute))]
public class BoundsFromAnimationAttributeDrawer : PropertyDrawer {

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 10a53051ebab05b49aefe40657f93ea6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Spine-UITK-Additive-PMA
m_Shader: {fileID: 4800000, guid: 9818276b7a7ab2148a8a3ed86c9ac555, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _StraightAlphaTexture: 0
m_Colors: []
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c65757e42907f4b45bad666a80868c27
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Spine-UITK-Additive-Straight
m_Shader: {fileID: 4800000, guid: 9818276b7a7ab2148a8a3ed86c9ac555, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _StraightAlphaTexture: 1
m_Colors: []
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 079fc4bc98abfbd43ac9f3e385474bcd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Spine-UITK-Multiply-PMA
m_Shader: {fileID: 4800000, guid: ed93aea253bcdc94a84ee09cd390c587, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _StraightAlphaTexture: 0
m_Colors: []
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a8bca9a46bcb36d4a82140b67bfd09c1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Spine-UITK-Multiply-Straight
m_Shader: {fileID: 4800000, guid: ed93aea253bcdc94a84ee09cd390c587, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _StraightAlphaTexture: 1
m_Colors: []
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6096595964896114b99904ecc8796e30
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Spine-UITK-Normal-PMA
m_Shader: {fileID: -6465566751694194690, guid: 1baeaee5c1b883a418362717b2ca2fb7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _StraightAlphaTexture: 0
m_Colors: []
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ac3524f1da29e4047a8b2b09bd7717b0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Spine-UITK-Normal-Straight
m_Shader: {fileID: -6465566751694194690, guid: 1baeaee5c1b883a418362717b2ca2fb7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _StraightAlphaTexture: 1
m_Colors: []
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1f5a60758b7c3be44b646c262eed02f0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,64 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Spine-UITK-Screen-PMA
m_Shader: {fileID: 4800000, guid: b0198c7d0f7c55c4992b84a4c94afaac, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _EnableExternalAlpha: 0
- _StraightAlphaTexture: 0
- _Straight_Alpha_Texture: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b3d3e71e32136e448a5eacadc8b9b966
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,63 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Spine-UITK-Screen-Straight
m_Shader: {fileID: 4800000, guid: b0198c7d0f7c55c4992b84a4c94afaac, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _EnableExternalAlpha: 0
- _Straight_Alpha_Texture: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fb35db9efd634bd4287a2fef3bbec26a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -28,6 +28,7 @@
*****************************************************************************/
using System;
using System.Collections.Generic;
using Unity.Collections;
using UnityEngine;
using UnityEngine.UIElements;
@ -35,6 +36,13 @@ using UIVertex = UnityEngine.UIElements.Vertex;
namespace Spine.Unity {
public class UITKBlendModeMaterialsAttribute : PropertyAttribute {
public readonly string dataField;
public UITKBlendModeMaterialsAttribute (string dataField = "skeletonDataAsset") {
this.dataField = dataField;
}
}
public class BoundsFromAnimationAttribute : PropertyAttribute {
public readonly string animationField;
@ -48,6 +56,19 @@ namespace Spine.Unity {
}
}
[UxmlObject]
[System.Serializable]
public partial class UITKBlendModeMaterials {
[UxmlAttribute]
public Material normalMaterial;
[UxmlAttribute]
public Material additiveMaterial;
[UxmlAttribute]
public Material multiplyMaterial;
[UxmlAttribute]
public Material screenMaterial;
}
[UxmlElement]
public partial class SpineVisualElement : VisualElement {
@ -58,28 +79,14 @@ namespace Spine.Unity {
if (skeletonDataAsset == value) return;
skeletonDataAsset = value;
#if UNITY_EDITOR
if (!Application.isPlaying)
if (!Application.isPlaying) {
Initialize(true);
}
#endif
}
}
public SkeletonDataAsset skeletonDataAsset;
[SpineAnimation(dataField: "SkeletonDataAsset", avoidGenericMenu: true)]
[UxmlAttribute]
public string StartingAnimation {
get { return startingAnimation; }
set {
if (startingAnimation == value) return;
startingAnimation = value;
#if UNITY_EDITOR
if (!Application.isPlaying)
Initialize(true);
#endif
}
}
public string startingAnimation = "";
[SpineSkin(dataField: "SkeletonDataAsset", defaultAsEmptyString: true, avoidGenericMenu: true)]
[UxmlAttribute]
public string InitialSkinName {
@ -95,11 +102,46 @@ namespace Spine.Unity {
}
public string initialSkinName;
[SpineAnimation(dataField: "SkeletonDataAsset", avoidGenericMenu: true)]
[UxmlAttribute]
public string StartingAnimation {
get { return startingAnimation; }
set {
if (startingAnimation == value) return;
startingAnimation = value;
#if UNITY_EDITOR
if (!Application.isPlaying)
Initialize(true);
#endif
}
}
public string startingAnimation = "";
[UxmlAttribute] public bool startingLoop { get; set; } = true;
[UxmlAttribute] public float timeScale { get; set; } = 1.0f;
[UxmlAttribute] public bool unscaledTime { get; set; }
[UxmlAttribute] public bool freeze { get; set; }
[UxmlAttribute] public bool MultipleMaterials {
get { return supportMultipleMaterials; }
set {
if (supportMultipleMaterials == value) return;
supportMultipleMaterials = value;
if (!supportMultipleMaterials) {
RemoveMultiMaterialRendererElements();
} else {
Update(0);
}
}
}
public bool supportMultipleMaterials = true;
[UxmlObjectReference("blend-mode-materials")]
[UITKBlendModeMaterials(dataField: "SkeletonDataAsset")]
public UITKBlendModeMaterials blendModeMaterials = new UITKBlendModeMaterials();
/// <summary>Flip indices of back-faces to correct winding order during mesh generation.
/// UI Elements otherwise does not draw back-faces.</summary>
[UxmlAttribute] public bool flipBackFaces { get; set; } = true;
[UxmlAttribute] public bool startingLoop { get; set; } = true;
[UxmlAttribute] public float timeScale { get; set; } = 1.0f;
[SpineAnimation(dataField: "SkeletonDataAsset", avoidGenericMenu: true)]
[UxmlAttribute]
@ -133,7 +175,8 @@ namespace Spine.Unity {
referenceMeshBounds = value;
if (!this.IsValid) return;
AdjustOffsetScaleToMeshBounds(rendererElement);
for (int i = 0, count = rendererElements.Count; i < count; ++i)
AdjustOffsetScaleToMeshBounds(rendererElements.Items[i]);
}
}
public Bounds referenceMeshBounds;
@ -144,10 +187,6 @@ namespace Spine.Unity {
return state;
}
}
[UxmlAttribute]
public bool freeze { get; set; }
[UxmlAttribute]
public bool unscaledTime { get; set; }
/// <summary>Update mode to optionally limit updates to e.g. only apply animations but not update the mesh.</summary>
public UpdateMode UpdateMode { get { return updateMode; } set { updateMode = value; } }
@ -155,10 +194,10 @@ namespace Spine.Unity {
protected AnimationState state = null;
protected Skeleton skeleton = null;
protected SkeletonRendererInstruction currentInstructions = new();// to match existing code better
protected SkeletonRendererInstruction currentInstructions = new();
protected Spine.Unity.MeshGeneratorUIElements meshGenerator = new MeshGeneratorUIElements();
protected VisualElement rendererElement;
protected ExposedList<VisualElement> rendererElements = new ExposedList<VisualElement>(1);
IVisualElementScheduledItem scheduledItem;
protected float scale = 100;
protected float offsetX, offsetY;
@ -169,8 +208,33 @@ namespace Spine.Unity {
RegisterCallback<AttachToPanelEvent>(OnAttachedCallback);
RegisterCallback<DetachFromPanelEvent>(OnDetatchedCallback);
rendererElement = new VisualElement();
rendererElement.generateVisualContent += GenerateVisualContents;
AddRendererElement();
}
protected void SetActiveRendererCount (int count) {
if (count == rendererElements.Count)
return;
else if (count > rendererElements.Count) {
int oldCount = rendererElements.Count;
int reactivateCount = Math.Min(count, rendererElements.Capacity);
for (int i = oldCount; i < reactivateCount; ++i) {
EnableRenderElement(rendererElements.Items[i]);
}
rendererElements.EnsureCapacity(count);
for (int i = reactivateCount; i < count; ++i) {
AddRendererElement();
}
} else { // new count < old count
for (int i = count, oldCount = rendererElements.Count; i < oldCount; ++i)
DisableRenderElement(rendererElements.Items[i]);
}
rendererElements.Count = count;
}
protected VisualElement AddRendererElement () {
VisualElement rendererElement = new VisualElement();
int index = rendererElements.Count;
rendererElement.generateVisualContent += (context) => GenerateVisualContents(context, index);
rendererElement.pickingMode = PickingMode.Ignore;
rendererElement.style.position = Position.Absolute;
rendererElement.style.top = 0;
@ -180,6 +244,26 @@ namespace Spine.Unity {
Add(rendererElement);
rendererElement.RegisterCallback<GeometryChangedEvent>(OnGeometryChanged);
rendererElements.Add(rendererElement);
return rendererElement;
}
protected void EnableRenderElement (VisualElement rendererElement) {
rendererElement.enabledSelf = true;
rendererElement.RegisterCallback<GeometryChangedEvent>(OnGeometryChanged);
}
protected void DisableRenderElement (VisualElement rendererElement) {
rendererElement.enabledSelf = false;
rendererElement.UnregisterCallback<GeometryChangedEvent>(OnGeometryChanged);
}
protected void RemoveMultiMaterialRendererElements () {
for (int i = rendererElements.Capacity - 1; i > 0; --i) {
rendererElements.Items[i].RemoveFromHierarchy();
}
rendererElements.Count = 1;
rendererElements.TrimExcess();
}
void OnGeometryChanged (GeometryChangedEvent evt) {
@ -187,7 +271,8 @@ namespace Spine.Unity {
if (referenceMeshBounds.size.x == 0 || referenceMeshBounds.size.y == 0) {
AdjustReferenceMeshBounds();
}
AdjustOffsetScaleToMeshBounds(rendererElement);
for (int i = 0, count = rendererElements.Count; i < count; ++i)
AdjustOffsetScaleToMeshBounds(rendererElements.Items[i]);
}
void OnAttachedCallback (AttachToPanelEvent evt) {
@ -212,7 +297,7 @@ namespace Spine.Unity {
#endif
if (freeze) return;
Update(unscaledTime ? Time.unscaledDeltaTime : Time.deltaTime);
rendererElement.MarkDirtyRepaint();
MarkAllDirtyAndRepaint();
}
public virtual void Update (float deltaTime) {
@ -225,6 +310,7 @@ namespace Spine.Unity {
if (updateMode == UpdateMode.OnlyAnimationStatus)
return;
ApplyAnimation();
PrepareInstructionsAndRenderers();
}
protected void UpdateAnimationStatus (float deltaTime) {
@ -234,7 +320,6 @@ namespace Spine.Unity {
}
protected void ApplyAnimation () {
if (updateMode != UpdateMode.OnlyEventTimelines)
state.Apply(skeleton);
else
@ -264,8 +349,16 @@ namespace Spine.Unity {
};
// Set the initial Skin and Animation
if (!string.IsNullOrEmpty(initialSkinName))
if (!string.IsNullOrEmpty(initialSkinName)) {
#if UNITY_EDITOR
if (!Application.isPlaying) {
if (skeletonData.FindSkin(initialSkinName) == null) {
initialSkinName = "default";
}
}
#endif
skeleton.SetSkin(initialSkinName);
}
string displayedAnimation = Application.isPlaying ? startingAnimation : boundsAnimation;
if (!string.IsNullOrEmpty(displayedAnimation)) {
@ -276,7 +369,8 @@ namespace Spine.Unity {
}
if (referenceMeshBounds.size.x == 0 || referenceMeshBounds.size.y == 0) {
AdjustReferenceMeshBounds();
AdjustOffsetScaleToMeshBounds(rendererElement);
for (int i = 0, count = rendererElements.Count; i < count; ++i)
AdjustOffsetScaleToMeshBounds(rendererElements.Items[i]);
}
if (scheduledItem == null)
@ -285,7 +379,14 @@ namespace Spine.Unity {
if (!Application.isPlaying)
Update(0.0f);
rendererElement.MarkDirtyRepaint();
MarkAllDirtyAndRepaint();
}
protected void MarkAllDirtyAndRepaint () {
for (int i = 0, count = rendererElements.Count; i < count; ++i) {
var rendererElement = rendererElements.Items[i];
if (rendererElement != null) rendererElement.MarkDirtyRepaint();
}
}
protected void UpdateAnimation () {
@ -301,11 +402,33 @@ namespace Spine.Unity {
}
if (referenceMeshBounds.size.x == 0 || referenceMeshBounds.size.y == 0) {
AdjustReferenceMeshBounds();
AdjustOffsetScaleToMeshBounds(rendererElement);
for (int i = 0, count = rendererElements.Count; i < count; ++i)
AdjustOffsetScaleToMeshBounds(rendererElements.Items[i]);
}
Update(0.0f);
MarkAllDirtyAndRepaint();
}
rendererElement.MarkDirtyRepaint();
protected void PrepareInstructionsAndRenderers () {
MeshGeneratorUIElements.GenerateSkeletonRendererInstruction(currentInstructions, skeleton, null,
null, false, false);
int submeshCount = currentInstructions.submeshInstructions.Count;
PrepareUISubmeshCount(submeshCount);
if (supportMultipleMaterials) {
SetActiveRendererCount(submeshCount);
if (supportMultipleMaterials) {
for (int i = 0, count = rendererElements.Count; i < count; ++i) {
AssignBlendModeMaterial(i, currentInstructions.submeshInstructions.Items[i].material);
}
}
} else if (rendererElements.Count > 0) {
if (blendModeMaterials != null && blendModeMaterials.normalMaterial)
rendererElements.Items[0].style.unityMaterial = blendModeMaterials.normalMaterial;
else
rendererElements.Items[0].style.unityMaterial = null;
}
}
protected class UISubmesh {
@ -317,25 +440,20 @@ namespace Spine.Unity {
}
protected readonly ExposedList<UISubmesh> uiSubmeshes = new ExposedList<UISubmesh>();
protected void GenerateVisualContents (MeshGenerationContext context) {
protected void GenerateVisualContents (MeshGenerationContext context, int rendererElementIndex) {
if (!this.IsValid) return;
if (!context.visualElement.enabledInHierarchy) return;
MeshGeneratorUIElements.GenerateSkeletonRendererInstruction(currentInstructions, skeleton, null,
null,
false,
false);
int submeshesPerRenderer = supportMultipleMaterials ? 1 : currentInstructions.submeshInstructions.Count;
int submeshOffset = rendererElementIndex;
int submeshCount = currentInstructions.submeshInstructions.Count;
PrepareUISubmeshCount(submeshCount);
// Generate meshes.
for (int i = 0; i < submeshCount; i++) {
meshGenerator.settings.pmaVertexColors = false;
for (int i = submeshOffset; i < submeshOffset + submeshesPerRenderer; i++) {
var submeshInstructionItem = currentInstructions.submeshInstructions.Items[i];
UISubmesh uiSubmesh = uiSubmeshes.Items[i];
meshGenerator.Begin();
meshGenerator.AddSubmesh(submeshInstructionItem);
// clipping is done, vertex counts are final.
PrepareUISubmesh(uiSubmesh, meshGenerator.VertexCount, meshGenerator.SubmeshIndexCount(0));
if (flipBackFaces)
@ -344,13 +462,36 @@ namespace Spine.Unity {
meshGenerator.FillTrianglesSingleSubmesh(ref uiSubmesh.indicesSlice);
var submeshMaterial = submeshInstructionItem.material;
Texture usedTexture = submeshMaterial.mainTexture;
FillContext(context, uiSubmesh, usedTexture);
}
}
protected void AssignBlendModeMaterial (int rendererElementIndex, Material originalSubmeshMaterial) {
if (skeletonDataAsset == null) return;
VisualElement rendererElement = rendererElements.Items[rendererElementIndex];
if (blendModeMaterials == null) {
rendererElement.style.unityMaterial = null;
return;
}
BlendModeMaterials requiredBlendModeMaterials = skeletonDataAsset.blendModeMaterials;
if (!requiredBlendModeMaterials.RequiresBlendModeMaterials) {
rendererElement.style.unityMaterial = blendModeMaterials.normalMaterial;
return;
}
Material material = null;
BlendMode blendMode = requiredBlendModeMaterials.BlendModeForMaterial(originalSubmeshMaterial);
if (blendMode == BlendMode.Normal)
material = blendModeMaterials.normalMaterial;
else if (blendMode == BlendMode.Additive)
material = blendModeMaterials.additiveMaterial;
else if (blendMode == BlendMode.Multiply)
material = blendModeMaterials.multiplyMaterial;
else if (blendMode == BlendMode.Screen)
material = blendModeMaterials.screenMaterial;
rendererElement.style.unityMaterial = material;
}
protected void PrepareUISubmeshCount (int targetCount) {
int oldCount = uiSubmeshes.Count;
uiSubmeshes.EnsureCapacity(targetCount);
@ -427,6 +568,7 @@ namespace Spine.Unity {
}
void AdjustOffsetScaleToMeshBounds (VisualElement visualElement) {
if (visualElement == null) return;
Rect targetRect = visualElement.layout;
if (float.IsNaN(targetRect.width)) return;

View File

@ -12,10 +12,12 @@ MonoBehaviour:
m_Script: {fileID: 19101, guid: 0000000000000000e000000000000000, type: 0}
m_Name: PaneSettings
m_EditorClassIdentifier:
themeUss: {fileID: -4733365628477956816, guid: 6fd02a62ce112e547aa19d3af6f42b02, type: 3}
themeUss: {fileID: -4733365628477956816, guid: 979e15cdd57e0ce42b2b97c7a4361084, type: 3}
m_DisableNoThemeWarning: 0
m_TargetTexture: {fileID: 0}
m_RenderMode: 0
m_WorldSpaceLayer: 0
m_ColliderUpdateMode: 0
m_ColliderIsTrigger: 1
m_ScaleMode: 1
m_ReferenceSpritePixelsPerUnit: 100
m_PixelsPerUnit: 100
@ -32,12 +34,19 @@ MonoBehaviour:
m_ClearColor: 0
m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0}
m_VertexBudget: 0
m_TextureSlotCount: 8
m_DynamicAtlasSettings:
m_MinAtlasSize: 64
m_MaxAtlasSize: 4096
m_MaxSubTextureSize: 64
m_ActiveFilters: -1
m_AtlasBlitShader: {fileID: 9101, guid: 0000000000000000f000000000000000, type: 0}
m_RuntimeShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0}
m_RuntimeWorldShader: {fileID: 9102, guid: 0000000000000000f000000000000000, type: 0}
m_DefaultShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0}
m_RuntimeGaussianBlurShader: {fileID: 20300, guid: 0000000000000000f000000000000000, type: 0}
m_RuntimeColorEffectShader: {fileID: 20301, guid: 0000000000000000f000000000000000, type: 0}
m_SDFShader: {fileID: 19011, guid: 0000000000000000f000000000000000, type: 0}
m_BitmapShader: {fileID: 9001, guid: 0000000000000000f000000000000000, type: 0}
m_SpriteShader: {fileID: 19012, guid: 0000000000000000f000000000000000, type: 0}
m_ICUDataAsset: {fileID: 0}
forceGammaRendering: 0
textSettings: {fileID: 0}

View File

@ -121,7 +121,7 @@ TextureImporter:
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
@ -166,7 +166,7 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
@ -181,7 +181,7 @@ TextureImporter:
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
@ -193,8 +193,8 @@ TextureImporter:
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
@ -206,11 +206,12 @@ TextureImporter:
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
@ -220,6 +221,8 @@ TextureImporter:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0

View File

@ -12,6 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a6b194f808b1af6499c93410e504af42, type: 3}
m_Name: raptor_Atlas
m_EditorClassIdentifier:
serializedMaterialOverrides: []
textureLoadingMode: 0
onDemandTextureLoader: {fileID: 0}
atlasFile: {fileID: 4900000, guid: 93456ae5f468800499b80d92a05282f3, type: 3}

View File

@ -11,7 +11,8 @@ Material:
m_Shader: {fileID: 4800000, guid: 1e8a610c9e01c3648bac42585e5fc676, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_ValidKeywords:
- _STRAIGHT_ALPHA_INPUT
m_InvalidKeywords:
- _USE8NEIGHBOURHOOD_ON
m_LightmapFlags: 4
@ -31,6 +32,7 @@ Material:
m_Ints: []
m_Floats:
- _Cutoff: 0.1
- _Fill: 0
- _OutlineMipLevel: 0
- _OutlineOpaqueAlpha: 1
- _OutlineReferenceTexWidth: 1024
@ -38,7 +40,7 @@ Material:
- _OutlineWidth: 3
- _StencilComp: 8
- _StencilRef: 1
- _StraightAlphaInput: 0
- _StraightAlphaInput: 1
- _ThresholdEnd: 0.25
- _Use8Neighbourhood: 1
- _UseScreenSpaceOutlineWidth: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 37b659b9642ed194497999a637a62c17
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,5 @@
whirlyblendmodes.png
size: 512, 512
filter: Linear, Linear
whirly
bounds: 2, 2, 256, 256

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d4fe1661c50e86b4a951b11855a4f44f
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,74 @@
{
"skeleton": {
"hash": "acq/cF9RZNM",
"spine": "4.3.39-beta",
"x": -252.71397,
"y": -232.55397,
"width": 456.70795,
"height": 360.68793,
"images": "./images/",
"audio": null
},
"bones": [
{ "name": "root" },
{ "name": "_rotation", "parent": "root", "color": "abe323ff" },
{ "name": "additive", "parent": "root", "x": -37.18, "y": -104.42 },
{ "name": "multiply", "parent": "root", "x": 75.86 },
{ "name": "normal", "parent": "root" },
{ "name": "screen", "parent": "root", "x": -124.58 }
],
"slots": [
{ "name": "normal", "bone": "normal", "color": "ff9100ff", "attachment": "whirly" },
{ "name": "multiply", "bone": "multiply", "color": "905e9eff", "attachment": "whirly", "blend": "multiply" },
{ "name": "screen", "bone": "screen", "color": "0670c6ff", "attachment": "whirly", "blend": "screen" },
{ "name": "additive", "bone": "additive", "color": "0670c6ff", "attachment": "whirly", "blend": "additive" }
],
"constraints": [
{
"type": "transform",
"name": "rotation",
"source": "_rotation",
"bones": [ "additive", "multiply", "normal", "screen" ],
"properties": {
"rotate": {
"to": {
"rotate": { "max": 100 }
}
}
}
}
],
"skins": [
{
"name": "default",
"attachments": {
"additive": {
"whirly": { "rotation": -0.06, "width": 256, "height": 256 }
},
"multiply": {
"whirly": { "rotation": -0.06, "width": 256, "height": 256 }
},
"normal": {
"whirly": { "rotation": -0.06, "width": 256, "height": 256 }
},
"screen": {
"whirly": { "rotation": -0.06, "width": 256, "height": 256 }
}
}
}
],
"animations": {
"animation": {
"bones": {
"_rotation": {
"rotate": [
{},
{ "time": 0.33333334, "value": -120 },
{ "time": 0.6666667, "value": -240 },
{ "time": 1, "value": -360 }
]
}
}
}
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9e190d520b56f3c4d823981b48c3e131
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,117 @@
fileFormatVersion: 2
guid: 56f5f2fbc1025d64f8ac75874c48b4e1
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a6b194f808b1af6499c93410e504af42, type: 3}
m_Name: whirlyblendmodes_Atlas
m_EditorClassIdentifier: spine-unity::Spine.Unity.SpineAtlasAsset
serializedMaterialOverrides: []
textureLoadingMode: 0
onDemandTextureLoader: {fileID: 0}
atlasFile: {fileID: 4900000, guid: d4fe1661c50e86b4a951b11855a4f44f, type: 3}
materials:
- {fileID: 2100000, guid: 17b5573ded7e02d49a155f13d7e8a6a6, type: 2}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8c363a61a0bc21d43b6a0ebef815e9dc
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,57 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: whirlyblendmodes_Material-Multiply
m_Shader: {fileID: 4800000, guid: 8bdcdc7ee298e594a9c20c61d25c33b6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _STRAIGHT_ALPHA_INPUT
m_InvalidKeywords:
- _USE8NEIGHBOURHOOD_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- <noninit>:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 56f5f2fbc1025d64f8ac75874c48b4e1, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- <noninit>: 0
- _Cutoff: 0.1
- _Fill: 0
- _OutlineMipLevel: 0
- _OutlineOpaqueAlpha: 1
- _OutlineReferenceTexWidth: 1024
- _OutlineSmoothness: 1
- _OutlineWidth: 3
- _StencilComp: 8
- _StencilRef: 1
- _StraightAlphaInput: 1
- _ThresholdEnd: 0.25
- _Use8Neighbourhood: 1
- _UseScreenSpaceOutlineWidth: 0
m_Colors:
- <noninit>: {r: 0, g: 2.018574, b: 1e-45, a: 0.000007110106}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _OutlineColor: {r: 1, g: 1, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c3ebf8286d77e014ab400e79cbe037b9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,57 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: whirlyblendmodes_Material-Screen
m_Shader: {fileID: 4800000, guid: 4e8caa36c07aacf4ab270da00784e4d9, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _STRAIGHT_ALPHA_INPUT
m_InvalidKeywords:
- _USE8NEIGHBOURHOOD_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- <noninit>:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 56f5f2fbc1025d64f8ac75874c48b4e1, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- <noninit>: 0
- _Cutoff: 0.1
- _Fill: 0
- _OutlineMipLevel: 0
- _OutlineOpaqueAlpha: 1
- _OutlineReferenceTexWidth: 1024
- _OutlineSmoothness: 1
- _OutlineWidth: 3
- _StencilComp: 8
- _StencilRef: 1
- _StraightAlphaInput: 1
- _ThresholdEnd: 0.25
- _Use8Neighbourhood: 1
- _UseScreenSpaceOutlineWidth: 0
m_Colors:
- <noninit>: {r: 0, g: 2.018574, b: 1e-45, a: 0.000007121922}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _OutlineColor: {r: 1, g: 1, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2b67e1dec82fb464c87254223445e12a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,50 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: whirlyblendmodes_Material
m_Shader: {fileID: 4800000, guid: 1e8a610c9e01c3648bac42585e5fc676, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _STRAIGHT_ALPHA_INPUT
m_InvalidKeywords:
- _USE8NEIGHBOURHOOD_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 56f5f2fbc1025d64f8ac75874c48b4e1, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Cutoff: 0.1
- _Fill: 0
- _OutlineMipLevel: 0
- _OutlineOpaqueAlpha: 1
- _OutlineReferenceTexWidth: 1024
- _OutlineSmoothness: 1
- _OutlineWidth: 3
- _StencilComp: 8
- _StencilRef: 1
- _StraightAlphaInput: 1
- _ThresholdEnd: 0.25
- _Use8Neighbourhood: 1
- _UseScreenSpaceOutlineWidth: 0
m_Colors:
- _OutlineColor: {r: 1, g: 1, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 17b5573ded7e02d49a155f13d7e8a6a6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f1b3b4b945939a54ea0b23d3396115fb, type: 3}
m_Name: whirlyblendmodes_SkeletonData
m_EditorClassIdentifier: spine-unity::Spine.Unity.SkeletonDataAsset
atlasAssets:
- {fileID: 11400000, guid: 8c363a61a0bc21d43b6a0ebef815e9dc, type: 2}
scale: 0.01
skeletonJSON: {fileID: 4900000, guid: 9e190d520b56f3c4d823981b48c3e131, type: 3}
isUpgradingBlendModeMaterials: 0
blendModeMaterials:
requiresBlendModeMaterials: 1
applyAdditiveMaterial: 0
additiveMaterials: []
multiplyMaterials:
- pageName: whirlyblendmodes.png
material: {fileID: 2100000, guid: c3ebf8286d77e014ab400e79cbe037b9, type: 2}
screenMaterials:
- pageName: whirlyblendmodes.png
material: {fileID: 2100000, guid: 2b67e1dec82fb464c87254223445e12a, type: 2}
skeletonDataModifiers: []
fromAnimation: []
toAnimation: []
duration: []
defaultMix: 0.2
controller: {fileID: 0}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ad972744e16a88445ac76c691dbfc937
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,11 +1,28 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
<ui:VisualElement style="flex-direction: row; flex-wrap: wrap; height: 100%; width: 100%;">
<ui:Label text="Spine Visual Element&#10;for UI Toolkit" name="Label" enable-rich-text="false" style="width: 100%; height: 30%; font-size: 60%; -unity-font-style: normal; color: rgb(255, 255, 255); text-overflow: clip; flex-direction: column; -unity-text-align: middle-center;" />
<ui:Label text="Spine Visual Element
for UI Toolkit" name="Label" enable-rich-text="false" style="width: 100%; height: 30%; font-size: 60%; -unity-font-style: normal; color: rgb(255, 255, 255); text-overflow: clip; flex-direction: column; -unity-text-align: middle-center;"/>
<ui:VisualElement name="SpineSkeletons" style="flex-grow: 1; width: 100%; height: 70%; flex-direction: row; align-items: center; justify-content: center;">
<Spine.Unity.SpineVisualElement starting-animation="roar" initial-flip-y="true" skeleton-data-asset="project://database/Assets/SpineUITK/Sample/Spine%20Skeletons/Raptor/raptor-pro_SkeletonData.asset?fileID=11400000&amp;guid=d46d232b9d6644c499754d07fb6e9f08&amp;type=2#raptor-pro_SkeletonData" name="SpineVisualElement" adjust-to-bounds="false" initial-skin-name="default" style="height: 400px; width: 400px; --skeleton-asset: url(&quot;project://database/Packages/com.esotericsoftware.spine.spine-unity-examples/Spine%20Skeletons/spineboy-pro/spineboy-pro_SkeletonData.asset?fileID=11400000&amp;guid=af38a3de26ed9b84abc2fe7c7f3b209d&amp;type=2#spineboy-pro_SkeletonData&quot;); align-items: flex-end; align-self: stretch;" />
<Spine.Unity.SpineVisualElement starting-animation="walk" initial-flip-y="true" skeleton-data-asset="project://database/Assets/SpineUITK/Sample/Spine%20Skeletons/Raptor/raptor-pro_SkeletonData.asset?fileID=11400000&amp;guid=d46d232b9d6644c499754d07fb6e9f08&amp;type=2#raptor-pro_SkeletonData" name="SpineVisualElement" adjust-to-bounds="false" initial-skin-name="default" style="height: 400px; width: 400px; --skeleton-asset: url(&quot;project://database/Packages/com.esotericsoftware.spine.spine-unity-examples/Spine%20Skeletons/spineboy-pro/spineboy-pro_SkeletonData.asset?fileID=11400000&amp;guid=af38a3de26ed9b84abc2fe7c7f3b209d&amp;type=2#spineboy-pro_SkeletonData&quot;); align-self: stretch;" />
<Spine.Unity.SpineVisualElement starting-animation="gun-grab" initial-flip-y="true" skeleton-data-asset="project://database/Assets/SpineUITK/Sample/Spine%20Skeletons/Raptor/raptor-pro_SkeletonData.asset?fileID=11400000&amp;guid=d46d232b9d6644c499754d07fb6e9f08&amp;type=2#raptor-pro_SkeletonData" name="SpineVisualElement" adjust-to-bounds="false" initial-skin-name="default" style="height: 400px; width: 400px; --skeleton-asset: url(&quot;project://database/Packages/com.esotericsoftware.spine.spine-unity-examples/Spine%20Skeletons/spineboy-pro/spineboy-pro_SkeletonData.asset?fileID=11400000&amp;guid=af38a3de26ed9b84abc2fe7c7f3b209d&amp;type=2#spineboy-pro_SkeletonData&quot;); align-self: stretch;" />
<Spine.Unity.SpineVisualElement starting-animation="jump" initial-flip-y="true" skeleton-data-asset="project://database/Assets/SpineUITK/Sample/Spine%20Skeletons/Raptor/raptor-pro_SkeletonData.asset?fileID=11400000&amp;guid=d46d232b9d6644c499754d07fb6e9f08&amp;type=2#raptor-pro_SkeletonData" name="SpineVisualElement" adjust-to-bounds="false" initial-skin-name="default" style="height: 400px; width: 400px; --skeleton-asset: url(&quot;project://database/Packages/com.esotericsoftware.spine.spine-unity-examples/Spine%20Skeletons/spineboy-pro/spineboy-pro_SkeletonData.asset?fileID=11400000&amp;guid=af38a3de26ed9b84abc2fe7c7f3b209d&amp;type=2#spineboy-pro_SkeletonData&quot;); align-self: stretch;" />
<Spine.Unity.SpineVisualElement starting-animation="roar" initial-flip-y="true" skeleton-data-asset="project://database/Assets/Samples/Spine%20UI%20Toolkit%20[Experimental]/4.3.0-preview.5/Examples/Spine%20Skeletons/Raptor/raptor-pro_SkeletonData.asset?fileID=11400000&amp;guid=d46d232b9d6644c499754d07fb6e9f08&amp;type=2#raptor-pro_SkeletonData" name="SpineVisualElement" adjust-to-bounds="false" initial-skin-name="default" multiple-materials="false" style="height: 400px; width: 400px; --skeleton-asset: url(&quot;project://database/Assets/Samples/spine-unity%20Runtime/4.3.39/Spine%20Examples/Spine%20Skeletons/spineboy-pro/spineboy-pro_SkeletonData.asset?fileID=11400000&amp;guid=af38a3de26ed9b84abc2fe7c7f3b209d&amp;type=2#spineboy-pro_SkeletonData&quot;); align-items: flex-end; align-self: stretch;">
<blend-mode-materials>
<Spine.Unity.UITKBlendModeMaterials normal-material="project://database/Packages/com.esotericsoftware.spine.ui-toolkit/Materials/Spine-UITK-Normal-Straight.mat?fileID=2100000&amp;guid=1f5a60758b7c3be44b646c262eed02f0&amp;type=2#Spine-UITK-Normal-Straight"/>
</blend-mode-materials>
</Spine.Unity.SpineVisualElement>
<Spine.Unity.SpineVisualElement starting-animation="walk" initial-flip-y="true" skeleton-data-asset="project://database/Assets/Samples/Spine%20UI%20Toolkit%20[Experimental]/4.3.0-preview.5/Examples/Spine%20Skeletons/Raptor/raptor-pro_SkeletonData.asset?fileID=11400000&amp;guid=d46d232b9d6644c499754d07fb6e9f08&amp;type=2#raptor-pro_SkeletonData" name="SpineVisualElement" adjust-to-bounds="false" initial-skin-name="default" multiple-materials="false" style="height: 400px; width: 400px; --skeleton-asset: url(&quot;project://database/Assets/Samples/spine-unity%20Runtime/4.3.39/Spine%20Examples/Spine%20Skeletons/spineboy-pro/spineboy-pro_SkeletonData.asset?fileID=11400000&amp;guid=af38a3de26ed9b84abc2fe7c7f3b209d&amp;type=2#spineboy-pro_SkeletonData&quot;); align-self: stretch;">
<blend-mode-materials>
<Spine.Unity.UITKBlendModeMaterials normal-material="project://database/Packages/com.esotericsoftware.spine.ui-toolkit/Materials/Spine-UITK-Normal-Straight.mat?fileID=2100000&amp;guid=1f5a60758b7c3be44b646c262eed02f0&amp;type=2#Spine-UITK-Normal-Straight"/>
</blend-mode-materials>
</Spine.Unity.SpineVisualElement>
<Spine.Unity.SpineVisualElement starting-animation="gun-grab" initial-flip-y="true" skeleton-data-asset="project://database/Assets/Samples/Spine%20UI%20Toolkit%20[Experimental]/4.3.0-preview.5/Examples/Spine%20Skeletons/Raptor/raptor-pro_SkeletonData.asset?fileID=11400000&amp;guid=d46d232b9d6644c499754d07fb6e9f08&amp;type=2#raptor-pro_SkeletonData" name="SpineVisualElement" adjust-to-bounds="false" initial-skin-name="default" multiple-materials="false" style="height: 400px; width: 400px; --skeleton-asset: url(&quot;project://database/Assets/Samples/spine-unity%20Runtime/4.3.39/Spine%20Examples/Spine%20Skeletons/spineboy-pro/spineboy-pro_SkeletonData.asset?fileID=11400000&amp;guid=af38a3de26ed9b84abc2fe7c7f3b209d&amp;type=2#spineboy-pro_SkeletonData&quot;); align-self: stretch;">
<blend-mode-materials>
<Spine.Unity.UITKBlendModeMaterials normal-material="project://database/Packages/com.esotericsoftware.spine.ui-toolkit/Materials/Spine-UITK-Normal-Straight.mat?fileID=2100000&amp;guid=1f5a60758b7c3be44b646c262eed02f0&amp;type=2#Spine-UITK-Normal-Straight"/>
</blend-mode-materials>
</Spine.Unity.SpineVisualElement>
<Spine.Unity.SpineVisualElement starting-animation="animation" initial-flip-y="true" skeleton-data-asset="project://database/Assets/Samples/Spine%20UI%20Toolkit%20[Experimental]/4.3.0-preview.5/Examples/Spine%20Skeletons/whirlyblendmodes/whirlyblendmodes_SkeletonData.asset?fileID=11400000&amp;guid=ad972744e16a88445ac76c691dbfc937&amp;type=2#whirlyblendmodes_SkeletonData" name="SpineVisualElement" adjust-to-bounds="false" initial-skin-name="" reference-bounds="-0.2435999,0.5221,0,4.56708,3.606879,0" style="height: 400px; width: 400px; --skeleton-asset: url(&quot;project://database/Assets/Samples/spine-unity%20Runtime/4.3.39/Spine%20Examples/Spine%20Skeletons/spineboy-pro/spineboy-pro_SkeletonData.asset?fileID=11400000&amp;guid=af38a3de26ed9b84abc2fe7c7f3b209d&amp;type=2#spineboy-pro_SkeletonData&quot;); align-self: stretch;">
<blend-mode-materials>
<Spine.Unity.UITKBlendModeMaterials normal-material="project://database/Packages/com.esotericsoftware.spine.ui-toolkit/Materials/Spine-UITK-Normal-Straight.mat?fileID=2100000&amp;guid=1f5a60758b7c3be44b646c262eed02f0&amp;type=2#Spine-UITK-Normal-Straight" additive-material="project://database/Packages/com.esotericsoftware.spine.ui-toolkit/Materials/Spine-UITK-Additive-Straight.mat?fileID=2100000&amp;guid=079fc4bc98abfbd43ac9f3e385474bcd&amp;type=2#Spine-UITK-Additive-Straight" multiply-material="project://database/Packages/com.esotericsoftware.spine.ui-toolkit/Materials/Spine-UITK-Multiply-Straight.mat?fileID=2100000&amp;guid=6096595964896114b99904ecc8796e30&amp;type=2#Spine-UITK-Multiply-Straight" screen-material="project://database/Packages/com.esotericsoftware.spine.ui-toolkit/Materials/Spine-UITK-Screen-Straight.mat?fileID=2100000&amp;guid=fb35db9efd634bd4287a2fef3bbec26a&amp;type=2#Spine-UITK-Screen-Straight"/>
</blend-mode-materials>
</Spine.Unity.SpineVisualElement>
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a0478fd21e9daa047b9426b503d9098f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,439 @@
Shader "Spine/UITK/Additive"
{
Properties
{
[ToggleUI]_StraightAlphaTexture("Straight Alpha Texture", Float) = 1
[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
}
SubShader
{
Tags
{
"RenderPipeline"="UniversalPipeline"
"RenderType"="Transparent"
"Queue"="Transparent"
// DisableBatching: <None>
"ShaderGraphShader"="true"
"ShaderGraphTargetId"=""
"IgnoreProjector"="True"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Pass
{
Name "Default"
Tags
{
// LightMode: <None>
}
// Render State
Cull Off
Blend One One
ZWrite Off
// Debug
// <None>
// --------------------------------------------------
// Pass
HLSLPROGRAM
// Pragmas
#pragma target 3.5
#pragma vertex uie_custom_vert
#pragma fragment uie_custom_frag
// Keywords
#pragma multi_compile_local _ _UIE_FORCE_GAMMA
#pragma multi_compile_local _ _UIE_TEXTURE_SLOT_COUNT_4 _UIE_TEXTURE_SLOT_COUNT_2 _UIE_TEXTURE_SLOT_COUNT_1
#pragma multi_compile_local _ _UIE_RENDER_TYPE_SOLID _UIE_RENDER_TYPE_TEXTURE _UIE_RENDER_TYPE_TEXT _UIE_RENDER_TYPE_GRADIENT
// GraphKeywords: <None>
#define UITK_SHADERGRAPH
// Defines
#define _SURFACE_TYPE_TRANSPARENT 1
#define _ALPHAPREMULTIPLY_ON 1
#define ATTRIBUTES_NEED_TEXCOORD0
#define ATTRIBUTES_NEED_TEXCOORD1
#define ATTRIBUTES_NEED_TEXCOORD2
#define ATTRIBUTES_NEED_TEXCOORD3
#define ATTRIBUTES_NEED_COLOR
#define VARYINGS_NEED_TEXCOORD0
#define VARYINGS_NEED_TEXCOORD1
#define VARYINGS_NEED_TEXCOORD3
#define VARYINGS_NEED_COLOR
#define FEATURES_GRAPH_VERTEX
#define REQUIRE_DEPTH_TEXTURE
#define REQUIRE_NORMAL_TEXTURE
#define SHADERPASS SHADERPASS_CUSTOM_UI
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShim.hlsl"
// --------------------------------------------------
// Structs and Packing
struct Attributes
{
float3 positionOS : POSITION;
float4 color : COLOR;
float4 uv0 : TEXCOORD0;
float4 uv1 : TEXCOORD1;
float4 uv2 : TEXCOORD2;
float4 uv3 : TEXCOORD3;
float4 uv4 : TEXCOORD4;
float4 uv5 : TEXCOORD5;
float4 uv6 : TEXCOORD6;
float4 uv7 : TEXCOORD7;
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
uint instanceID : INSTANCEID_SEMANTIC;
#endif
};
struct SurfaceDescriptionInputs
{
float4 color;
float4 typeTexSettings;
float2 textCoreLoc;
float4 circle;
float4 uvClip;
float2 layoutUV;
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float4 texCoord0;
float4 texCoord1;
float4 texCoord3;
float4 texCoord4;
float4 color;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
uint instanceID : CUSTOM_INSTANCE_ID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
#endif
};
struct VertexDescriptionInputs
{
float4 vertexPosition;
float4 vertexColor;
float4 uv;
float4 xformClipPages;
float4 ids;
float4 flags;
float4 opacityColorPages;
float4 settingIndex;
float4 circle;
};
struct PackedVaryings
{
float4 positionCS : SV_POSITION;
float4 texCoord0 : INTERP0;
float4 texCoord1 : INTERP1;
float4 texCoord3 : INTERP2;
float4 texCoord4 : INTERP3;
float4 color : INTERP4;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
uint instanceID : CUSTOM_INSTANCE_ID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
#endif
};
PackedVaryings PackVaryings (Varyings input)
{
PackedVaryings output;
ZERO_INITIALIZE(PackedVaryings, output);
output.positionCS = input.positionCS;
output.texCoord0.xyzw = input.texCoord0;
output.texCoord1.xyzw = input.texCoord1;
output.texCoord3.xyzw = input.texCoord3;
output.texCoord4.xyzw = input.texCoord4;
output.color.xyzw = input.color;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
output.instanceID = input.instanceID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
#endif
return output;
}
Varyings UnpackVaryings (PackedVaryings input)
{
Varyings output;
output.positionCS = input.positionCS;
output.texCoord0 = input.texCoord0.xyzw;
output.texCoord1 = input.texCoord1.xyzw;
output.texCoord3 = input.texCoord3.xyzw;
output.texCoord4 = input.texCoord4.xyzw;
output.color = input.color.xyzw;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
output.instanceID = input.instanceID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
#endif
return output;
}
// -- Property used by ScenePickingPass
#ifdef SCENEPICKINGPASS
float4 _SelectionID;
#endif
// -- Properties used by SceneSelectionPass
#ifdef SCENESELECTIONPASS
int _ObjectId;
int _PassValue;
#endif
//UGUI has no keyword for when a renderer has "bloom", so its nessecary to hardcore it here, like all the base UI shaders.
half4 _TextureSampleAdd;
// --------------------------------------------------
// Graph
// Graph Properties
CBUFFER_START(UnityPerMaterial)
float _StraightAlphaTexture;
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
CBUFFER_END
// Object and Global properties
// Graph Includes
// GraphIncludes: <None>
// Graph Functions
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
{
Out = Predicate ? True : False;
}
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
{
Out = A * B;
}
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
// Graph Vertex
struct VertexDescription
{
};
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
{
VertexDescription description = (VertexDescription)0;
return description;
}
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreSurface' */
// Graph Pixel
struct SurfaceDescription
{
float3 BaseColor;
float Alpha;
};
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
{
SurfaceDescription surface = (SurfaceDescription)0;
float4 _DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4 = float4(1, 1, 0, 1);
[branch] if (_UIE_RENDER_TYPE_SOLID || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeSolid)
{
SolidFragInput Unity_UIE_EvaluateSolidNode_Input;
Unity_UIE_EvaluateSolidNode_Input.tint = IN.color;
Unity_UIE_EvaluateSolidNode_Input.isArc = false;
Unity_UIE_EvaluateSolidNode_Input.outer = float2(-10000, -10000);
Unity_UIE_EvaluateSolidNode_Input.inner = float2(-10000, -10000);
CommonFragOutput Unity_UIE_EvaluateSolidNode_Output = uie_std_frag_solid(Unity_UIE_EvaluateSolidNode_Input);
_DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4 = Unity_UIE_EvaluateSolidNode_Output.color;
}
float4 _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4 = float4(1, 1, 0, 1);
[branch] if (_UIE_RENDER_TYPE_TEXTURE || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeTexture)
{
TextureFragInput Unity_UIE_EvaluateTextureNode_Input;
Unity_UIE_EvaluateTextureNode_Input.tint = IN.color;
Unity_UIE_EvaluateTextureNode_Input.textureSlot = IN.typeTexSettings.y;
Unity_UIE_EvaluateTextureNode_Input.uv = IN.uvClip.xy;
Unity_UIE_EvaluateTextureNode_Input.isArc = false;
Unity_UIE_EvaluateTextureNode_Input.outer = float2(-10000, -10000);
Unity_UIE_EvaluateTextureNode_Input.inner = float2(-10000, -10000);
CommonFragOutput Unity_UIE_EvaluateTextureNode_Output = uie_std_frag_texture(Unity_UIE_EvaluateTextureNode_Input);
_DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4 = Unity_UIE_EvaluateTextureNode_Output.color;
}
float3 _Swizzle_c3b6fc22d71a49e49cdeae1847c155da_Out_1_Vector3 = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4.xyz;
float _Property_4e9c19f167f743a2a7022781a02d70f9_Out_0_Boolean = _StraightAlphaTexture;
float _Split_775865f90de4425e89b1219e16b8b1b8_R_1_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[0];
float _Split_775865f90de4425e89b1219e16b8b1b8_G_2_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[1];
float _Split_775865f90de4425e89b1219e16b8b1b8_B_3_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[2];
float _Split_775865f90de4425e89b1219e16b8b1b8_A_4_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[3];
float _Branch_497e29be0ebf40e7991f43fc57bf1a3e_Out_3_Float;
Unity_Branch_float(_Property_4e9c19f167f743a2a7022781a02d70f9_Out_0_Boolean, _Split_775865f90de4425e89b1219e16b8b1b8_A_4_Float, float(1), _Branch_497e29be0ebf40e7991f43fc57bf1a3e_Out_3_Float);
float3 _Multiply_d99b3fd6d1a849ea8b7ba160b4f11ece_Out_2_Vector3;
Unity_Multiply_float3_float3(_Swizzle_c3b6fc22d71a49e49cdeae1847c155da_Out_1_Vector3, (_Branch_497e29be0ebf40e7991f43fc57bf1a3e_Out_3_Float.xxx), _Multiply_d99b3fd6d1a849ea8b7ba160b4f11ece_Out_2_Vector3);
float4 _Append_1a863cc20632474aa4fef9f0995dc8c9_Out_2_Vector4 = float4( _Multiply_d99b3fd6d1a849ea8b7ba160b4f11ece_Out_2_Vector3.xyz, _Split_775865f90de4425e89b1219e16b8b1b8_A_4_Float.x );
float3 _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = float3(0, 0, 0);
float _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = 1.0;
[branch] if (_UIE_RENDER_TYPE_SOLID || _UIE_RENDER_TYPE_ANY && TestType(IN.typeTexSettings.x, k_FragTypeSolid))
{
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = _DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = _DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4.a;
}
else [branch] if (_UIE_RENDER_TYPE_TEXTURE || _UIE_RENDER_TYPE_ANY && TestType(IN.typeTexSettings.x, k_FragTypeTexture))
{
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = _Append_1a863cc20632474aa4fef9f0995dc8c9_Out_2_Vector4.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = _Append_1a863cc20632474aa4fef9f0995dc8c9_Out_2_Vector4.a;
}
else [branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && TestType(IN.typeTexSettings.x, k_FragTypeText))
{
[branch] if (GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0)
{
SdfTextFragInput Unity_UIE_RenderTypeSwitchNode_SdfText_Input;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.tint = IN.color;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.textureSlot = IN.typeTexSettings.y;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.uv = IN.uvClip.xy;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.extraDilate = IN.circle.x;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.textCoreLoc = round(IN.textCoreLoc);
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.opacity = IN.typeTexSettings.z;
CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_sdf_text(Unity_UIE_RenderTypeSwitchNode_SdfText_Input);
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = Unity_UIE_RenderTypeSwitchNode_Output.color.a;
}
else
{
BitmapTextFragInput Unity_UIE_RenderTypeSwitchNode_BitmapText_Input;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.tint = IN.color;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.textureSlot = IN.typeTexSettings.y;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.uv = IN.uvClip.xy;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.opacity = IN.typeTexSettings.z;
CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_bitmap_text(Unity_UIE_RenderTypeSwitchNode_BitmapText_Input);
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = Unity_UIE_RenderTypeSwitchNode_Output.color.a;
}
}
else
{
SvgGradientFragInput Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input;
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.settingIndex = round(IN.typeTexSettings.z);
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.textureSlot = round(IN.typeTexSettings.y);
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.uv = IN.uvClip.xy;
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.isArc = false;
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.outer = float2(-10000, -10000);
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.inner = float2(-10000, -10000);
CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_svg_gradient(Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input);
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb * IN.color.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = Unity_UIE_RenderTypeSwitchNode_Output.color.a * IN.color.a;
}
surface.BaseColor = _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3;
surface.Alpha = _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float;
return surface;
}
// --------------------------------------------------
// Build Graph Inputs
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
{
VertexDescriptionInputs output;
ZERO_INITIALIZE(VertexDescriptionInputs, output);
#if UNITY_ANY_INSTANCING_ENABLED
#else // TODO: XR support for procedural instancing because in this case UNITY_ANY_INSTANCING_ENABLED is not defined and instanceID is incorrect.
#endif
return output;
}
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
{
SurfaceDescriptionInputs output;
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorCopyToSDI' */
#if UNITY_UV_STARTS_AT_TOP
#else
#endif
#if defined(UNITY_UIE_INCLUDED)
#else
#endif
output.color = input.color;
output.uvClip = input.texCoord0;
output.typeTexSettings = input.texCoord1;
output.textCoreLoc = input.texCoord3.xy;
output.layoutUV = input.texCoord3.zw;
output.circle = input.texCoord4;
#if UNITY_ANY_INSTANCING_ENABLED
#else // TODO: XR support for procedural instancing because in this case UNITY_ANY_INSTANCING_ENABLED is not defined and instanceID is incorrect.
#endif
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
#else
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
#endif
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
return output;
}
// --------------------------------------------------
// Main
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/UITKPass.hlsl"
ENDHLSL
}
}
CustomEditor "UnityEditor.ShaderGraph.GenericShaderGraphMaterialGUI"
FallBack off
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 9818276b7a7ab2148a8a3ed86c9ac555
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,439 @@
Shader "Spine/UITK/Multiply"
{
Properties
{
[ToggleUI]_StraightAlphaTexture("Straight Alpha Texture", Float) = 1
[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
}
SubShader
{
Tags
{
"RenderPipeline"="UniversalPipeline"
"RenderType"="Transparent"
"Queue"="Transparent"
// DisableBatching: <None>
"ShaderGraphShader"="true"
"ShaderGraphTargetId"=""
"IgnoreProjector"="True"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Pass
{
Name "Default"
Tags
{
// LightMode: <None>
}
// Render State
Cull Off
Blend DstColor OneMinusSrcAlpha
ZWrite Off
// Debug
// <None>
// --------------------------------------------------
// Pass
HLSLPROGRAM
// Pragmas
#pragma target 3.5
#pragma vertex uie_custom_vert
#pragma fragment uie_custom_frag
// Keywords
#pragma multi_compile_local _ _UIE_FORCE_GAMMA
#pragma multi_compile_local _ _UIE_TEXTURE_SLOT_COUNT_4 _UIE_TEXTURE_SLOT_COUNT_2 _UIE_TEXTURE_SLOT_COUNT_1
#pragma multi_compile_local _ _UIE_RENDER_TYPE_SOLID _UIE_RENDER_TYPE_TEXTURE _UIE_RENDER_TYPE_TEXT _UIE_RENDER_TYPE_GRADIENT
// GraphKeywords: <None>
#define UITK_SHADERGRAPH
// Defines
#define _SURFACE_TYPE_TRANSPARENT 1
#define _ALPHAPREMULTIPLY_ON 1
#define ATTRIBUTES_NEED_TEXCOORD0
#define ATTRIBUTES_NEED_TEXCOORD1
#define ATTRIBUTES_NEED_TEXCOORD2
#define ATTRIBUTES_NEED_TEXCOORD3
#define ATTRIBUTES_NEED_COLOR
#define VARYINGS_NEED_TEXCOORD0
#define VARYINGS_NEED_TEXCOORD1
#define VARYINGS_NEED_TEXCOORD3
#define VARYINGS_NEED_COLOR
#define FEATURES_GRAPH_VERTEX
#define REQUIRE_DEPTH_TEXTURE
#define REQUIRE_NORMAL_TEXTURE
#define SHADERPASS SHADERPASS_CUSTOM_UI
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShim.hlsl"
// --------------------------------------------------
// Structs and Packing
struct Attributes
{
float3 positionOS : POSITION;
float4 color : COLOR;
float4 uv0 : TEXCOORD0;
float4 uv1 : TEXCOORD1;
float4 uv2 : TEXCOORD2;
float4 uv3 : TEXCOORD3;
float4 uv4 : TEXCOORD4;
float4 uv5 : TEXCOORD5;
float4 uv6 : TEXCOORD6;
float4 uv7 : TEXCOORD7;
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
uint instanceID : INSTANCEID_SEMANTIC;
#endif
};
struct SurfaceDescriptionInputs
{
float4 color;
float4 typeTexSettings;
float2 textCoreLoc;
float4 circle;
float4 uvClip;
float2 layoutUV;
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float4 texCoord0;
float4 texCoord1;
float4 texCoord3;
float4 texCoord4;
float4 color;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
uint instanceID : CUSTOM_INSTANCE_ID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
#endif
};
struct VertexDescriptionInputs
{
float4 vertexPosition;
float4 vertexColor;
float4 uv;
float4 xformClipPages;
float4 ids;
float4 flags;
float4 opacityColorPages;
float4 settingIndex;
float4 circle;
};
struct PackedVaryings
{
float4 positionCS : SV_POSITION;
float4 texCoord0 : INTERP0;
float4 texCoord1 : INTERP1;
float4 texCoord3 : INTERP2;
float4 texCoord4 : INTERP3;
float4 color : INTERP4;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
uint instanceID : CUSTOM_INSTANCE_ID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
#endif
};
PackedVaryings PackVaryings (Varyings input)
{
PackedVaryings output;
ZERO_INITIALIZE(PackedVaryings, output);
output.positionCS = input.positionCS;
output.texCoord0.xyzw = input.texCoord0;
output.texCoord1.xyzw = input.texCoord1;
output.texCoord3.xyzw = input.texCoord3;
output.texCoord4.xyzw = input.texCoord4;
output.color.xyzw = input.color;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
output.instanceID = input.instanceID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
#endif
return output;
}
Varyings UnpackVaryings (PackedVaryings input)
{
Varyings output;
output.positionCS = input.positionCS;
output.texCoord0 = input.texCoord0.xyzw;
output.texCoord1 = input.texCoord1.xyzw;
output.texCoord3 = input.texCoord3.xyzw;
output.texCoord4 = input.texCoord4.xyzw;
output.color = input.color.xyzw;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
output.instanceID = input.instanceID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
#endif
return output;
}
// -- Property used by ScenePickingPass
#ifdef SCENEPICKINGPASS
float4 _SelectionID;
#endif
// -- Properties used by SceneSelectionPass
#ifdef SCENESELECTIONPASS
int _ObjectId;
int _PassValue;
#endif
//UGUI has no keyword for when a renderer has "bloom", so its nessecary to hardcore it here, like all the base UI shaders.
half4 _TextureSampleAdd;
// --------------------------------------------------
// Graph
// Graph Properties
CBUFFER_START(UnityPerMaterial)
float _StraightAlphaTexture;
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
CBUFFER_END
// Object and Global properties
// Graph Includes
// GraphIncludes: <None>
// Graph Functions
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
{
Out = Predicate ? True : False;
}
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
{
Out = A * B;
}
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
// Graph Vertex
struct VertexDescription
{
};
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
{
VertexDescription description = (VertexDescription)0;
return description;
}
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreSurface' */
// Graph Pixel
struct SurfaceDescription
{
float3 BaseColor;
float Alpha;
};
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
{
SurfaceDescription surface = (SurfaceDescription)0;
float4 _DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4 = float4(1, 1, 0, 1);
[branch] if (_UIE_RENDER_TYPE_SOLID || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeSolid)
{
SolidFragInput Unity_UIE_EvaluateSolidNode_Input;
Unity_UIE_EvaluateSolidNode_Input.tint = IN.color;
Unity_UIE_EvaluateSolidNode_Input.isArc = false;
Unity_UIE_EvaluateSolidNode_Input.outer = float2(-10000, -10000);
Unity_UIE_EvaluateSolidNode_Input.inner = float2(-10000, -10000);
CommonFragOutput Unity_UIE_EvaluateSolidNode_Output = uie_std_frag_solid(Unity_UIE_EvaluateSolidNode_Input);
_DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4 = Unity_UIE_EvaluateSolidNode_Output.color;
}
float4 _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4 = float4(1, 1, 0, 1);
[branch] if (_UIE_RENDER_TYPE_TEXTURE || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeTexture)
{
TextureFragInput Unity_UIE_EvaluateTextureNode_Input;
Unity_UIE_EvaluateTextureNode_Input.tint = IN.color;
Unity_UIE_EvaluateTextureNode_Input.textureSlot = IN.typeTexSettings.y;
Unity_UIE_EvaluateTextureNode_Input.uv = IN.uvClip.xy;
Unity_UIE_EvaluateTextureNode_Input.isArc = false;
Unity_UIE_EvaluateTextureNode_Input.outer = float2(-10000, -10000);
Unity_UIE_EvaluateTextureNode_Input.inner = float2(-10000, -10000);
CommonFragOutput Unity_UIE_EvaluateTextureNode_Output = uie_std_frag_texture(Unity_UIE_EvaluateTextureNode_Input);
_DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4 = Unity_UIE_EvaluateTextureNode_Output.color;
}
float3 _Swizzle_c3b6fc22d71a49e49cdeae1847c155da_Out_1_Vector3 = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4.xyz;
float _Property_4e9c19f167f743a2a7022781a02d70f9_Out_0_Boolean = _StraightAlphaTexture;
float _Split_775865f90de4425e89b1219e16b8b1b8_R_1_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[0];
float _Split_775865f90de4425e89b1219e16b8b1b8_G_2_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[1];
float _Split_775865f90de4425e89b1219e16b8b1b8_B_3_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[2];
float _Split_775865f90de4425e89b1219e16b8b1b8_A_4_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[3];
float _Branch_497e29be0ebf40e7991f43fc57bf1a3e_Out_3_Float;
Unity_Branch_float(_Property_4e9c19f167f743a2a7022781a02d70f9_Out_0_Boolean, _Split_775865f90de4425e89b1219e16b8b1b8_A_4_Float, float(1), _Branch_497e29be0ebf40e7991f43fc57bf1a3e_Out_3_Float);
float3 _Multiply_d99b3fd6d1a849ea8b7ba160b4f11ece_Out_2_Vector3;
Unity_Multiply_float3_float3(_Swizzle_c3b6fc22d71a49e49cdeae1847c155da_Out_1_Vector3, (_Branch_497e29be0ebf40e7991f43fc57bf1a3e_Out_3_Float.xxx), _Multiply_d99b3fd6d1a849ea8b7ba160b4f11ece_Out_2_Vector3);
float4 _Append_1a863cc20632474aa4fef9f0995dc8c9_Out_2_Vector4 = float4( _Multiply_d99b3fd6d1a849ea8b7ba160b4f11ece_Out_2_Vector3.xyz, _Split_775865f90de4425e89b1219e16b8b1b8_A_4_Float.x );
float3 _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = float3(0, 0, 0);
float _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = 1.0;
[branch] if (_UIE_RENDER_TYPE_SOLID || _UIE_RENDER_TYPE_ANY && TestType(IN.typeTexSettings.x, k_FragTypeSolid))
{
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = _DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = _DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4.a;
}
else [branch] if (_UIE_RENDER_TYPE_TEXTURE || _UIE_RENDER_TYPE_ANY && TestType(IN.typeTexSettings.x, k_FragTypeTexture))
{
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = _Append_1a863cc20632474aa4fef9f0995dc8c9_Out_2_Vector4.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = _Append_1a863cc20632474aa4fef9f0995dc8c9_Out_2_Vector4.a;
}
else [branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && TestType(IN.typeTexSettings.x, k_FragTypeText))
{
[branch] if (GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0)
{
SdfTextFragInput Unity_UIE_RenderTypeSwitchNode_SdfText_Input;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.tint = IN.color;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.textureSlot = IN.typeTexSettings.y;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.uv = IN.uvClip.xy;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.extraDilate = IN.circle.x;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.textCoreLoc = round(IN.textCoreLoc);
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.opacity = IN.typeTexSettings.z;
CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_sdf_text(Unity_UIE_RenderTypeSwitchNode_SdfText_Input);
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = Unity_UIE_RenderTypeSwitchNode_Output.color.a;
}
else
{
BitmapTextFragInput Unity_UIE_RenderTypeSwitchNode_BitmapText_Input;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.tint = IN.color;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.textureSlot = IN.typeTexSettings.y;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.uv = IN.uvClip.xy;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.opacity = IN.typeTexSettings.z;
CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_bitmap_text(Unity_UIE_RenderTypeSwitchNode_BitmapText_Input);
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = Unity_UIE_RenderTypeSwitchNode_Output.color.a;
}
}
else
{
SvgGradientFragInput Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input;
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.settingIndex = round(IN.typeTexSettings.z);
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.textureSlot = round(IN.typeTexSettings.y);
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.uv = IN.uvClip.xy;
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.isArc = false;
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.outer = float2(-10000, -10000);
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.inner = float2(-10000, -10000);
CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_svg_gradient(Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input);
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb * IN.color.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = Unity_UIE_RenderTypeSwitchNode_Output.color.a * IN.color.a;
}
surface.BaseColor = _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3;
surface.Alpha = _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float;
return surface;
}
// --------------------------------------------------
// Build Graph Inputs
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
{
VertexDescriptionInputs output;
ZERO_INITIALIZE(VertexDescriptionInputs, output);
#if UNITY_ANY_INSTANCING_ENABLED
#else // TODO: XR support for procedural instancing because in this case UNITY_ANY_INSTANCING_ENABLED is not defined and instanceID is incorrect.
#endif
return output;
}
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
{
SurfaceDescriptionInputs output;
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorCopyToSDI' */
#if UNITY_UV_STARTS_AT_TOP
#else
#endif
#if defined(UNITY_UIE_INCLUDED)
#else
#endif
output.color = input.color;
output.uvClip = input.texCoord0;
output.typeTexSettings = input.texCoord1;
output.textCoreLoc = input.texCoord3.xy;
output.layoutUV = input.texCoord3.zw;
output.circle = input.texCoord4;
#if UNITY_ANY_INSTANCING_ENABLED
#else // TODO: XR support for procedural instancing because in this case UNITY_ANY_INSTANCING_ENABLED is not defined and instanceID is incorrect.
#endif
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
#else
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
#endif
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
return output;
}
// --------------------------------------------------
// Main
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/UITKPass.hlsl"
ENDHLSL
}
}
CustomEditor "UnityEditor.ShaderGraph.GenericShaderGraphMaterialGUI"
FallBack off
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: ed93aea253bcdc94a84ee09cd390c587
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 1baeaee5c1b883a418362717b2ca2fb7
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
useAsTemplate: 0
exposeTemplateAsShader: 0
template:
name:
category:
description:
icon: {instanceID: 0}
thumbnail: {instanceID: 0}

View File

@ -0,0 +1,439 @@
Shader "Spine/UITK/Screen"
{
Properties
{
[ToggleUI]_StraightAlphaTexture("Straight Alpha Texture", Float) = 1
[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
}
SubShader
{
Tags
{
"RenderPipeline"="UniversalPipeline"
"RenderType"="Transparent"
"Queue"="Transparent"
// DisableBatching: <None>
"ShaderGraphShader"="true"
"ShaderGraphTargetId"=""
"IgnoreProjector"="True"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Pass
{
Name "Default"
Tags
{
// LightMode: <None>
}
// Render State
Cull Off
Blend One OneMinusSrcColor
ZWrite Off
// Debug
// <None>
// --------------------------------------------------
// Pass
HLSLPROGRAM
// Pragmas
#pragma target 3.5
#pragma vertex uie_custom_vert
#pragma fragment uie_custom_frag
// Keywords
#pragma multi_compile_local _ _UIE_FORCE_GAMMA
#pragma multi_compile_local _ _UIE_TEXTURE_SLOT_COUNT_4 _UIE_TEXTURE_SLOT_COUNT_2 _UIE_TEXTURE_SLOT_COUNT_1
#pragma multi_compile_local _ _UIE_RENDER_TYPE_SOLID _UIE_RENDER_TYPE_TEXTURE _UIE_RENDER_TYPE_TEXT _UIE_RENDER_TYPE_GRADIENT
// GraphKeywords: <None>
#define UITK_SHADERGRAPH
// Defines
#define _SURFACE_TYPE_TRANSPARENT 1
#define _ALPHAPREMULTIPLY_ON 1
#define ATTRIBUTES_NEED_TEXCOORD0
#define ATTRIBUTES_NEED_TEXCOORD1
#define ATTRIBUTES_NEED_TEXCOORD2
#define ATTRIBUTES_NEED_TEXCOORD3
#define ATTRIBUTES_NEED_COLOR
#define VARYINGS_NEED_TEXCOORD0
#define VARYINGS_NEED_TEXCOORD1
#define VARYINGS_NEED_TEXCOORD3
#define VARYINGS_NEED_COLOR
#define FEATURES_GRAPH_VERTEX
#define REQUIRE_DEPTH_TEXTURE
#define REQUIRE_NORMAL_TEXTURE
#define SHADERPASS SHADERPASS_CUSTOM_UI
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/UIShim.hlsl"
// --------------------------------------------------
// Structs and Packing
struct Attributes
{
float3 positionOS : POSITION;
float4 color : COLOR;
float4 uv0 : TEXCOORD0;
float4 uv1 : TEXCOORD1;
float4 uv2 : TEXCOORD2;
float4 uv3 : TEXCOORD3;
float4 uv4 : TEXCOORD4;
float4 uv5 : TEXCOORD5;
float4 uv6 : TEXCOORD6;
float4 uv7 : TEXCOORD7;
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
uint instanceID : INSTANCEID_SEMANTIC;
#endif
};
struct SurfaceDescriptionInputs
{
float4 color;
float4 typeTexSettings;
float2 textCoreLoc;
float4 circle;
float4 uvClip;
float2 layoutUV;
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float4 texCoord0;
float4 texCoord1;
float4 texCoord3;
float4 texCoord4;
float4 color;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
uint instanceID : CUSTOM_INSTANCE_ID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
#endif
};
struct VertexDescriptionInputs
{
float4 vertexPosition;
float4 vertexColor;
float4 uv;
float4 xformClipPages;
float4 ids;
float4 flags;
float4 opacityColorPages;
float4 settingIndex;
float4 circle;
};
struct PackedVaryings
{
float4 positionCS : SV_POSITION;
float4 texCoord0 : INTERP0;
float4 texCoord1 : INTERP1;
float4 texCoord3 : INTERP2;
float4 texCoord4 : INTERP3;
float4 color : INTERP4;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
uint instanceID : CUSTOM_INSTANCE_ID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
#endif
};
PackedVaryings PackVaryings (Varyings input)
{
PackedVaryings output;
ZERO_INITIALIZE(PackedVaryings, output);
output.positionCS = input.positionCS;
output.texCoord0.xyzw = input.texCoord0;
output.texCoord1.xyzw = input.texCoord1;
output.texCoord3.xyzw = input.texCoord3;
output.texCoord4.xyzw = input.texCoord4;
output.color.xyzw = input.color;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
output.instanceID = input.instanceID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
#endif
return output;
}
Varyings UnpackVaryings (PackedVaryings input)
{
Varyings output;
output.positionCS = input.positionCS;
output.texCoord0 = input.texCoord0.xyzw;
output.texCoord1 = input.texCoord1.xyzw;
output.texCoord3 = input.texCoord3.xyzw;
output.texCoord4 = input.texCoord4.xyzw;
output.color = input.color.xyzw;
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
output.instanceID = input.instanceID;
#endif
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
#endif
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
#endif
return output;
}
// -- Property used by ScenePickingPass
#ifdef SCENEPICKINGPASS
float4 _SelectionID;
#endif
// -- Properties used by SceneSelectionPass
#ifdef SCENESELECTIONPASS
int _ObjectId;
int _PassValue;
#endif
//UGUI has no keyword for when a renderer has "bloom", so its nessecary to hardcore it here, like all the base UI shaders.
half4 _TextureSampleAdd;
// --------------------------------------------------
// Graph
// Graph Properties
CBUFFER_START(UnityPerMaterial)
float _StraightAlphaTexture;
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
CBUFFER_END
// Object and Global properties
// Graph Includes
// GraphIncludes: <None>
// Graph Functions
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
{
Out = Predicate ? True : False;
}
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
{
Out = A * B;
}
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
// Graph Vertex
struct VertexDescription
{
};
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
{
VertexDescription description = (VertexDescription)0;
return description;
}
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreSurface' */
// Graph Pixel
struct SurfaceDescription
{
float3 BaseColor;
float Alpha;
};
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
{
SurfaceDescription surface = (SurfaceDescription)0;
float4 _DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4 = float4(1, 1, 0, 1);
[branch] if (_UIE_RENDER_TYPE_SOLID || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeSolid)
{
SolidFragInput Unity_UIE_EvaluateSolidNode_Input;
Unity_UIE_EvaluateSolidNode_Input.tint = IN.color;
Unity_UIE_EvaluateSolidNode_Input.isArc = false;
Unity_UIE_EvaluateSolidNode_Input.outer = float2(-10000, -10000);
Unity_UIE_EvaluateSolidNode_Input.inner = float2(-10000, -10000);
CommonFragOutput Unity_UIE_EvaluateSolidNode_Output = uie_std_frag_solid(Unity_UIE_EvaluateSolidNode_Input);
_DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4 = Unity_UIE_EvaluateSolidNode_Output.color;
}
float4 _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4 = float4(1, 1, 0, 1);
[branch] if (_UIE_RENDER_TYPE_TEXTURE || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeTexture)
{
TextureFragInput Unity_UIE_EvaluateTextureNode_Input;
Unity_UIE_EvaluateTextureNode_Input.tint = IN.color;
Unity_UIE_EvaluateTextureNode_Input.textureSlot = IN.typeTexSettings.y;
Unity_UIE_EvaluateTextureNode_Input.uv = IN.uvClip.xy;
Unity_UIE_EvaluateTextureNode_Input.isArc = false;
Unity_UIE_EvaluateTextureNode_Input.outer = float2(-10000, -10000);
Unity_UIE_EvaluateTextureNode_Input.inner = float2(-10000, -10000);
CommonFragOutput Unity_UIE_EvaluateTextureNode_Output = uie_std_frag_texture(Unity_UIE_EvaluateTextureNode_Input);
_DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4 = Unity_UIE_EvaluateTextureNode_Output.color;
}
float3 _Swizzle_c3b6fc22d71a49e49cdeae1847c155da_Out_1_Vector3 = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4.xyz;
float _Property_4e9c19f167f743a2a7022781a02d70f9_Out_0_Boolean = _StraightAlphaTexture;
float _Split_775865f90de4425e89b1219e16b8b1b8_R_1_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[0];
float _Split_775865f90de4425e89b1219e16b8b1b8_G_2_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[1];
float _Split_775865f90de4425e89b1219e16b8b1b8_B_3_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[2];
float _Split_775865f90de4425e89b1219e16b8b1b8_A_4_Float = _DefaultTexture_0ff00ac4ba3f46138bd69732235d2fb4_Texture_2_Vector4[3];
float _Branch_497e29be0ebf40e7991f43fc57bf1a3e_Out_3_Float;
Unity_Branch_float(_Property_4e9c19f167f743a2a7022781a02d70f9_Out_0_Boolean, _Split_775865f90de4425e89b1219e16b8b1b8_A_4_Float, float(1), _Branch_497e29be0ebf40e7991f43fc57bf1a3e_Out_3_Float);
float3 _Multiply_d99b3fd6d1a849ea8b7ba160b4f11ece_Out_2_Vector3;
Unity_Multiply_float3_float3(_Swizzle_c3b6fc22d71a49e49cdeae1847c155da_Out_1_Vector3, (_Branch_497e29be0ebf40e7991f43fc57bf1a3e_Out_3_Float.xxx), _Multiply_d99b3fd6d1a849ea8b7ba160b4f11ece_Out_2_Vector3);
float4 _Append_1a863cc20632474aa4fef9f0995dc8c9_Out_2_Vector4 = float4( _Multiply_d99b3fd6d1a849ea8b7ba160b4f11ece_Out_2_Vector3.xyz, _Split_775865f90de4425e89b1219e16b8b1b8_A_4_Float.x );
float3 _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = float3(0, 0, 0);
float _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = 1.0;
[branch] if (_UIE_RENDER_TYPE_SOLID || _UIE_RENDER_TYPE_ANY && TestType(IN.typeTexSettings.x, k_FragTypeSolid))
{
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = _DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = _DefaultSolid_e5d4725ba3424f12a78b05bd317dacfe_Solid_0_Vector4.a;
}
else [branch] if (_UIE_RENDER_TYPE_TEXTURE || _UIE_RENDER_TYPE_ANY && TestType(IN.typeTexSettings.x, k_FragTypeTexture))
{
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = _Append_1a863cc20632474aa4fef9f0995dc8c9_Out_2_Vector4.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = _Append_1a863cc20632474aa4fef9f0995dc8c9_Out_2_Vector4.a;
}
else [branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && TestType(IN.typeTexSettings.x, k_FragTypeText))
{
[branch] if (GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0)
{
SdfTextFragInput Unity_UIE_RenderTypeSwitchNode_SdfText_Input;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.tint = IN.color;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.textureSlot = IN.typeTexSettings.y;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.uv = IN.uvClip.xy;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.extraDilate = IN.circle.x;
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.textCoreLoc = round(IN.textCoreLoc);
Unity_UIE_RenderTypeSwitchNode_SdfText_Input.opacity = IN.typeTexSettings.z;
CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_sdf_text(Unity_UIE_RenderTypeSwitchNode_SdfText_Input);
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = Unity_UIE_RenderTypeSwitchNode_Output.color.a;
}
else
{
BitmapTextFragInput Unity_UIE_RenderTypeSwitchNode_BitmapText_Input;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.tint = IN.color;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.textureSlot = IN.typeTexSettings.y;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.uv = IN.uvClip.xy;
Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.opacity = IN.typeTexSettings.z;
CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_bitmap_text(Unity_UIE_RenderTypeSwitchNode_BitmapText_Input);
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = Unity_UIE_RenderTypeSwitchNode_Output.color.a;
}
}
else
{
SvgGradientFragInput Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input;
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.settingIndex = round(IN.typeTexSettings.z);
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.textureSlot = round(IN.typeTexSettings.y);
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.uv = IN.uvClip.xy;
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.isArc = false;
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.outer = float2(-10000, -10000);
Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input.inner = float2(-10000, -10000);
CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_svg_gradient(Unity_UIE_RenderTypeSwitchNode_SvgGradient_Input);
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3 = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb * IN.color.rgb;
_RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float = Unity_UIE_RenderTypeSwitchNode_Output.color.a * IN.color.a;
}
surface.BaseColor = _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Color_5_Vector3;
surface.Alpha = _RenderTypeBranch_532ba7da13274f1d9adcf8b9b5924c01_Alpha_6_Float;
return surface;
}
// --------------------------------------------------
// Build Graph Inputs
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
{
VertexDescriptionInputs output;
ZERO_INITIALIZE(VertexDescriptionInputs, output);
#if UNITY_ANY_INSTANCING_ENABLED
#else // TODO: XR support for procedural instancing because in this case UNITY_ANY_INSTANCING_ENABLED is not defined and instanceID is incorrect.
#endif
return output;
}
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
{
SurfaceDescriptionInputs output;
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorCopyToSDI' */
#if UNITY_UV_STARTS_AT_TOP
#else
#endif
#if defined(UNITY_UIE_INCLUDED)
#else
#endif
output.color = input.color;
output.uvClip = input.texCoord0;
output.typeTexSettings = input.texCoord1;
output.textCoreLoc = input.texCoord3.xy;
output.layoutUV = input.texCoord3.zw;
output.circle = input.texCoord4;
#if UNITY_ANY_INSTANCING_ENABLED
#else // TODO: XR support for procedural instancing because in this case UNITY_ANY_INSTANCING_ENABLED is not defined and instanceID is incorrect.
#endif
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
#else
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
#endif
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
return output;
}
// --------------------------------------------------
// Main
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/UITKPass.hlsl"
ENDHLSL
}
}
CustomEditor "UnityEditor.ShaderGraph.GenericShaderGraphMaterialGUI"
FallBack off
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b0198c7d0f7c55c4992b84a4c94afaac
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,9 +1,9 @@
{
"name": "com.esotericsoftware.spine.ui-toolkit",
"displayName": "Spine UI Toolkit [Experimental]",
"description": "This plugin provides UI Toolkit integration for the spine-unity runtime.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime, version 4.3.0 or newer and Unity 6000.0.16 or newer (requires [this bugfix](https://issuetracker.unity3d.com/issues/some-default-uxmlconverters-are-dependent-on-the-current-culture)).\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
"version": "4.3.0-preview.4",
"unity": "6000.0",
"description": "This plugin provides UI Toolkit integration for the spine-unity runtime.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime, version 4.3.42 or newer and Unity 6000.3 or newer (requires [this bugfix](https://issuetracker.unity3d.com/issues/some-default-uxmlconverters-are-dependent-on-the-current-culture)).\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
"version": "4.3.0-preview.5",
"unity": "6000.3",
"author": {
"name": "Esoteric Software",
"email": "contact@esotericsoftware.com",
@ -11,7 +11,7 @@
},
"dependencies": {
"com.unity.modules.uielements": "1.0.0",
"com.esotericsoftware.spine.spine-unity": "4.3.41"
"com.esotericsoftware.spine.spine-unity": "4.3.42"
},
"keywords": [
"spine",