[unity] Fixed SRP batching support at Sprite shader of URP and LWRP shaders, with enabled rim light they were not compatible. See #1813.

This commit is contained in:
Harald Csaszar 2020-12-09 13:37:59 +01:00
parent 7ac47d191c
commit 473caafd00
3 changed files with 8 additions and 1 deletions

View File

@ -164,9 +164,10 @@ inline fixed3 calculateRampedDiffuse(fixed3 lightColor, float attenuation, float
// //
#ifdef _RIM_LIGHTING #ifdef _RIM_LIGHTING
#if !defined(USE_LWRP) && !defined(USE_URP)
uniform float _RimPower; uniform float _RimPower;
uniform fixed4 _RimColor; uniform fixed4 _RimColor;
#endif
inline fixed3 applyRimLighting(fixed3 posWorld, fixed3 normalWorld, fixed4 pixel) : SV_Target inline fixed3 applyRimLighting(fixed3 posWorld, fixed3 normalWorld, fixed4 pixel) : SV_Target
{ {

View File

@ -28,6 +28,9 @@ float _EmissionPower;
float4 _FixedNormal; float4 _FixedNormal;
float _RimPower;
half4 _RimColor;
CBUFFER_END CBUFFER_END
#endif // LIGHTWEIGHT_INPUT_SPRITE_INCLUDED #endif // LIGHTWEIGHT_INPUT_SPRITE_INCLUDED

View File

@ -28,6 +28,9 @@ float _EmissionPower;
float4 _FixedNormal; float4 _FixedNormal;
float _RimPower;
half4 _RimColor;
CBUFFER_END CBUFFER_END
#endif // URP_INPUT_SPRITE_INCLUDED #endif // URP_INPUT_SPRITE_INCLUDED