Merge branch '4.0' into 4.1-beta

This commit is contained in:
Harald Csaszar 2022-03-15 19:20:58 +01:00
commit ac73e8dc7d
5 changed files with 112 additions and 44 deletions

View File

@ -0,0 +1,47 @@
#ifndef SKELETONLIT_UNLIT_PASS_INCLUDED
#define SKELETONLIT_UNLIT_PASS_INCLUDED
struct Attributes
{
float3 positionOS : POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
};
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
float4 _MainTex_ST;
Varyings UnlitVertex(Attributes attributes)
{
Varyings o = (Varyings)0;
o.positionCS = TransformObjectToHClip(attributes.positionOS);
o.uv = TRANSFORM_TEX(attributes.uv, _MainTex);
o.uv = attributes.uv;
o.color = attributes.color;
return o;
}
float4 UnlitFragment(Varyings i) : SV_Target
{
half4 tex = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
half4 main;
#if defined(_STRAIGHT_ALPHA_INPUT)
main.rgb = tex.rgb * i.color.rgb * tex.a;
#else
main.rgb = tex.rgb * i.color.rgb;
#endif
main.a = tex.a * i.color.a;
return main;
}
#endif

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 580dd7e812fc63c4a9330abe519946de
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -193,52 +193,12 @@
Blend One OneMinusSrcAlpha
HLSLPROGRAM
#pragma shader_feature _ _STRAIGHT_ALPHA_INPUT
#pragma prefer_hlslcc gles
#pragma vertex UnlitVertex
#pragma fragment UnlitFragment
struct Attributes
{
float3 positionOS : POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
};
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
float4 _MainTex_ST;
Varyings UnlitVertex(Attributes attributes)
{
Varyings o = (Varyings)0;
o.positionCS = TransformObjectToHClip(attributes.positionOS);
o.uv = TRANSFORM_TEX(attributes.uv, _MainTex);
o.uv = attributes.uv;
o.color = attributes.color;
return o;
}
float4 UnlitFragment(Varyings i) : SV_Target
{
half4 tex = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
half4 main;
#if defined(_STRAIGHT_ALPHA_INPUT)
main.rgb = tex.rgb * i.color.rgb * tex.a;
#else
main.rgb = tex.rgb * i.color.rgb;
#endif
main.a = tex.a * i.color.a;
return main;
}
#include "Include/Spine-SkeletonLit-UnlitPass-URP-2D.hlsl"
ENDHLSL
}
}

View File

@ -147,7 +147,28 @@ Shader "Universal Render Pipeline/2D/Spine/Sprite"
ENDHLSL
}
UsePass "Universal Render Pipeline/2D/Spine/Skeleton Lit/UNLIT"
Pass
{
Name "Unlit"
Tags { "LightMode" = "UniversalForward" "Queue" = "Transparent" "RenderType" = "Transparent"}
ZWrite Off
Cull Off
Blend One OneMinusSrcAlpha
HLSLPROGRAM
#pragma shader_feature _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAPREMULTIPLY_VERTEX_ONLY _ADDITIVEBLEND _ADDITIVEBLEND_SOFT _MULTIPLYBLEND _MULTIPLYBLEND_X2
#if defined(_ALPHAPREMULTIPLY_VERTEX_ONLY) || defined(_ALPHABLEND_ON)
#define _STRAIGHT_ALPHA_INPUT
#endif
#pragma prefer_hlslcc gles
#pragma vertex UnlitVertex
#pragma fragment UnlitFragment
#include "Include/Spine-SkeletonLit-UnlitPass-URP-2D.hlsl"
ENDHLSL
}
}
FallBack "Universal Render Pipeline/2D/Spine/Skeleton Lit"

View File

@ -113,7 +113,7 @@ Shader "Universal Render Pipeline/Spine/Sprite"
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
//--------------------------------------
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
@ -202,6 +202,36 @@ Shader "Universal Render Pipeline/Spine/Sprite"
#include "Include/Spine-Sprite-DepthOnlyPass-URP.hlsl"
ENDHLSL
}
Pass
{
Name "Unlit"
Tags { "LightMode" = "UniversalForward" "Queue" = "Transparent" "RenderType" = "Transparent"}
ZWrite Off
Cull Off
Blend One OneMinusSrcAlpha
HLSLPROGRAM
#pragma shader_feature _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAPREMULTIPLY_VERTEX_ONLY _ADDITIVEBLEND _ADDITIVEBLEND_SOFT _MULTIPLYBLEND _MULTIPLYBLEND_X2
#if defined(_ALPHAPREMULTIPLY_VERTEX_ONLY) || defined(_ALPHABLEND_ON)
#define _STRAIGHT_ALPHA_INPUT
#endif
#pragma prefer_hlslcc gles
#pragma vertex vert
#pragma fragment frag
#undef LIGHTMAP_ON
#define USE_URP
#define fixed4 half4
#define fixed3 half3
#define fixed half
#include "Include/Spine-Input-URP.hlsl"
#include "Include/Spine-Skeleton-ForwardPass-URP.hlsl"
ENDHLSL
}
}
FallBack "Hidden/InternalErrorShader"