utkutuzcu/tst / Engine /Shaders /CompilingShader-ModShadowMeshAttenuationPS.usf
utkutuzcu's picture
download
raw
1.63 kB
/*=============================================================================
ModShadowMeshAttenuationPS.usf: Mesh attenutation PS for modulated shadows
Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
=============================================================================*/
#include "Common.usf"
#include "Material.usf"
#include "VertexFactory.usf"
/** Used to update stencil values for areas we don't want modulated shadows */
void Main(
in FVertexFactoryInterpolants FactoryInterpolants,
in float3 TangentLightVector : TEXCOORD4,
in float3 CameraVector : TEXCOORD5,
in float4 PixelPosition : TEXCOORD6,
OPTIONAL_FacingSign
out float4 OutColor : COLOR0
)
{
FMaterialParameters MaterialParameters = GetMaterialParameters(FactoryInterpolants);
CalcMaterialParameters(MaterialParameters,FacingSign,CameraVector,PixelPosition,TangentLightVector);
// N*L attenuation clamped to full. Only render if backfacing wrt light direction
half NdotL = dot(MaterialParameters.TangentLightVector,MaterialParameters.TangentNormal);
half Atten = 1-ceil(saturate(NdotL));
#if XBOX
BRANCH
#endif
if( Atten < 1 )
{
// clamp emissive color to 0 if < 1
half3 EmissiveColor = floor(GetMaterialEmissive(MaterialParameters));
// if any emissive color channel is >= 1 then it will be rendered
half EmissiveTotal = saturate(EmissiveColor.r + EmissiveColor.g + EmissiveColor.b);
Atten += EmissiveTotal;
}
// color writes are disabled but useful for debug
OutColor.rgb = half3(0,Atten,0);
// alpha test with a ref value of 0 is used to clip
OutColor.a = Atten;
}

Xet Storage Details

Size:
1.63 kB
·
Xet hash:
d81d64d9894ff0c35e1774130a8c3847580bd904b7eb1cea6c9576f6b532d7e6

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.