/*============================================================================= ModShadowVolumePixelShader.usf: Pixel shader for modulated shadow volumes Copyright 1998-2010 Epic Games, Inc. All Rights Reserved. =============================================================================*/ #include "Common.usf" #include "ModShadowCommon.usf" void Main( in float4 ScreenPosition : TEXCOORD0, // BIOSTART - September 15, 2010 - Wihlidal, Graham - PS3 Fragment and Vertex Shader Optimizations out half4 OutColor : SV_Target0 // BIOEND ) { half SceneW = PreviousDepth(ScreenPosition); #if MODSHADOW_LIGHTTYPE_DIRECTIONAL // no attenuation necessary for directional lights half ShadowAtt = 1; #else // attenuate between shadow color and white based on distance half ShadowAtt = ShadowAttenuation(ScreenPosition,SceneW); #endif // add modulated/attenuated shadow color to shadow // BIOSTART - September 15, 2010 - Wihlidal, Graham - PS3 Fragment and Vertex Shader Optimizations half4 ShadowedColor = lerp(half4(1,1,1,1),ShadowModulateColor,ShadowAtt); // BIOEND // RETURN_COLOR not needed with modulative blending OutColor = ShadowedColor; }