|
@@ -65,7 +65,7 @@ half3 LightweightLightVertexSimplified(float3 positionWS, half3 normalWS, out ha
|
|
|
additionalLightColor += ProcessLight(positionWS, normalWS, meshRenderingLayers, lightIndex);
|
|
|
}
|
|
|
#else // !USE_FORWARD_PLUS
|
|
|
- int pixelLightCount = GetAdditionalLightsCount();
|
|
|
+ uint pixelLightCount = GetAdditionalLightsCount();
|
|
|
LIGHT_LOOP_BEGIN_SPINE(pixelLightCount)
|
|
|
additionalLightColor += ProcessLight(positionWS, normalWS, meshRenderingLayers, lightIndex);
|
|
|
LIGHT_LOOP_END_SPINE
|
|
@@ -84,9 +84,9 @@ half3 LightweightLightFragmentSimplified(float3 positionWS, float2 positionCS, h
|
|
|
InputData inputData; // LIGHT_LOOP_BEGIN macro requires InputData struct in USE_FORWARD_PLUS branch
|
|
|
inputData.positionWS = positionWS;
|
|
|
inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(positionCS);
|
|
|
-
|
|
|
+
|
|
|
uint meshRenderingLayers = GetMeshRenderingLayerBackwardsCompatible();
|
|
|
- int pixelLightCount = GetAdditionalLightsCount();
|
|
|
+ uint pixelLightCount = GetAdditionalLightsCount();
|
|
|
LIGHT_LOOP_BEGIN_SPINE(pixelLightCount)
|
|
|
additionalLightColor += ProcessLight(positionWS, normalWS, meshRenderingLayers, lightIndex);
|
|
|
LIGHT_LOOP_END_SPINE
|
|
@@ -124,7 +124,7 @@ VertexOutput vert(appdata v) {
|
|
|
if (color.a == 0) {
|
|
|
o.color = color;
|
|
|
#if defined(SKELETONLIT_RECEIVE_SHADOWS)
|
|
|
- o.shadowedColor = color;
|
|
|
+ o.shadowedColor = color.rgb;
|
|
|
o.shadowCoord = float4(0, 0, 0, 0);
|
|
|
#endif
|
|
|
return o;
|
|
@@ -169,9 +169,11 @@ half4 frag(VertexOutput i
|
|
|
// USE_FORWARD_PLUS lights need to be processed in fragment shader,
|
|
|
// otherwise light culling by vertex will create a very bad lighting result.
|
|
|
half3 shadowedColor;
|
|
|
- i.color.rgb += LightweightLightFragmentSimplified(i.positionWS, i.pos, i.normalWS, shadowedColor);
|
|
|
+ i.color.rgb += LightweightLightFragmentSimplified(i.positionWS, i.pos.xy, i.normalWS, shadowedColor);
|
|
|
+#if defined(SKELETONLIT_RECEIVE_SHADOWS)
|
|
|
i.shadowedColor += shadowedColor;
|
|
|
#endif
|
|
|
+#endif
|
|
|
|
|
|
#if defined(SKELETONLIT_RECEIVE_SHADOWS)
|
|
|
half shadowAttenuation = MainLightRealtimeShadow(i.shadowCoord);
|