//
// Rain fragment shader
// PGR4-type rain
//

#include "../common/constants.cg"
#include "atmosphere.cg"
#include "lighting.cg"

// Vertex to pixel shader structure
struct v2p
{
  float3 tc0    : TEXCOORD0;
  float4 color  : TEXCOORD1;
};

void main(
  // In
  in v2p IN,

  // Out
  out float4 outColor : COLOR,
  out float  outDepth : DEPTH,
  // MRT support? Probably sends data to COLOR0 and COLOR1 if used
  
  // Constants
  uniform sampler2D baseMap : TEXUNIT0
)
{
#ifdef USE_LOG_Z_FS
  outDepth=IN.tc0.z;
#endif

  // Get rain/snow texture and modulate with alpha
  outColor=tex2D(baseMap,IN.tc0.xy)*IN.color;
}
