mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Fixed URP shader issue with bloom and HDR. Closes #2574.
This commit is contained in:
parent
57479f082c
commit
6161636068
@ -109,7 +109,8 @@ half4 CombinedShapeLightFragment(VertexOutputSpriteURP2D input) : SV_Target
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, input.texcoord.xy);
|
half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, input.texcoord.xy);
|
||||||
main.rgb = main.a == 0 ? main.rgb : main.rgb / main.a; // un-premultiply for additive lights in CombinedShapeLightShared, reapply afterwards
|
// un-premultiply for additive lights in CombinedShapeLightShared, reapply afterwards
|
||||||
|
main.rgb = main.a < 0.001 ? main.rgb : main.rgb / main.a; // < epsilon prevents imprecision issues on some HW.
|
||||||
#if UNITY_VERSION < 202120
|
#if UNITY_VERSION < 202120
|
||||||
half4 pixel = half4(CombinedShapeLightShared(half4(main.rgb, 1), mask, input.lightingUV).rgb * main.a, main.a);
|
half4 pixel = half4(CombinedShapeLightShared(half4(main.rgb, 1), mask, input.lightingUV).rgb * main.a, main.a);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -139,7 +139,7 @@ Shader "Universal Render Pipeline/2D/Spine/Skeleton Lit" {
|
|||||||
return main;
|
return main;
|
||||||
#endif
|
#endif
|
||||||
// un-premultiply for additive lights in CombinedShapeLightShared, reapply afterwards
|
// un-premultiply for additive lights in CombinedShapeLightShared, reapply afterwards
|
||||||
main.rgb = main.a == 0 ? main.rgb : main.rgb / main.a;
|
main.rgb = main.a < 0.001 ? main.rgb : main.rgb / main.a;
|
||||||
#else
|
#else
|
||||||
#if !defined(_LIGHT_AFFECTS_ADDITIVE)
|
#if !defined(_LIGHT_AFFECTS_ADDITIVE)
|
||||||
if (i.color.a == 0) {
|
if (i.color.a == 0) {
|
||||||
@ -149,10 +149,10 @@ Shader "Universal Render Pipeline/2D/Spine/Skeleton Lit" {
|
|||||||
|
|
||||||
#if !defined(_STRAIGHT_ALPHA_INPUT)
|
#if !defined(_STRAIGHT_ALPHA_INPUT)
|
||||||
// un-premultiply for additive lights in CombinedShapeLightShared, reapply afterwards
|
// un-premultiply for additive lights in CombinedShapeLightShared, reapply afterwards
|
||||||
tex.rgb = tex.a == 0 ? tex.rgb : tex.rgb / tex.a;
|
tex.rgb = tex.a < 0.001 ? tex.rgb : tex.rgb / tex.a; // < epsilon prevents imprecision issues on some HW.
|
||||||
#endif
|
#endif
|
||||||
half4 main = tex * i.color;
|
half4 main = tex * i.color;
|
||||||
#endif
|
#endif
|
||||||
half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, i.uv);
|
half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, i.uv);
|
||||||
#if UNITY_VERSION < 202120
|
#if UNITY_VERSION < 202120
|
||||||
return half4(CombinedShapeLightShared(half4(main.rgb, 1), mask, i.lightingUV).rgb * main.a, main.a);
|
return half4(CombinedShapeLightShared(half4(main.rgb, 1), mask, i.lightingUV).rgb * main.a, main.a);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.urp-shaders",
|
"name": "com.esotericsoftware.spine.urp-shaders",
|
||||||
"displayName": "Spine Universal RP 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.2.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
|
"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.2.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
|
||||||
"version": "4.2.34",
|
"version": "4.2.35",
|
||||||
"unity": "2019.3",
|
"unity": "2019.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user