diff --git a/CHANGELOG.md b/CHANGELOG.md index 51fa9e8a0..38d5a98c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -112,6 +112,7 @@ 4) Assign this *_Outline* material at the new child GameObject's `MeshRenderer` component. If you are using `SkeletonRenderSeparator` and need to enable and disable the `SkeletonRenderSeparator` component at runtime, you can increase the `RenderCombinedMesh` `Reference Renderers` array by one and assign the `SkeletonRenderer` itself at the last entry after the parts renderers. Disabled `MeshRenderer` components will be skipped when combining the final mesh, so the combined mesh is automatically filled from the desired active renderers. * Timeline extension package: Added static `EditorEvent` callback to allow editor scripts to react to animation events outside of play-mode. Register to the events via `Spine.Unity.Playables.SpineAnimationStateMixerBehaviour.EditorEvent += YourCallback;`. + * URP Shaders: Added `Depth Write` property to shaders `Universal Render Pipeline/Spine/Skeleton` and `Universal Render Pipeline/Spine/Skeleton Lit`. Defaults to false to maintain existing behaviour. * **Breaking changes** * Made `SkeletonGraphic.unscaledTime` parameter protected, use the new property `UnscaledTime` instead. diff --git a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Spine-Skeleton-URP.shader b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Spine-Skeleton-URP.shader index 6419eb846..93f60c133 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Spine-Skeleton-URP.shader +++ b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Spine-Skeleton-URP.shader @@ -3,6 +3,7 @@ Shader "Universal Render Pipeline/Spine/Skeleton" { _Cutoff("Shadow alpha cutoff", Range(0,1)) = 0.1 [NoScaleOffset] _MainTex("Main Texture", 2D) = "black" {} [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 + [Toggle(_ZWRITE)] _ZWrite("Depth Write", Float) = 0.0 [MaterialToggle(_TINT_BLACK_ON)] _TintBlack("Tint Black", Float) = 0 _Color(" Light Color", Color) = (1,1,1,1) _Black(" Dark Color", Color) = (0,0,0,0) @@ -29,7 +30,7 @@ Shader "Universal Render Pipeline/Spine/Skeleton" { Name "Forward" Tags{"LightMode" = "UniversalForward"} - ZWrite Off + ZWrite[_ZWrite] Cull Off Blend One OneMinusSrcAlpha diff --git a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Spine-SkeletonLit-URP.shader b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Spine-SkeletonLit-URP.shader index 70fc7e7df..301c9b5b5 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Spine-SkeletonLit-URP.shader +++ b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Spine-SkeletonLit-URP.shader @@ -1,8 +1,9 @@ -Shader "Universal Render Pipeline/Spine/Skeleton Lit" { +Shader "Universal Render Pipeline/Spine/Skeleton Lit" { Properties { _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {} [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 + [Toggle(_ZWRITE)] _ZWrite("Depth Write", Float) = 0.0 [Toggle(_RECEIVE_SHADOWS)] _ReceiveShadows("Receive Shadows", Int) = 0 [Toggle(_DOUBLE_SIDED_LIGHTING)] _DoubleSidedLighting("Double-Sided Lighting", Int) = 0 [MaterialToggle(_LIGHT_AFFECTS_ADDITIVE)] _LightAffectsAdditive("Light Affects Additive", Float) = 0 @@ -19,7 +20,7 @@ Tags { "RenderPipeline" = "UniversalPipeline" "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } LOD 100 Cull Off - ZWrite Off + ZWrite[_ZWrite] Blend One OneMinusSrcAlpha Stencil { @@ -32,7 +33,7 @@ Name "ForwardLit" Tags{"LightMode" = "UniversalForward"} - ZWrite Off + ZWrite[_ZWrite] Cull Off Blend One OneMinusSrcAlpha diff --git a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/package.json b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/package.json index b751acb68..baa1436cf 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/package.json +++ b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/package.json @@ -2,7 +2,7 @@ "name": "com.esotericsoftware.spine.urp-shaders", "displayName": "Spine Universal RP Shaders", "description": "This plugin provides universal render pipeline (URP) shaders for the spine-unity runtime.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime, version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)", - "version": "4.1.21", + "version": "4.1.22", "unity": "2019.3", "author": { "name": "Esoteric Software",