Skip to content

Commit 6b1801f

Browse files
author
AleMC
committed
Revert "Apply FadeToBlack in URP Particle and Sprite shaders (Unity-Technologies#12)"
This reverts commit 0789ca0.
1 parent 7507d58 commit 6b1801f

File tree

5 files changed

+2
-44
lines changed

5 files changed

+2
-44
lines changed

com.unity.render-pipelines.universal/Shaders/2D/Sprite-Lit-Default.shader

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ Shader "Universal Render Pipeline/2D/Sprite-Lit-Default"
6565
half4 _MainTex_ST;
6666
half4 _NormalMap_ST;
6767

68-
// (ASG) Support fading to black.
69-
float _FadeToBlack;
70-
7168
#if USE_SHAPE_LIGHT_TYPE_0
7269
SHAPE_LIGHT(0)
7370
#endif
@@ -104,12 +101,8 @@ Shader "Universal Render Pipeline/2D/Sprite-Lit-Default"
104101
{
105102
half4 main = i.color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
106103
half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, i.uv);
107-
half4 color = CombinedShapeLightShared(main, mask, i.lightingUV);
108-
109-
// (ASG) Apply fade to black.
110-
color.rgb *= _FadeToBlack; // Fading happens in linear color to fade bright spots last
111104

112-
return color;
105+
return CombinedShapeLightShared(main, mask, i.lightingUV);
113106
}
114107
ENDHLSL
115108
}
@@ -201,9 +194,6 @@ Shader "Universal Render Pipeline/2D/Sprite-Lit-Default"
201194
SAMPLER(sampler_MainTex);
202195
float4 _MainTex_ST;
203196

204-
// (ASG) Support fading to black.
205-
float _FadeToBlack;
206-
207197
Varyings UnlitVertex(Attributes attributes)
208198
{
209199
Varyings o = (Varyings)0;
@@ -220,10 +210,6 @@ Shader "Universal Render Pipeline/2D/Sprite-Lit-Default"
220210
float4 UnlitFragment(Varyings i) : SV_Target
221211
{
222212
float4 mainTex = i.color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
223-
224-
// (ASG) Apply fade to black.
225-
mainTex.rgb *= _FadeToBlack; // Fading happens in linear color to fade bright spots last
226-
227213
return mainTex;
228214
}
229215
ENDHLSL

com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitForwardPass.hlsl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ half4 ParticlesLitFragment(VaryingsParticle input) : SV_Target
123123
half4 color = UniversalFragmentPBR(inputData, surfaceData);
124124
color.rgb = MixFog(color.rgb, inputData.fogCoord);
125125

126-
// (ASG) Apply global fade to black.
127-
color.rgb *= _FadeToBlack; // Fading happens in linear color to fade bright spots last
128-
129126
// (ASG) Add tonemapping and color grading in forward pass.
130127
// This uses the same color grading function as the post processing shader.
131128
#ifdef _COLOR_TRANSFORM_IN_FORWARD

com.unity.render-pipelines.universal/Shaders/Particles/ParticlesLitInput.hlsl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ float4 _UserLut_Params;
2929
TEXTURE2D(_UserLut);
3030
TEXTURE2D(_InternalLut);
3131
SAMPLER(sampler_LinearClamp);
32+
float _TestParam;
3233

3334
#endif
3435

35-
// (ASG) Support fading to black.
36-
float _FadeToBlack;
37-
3836
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Particles.hlsl"
3937

4038
TEXTURE2D(_MetallicGlossMap); SAMPLER(sampler_MetallicGlossMap);

com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitForwardPass.hlsl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,6 @@ half4 fragParticleUnlit(VaryingsParticle input) : SV_Target
112112
result = MixFog(result, fogFactor);
113113
albedo.a = OutputAlpha(albedo.a, _Surface);
114114

115-
// (ASG) Apply global fade to black.
116-
result.rgb *= _FadeToBlack; // Fading happens in linear color to fade bright spots last
117-
118-
// (ASG) Add tonemapping and color grading in forward pass.
119-
// This uses the same color grading function as the post processing shader.
120-
#ifdef _COLOR_TRANSFORM_IN_FORWARD
121-
color.rgb = ApplyColorGrading(result.rgb, _Lut_Params.w, TEXTURE2D_ARGS(_InternalLut, sampler_LinearClamp), _Lut_Params.xyz, TEXTURE2D_ARGS(_UserLut, sampler_LinearClamp), _UserLut_Params.xyz, _UserLut_Params.w);
122-
#endif
123-
124115
return half4(result, albedo.a);
125116
}
126117

com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlitInput.hlsl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,6 @@ CBUFFER_START(UnityPerMaterial)
1818
half _Surface;
1919
CBUFFER_END
2020

21-
// (ASG) Used when tonemapping and color grading is done in the forward pass.
22-
#ifdef _COLOR_TRANSFORM_IN_FORWARD
23-
24-
float4 _Lut_Params;
25-
float4 _UserLut_Params;
26-
TEXTURE2D(_UserLut);
27-
TEXTURE2D(_InternalLut);
28-
SAMPLER(sampler_LinearClamp);
29-
30-
#endif
31-
32-
// (ASG) Support fading to black.
33-
float _FadeToBlack;
34-
3521
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Particles.hlsl"
3622

3723
#define SOFT_PARTICLE_NEAR_FADE _SoftParticleFadeParams.x

0 commit comments

Comments
 (0)