FILEVERSION = 2.3.0.0;
PLATFORM = DX9;

RENDER_STATE RSC_0 {
  blendingFromSurface = true;
  rasterizerstylefromsurface = true;
  trackingmask = 3840;

  //------ Blend State Group ------
  alphatestref = 100;
  alphatestfunc = less_or_equal;

  //------ Depth Stencil Group ------

  //------ Rasterizer State Group ------
  rst_flags = 9;

  //------ Tesselation State Group ------
}

RENDER_STATE RSC_1 {
  blendingFromSurface = true;
  rasterizerstylefromsurface = true;
  trackingmask = 3840;

  //------ Blend State Group ------
  alphatestref = 100;
  alphatestfunc = less_or_equal;

  //------ Depth Stencil Group ------

  //------ Rasterizer State Group ------
  rst_flags = 9;

  //------ Tesselation State Group ------
}

RENDER_STATE RSC_2 {
  blendingFromSurface = true;
  rasterizerstylefromsurface = true;
  trackingmask = 3840;

  //------ Blend State Group ------
  alphatestref = 100;
  alphatestfunc = less_or_equal;

  //------ Depth Stencil Group ------

  //------ Rasterizer State Group ------
  rst_flags = 9;

  //------ Tesselation State Group ------
}

SHADER Fullbright {
  RenderStateContainerID = 0;
  IsAutoGenerated = false;
  UsesPermutationVariables = false;
  streammask = 17;
  RecompilationRequiredOnPlatforms = 0;
  supportedplatforms = 551;
  compileflags = 0;
  hs_controlpoints = 3;

  //------ Texture samplers ------
  numsamplers_vs = 0;
  numsamplers_hs = 0;
  numsamplers_ds = 0;
  numsamplers_gs = 0;
  numsamplers_ps = 1;
  SAMPLER_PS 0 = {
    samplername = "";
    texturetype = base_texture;
    textureindex = 0;
    texturefile = "";
    filtermode = default;
    textureaddressmode = wrap,wrap,wrap;
    m_fLodBias = 0.000000;
    m_iMaxAnisotropy = 1;
    comparisonfunc = less;
    bordercolor = 0.000000,0.000000,0.000000,1.000000;
    minlod = 0.000000;
    maxlod = 1024.000000;
  }
  numsamplers_cs = 0;

  //------ vertex shader source ------

  vs_sourcecode=$SOURCECODETAG{
//
#include <Shaders/VisionCommon.inc>

#ifdef _VISION_DX11
cbuffer g_GlobalConstantBufferObject : register (b1)
{
  float4x4 matMVP : packoffset(c4);   // model view projection matrix
}
#else
  float4x4 matMVP : register(c8);
#endif

struct VS_IN
{
  float3 ObjPos : POSITION;
  float2 UV0    : TEXCOORD0;
};

struct VS_OUT
{
  float4 ProjPos : SV_Position;
  float2 UV0     : TEXCOORD0;
};

VS_OUT vs_main( VS_IN In )
{
  VS_OUT Out;
  Out.ProjPos = mul( matMVP, float4(In.ObjPos, 1.0f) );
  Out.UV0 = In.UV0;
  return Out;
}
  }$SOURCECODETAG

  vs_function = "vs_main";
  vs_mintarget = vs_2_0;
  vs_mintargetDX11 = vs_4_0_level_9_1;
  svs_mintarget = vs_2_0;
  svs_mintargetDX11 = vs_4_0_level_9_1;

  //------ hull shader source ------
  hs_mintarget = hs_5_0;

  //------ domain shader source ------
  ds_mintarget = ds_5_0;

  //------ geometry shader source ------
  gs_mintarget = gs_4_0;
  gs_mintargetDX11 = gs_4_0;

  //------ pixel shader source ------

  ps_sourcecode=$SOURCECODETAG{
//
#include <Shaders/VisionCommon.inc>

#ifdef _VISION_DX11
  Texture2D <float4> BaseTexture        : register(t0);
  sampler            BaseTextureSampler : register(s0);
#else
  sampler2D          BaseTexture        : register(s0);
#endif

struct PS_IN
{
  float4 ProjPos : SV_Position;
  float2 UV0     : TEXCOORD0;
};

float4 ps_main( PS_IN In ) : SV_Target
{
  return vTex2D(BaseTexture, BaseTextureSampler, In.UV0);
}
  }$SOURCECODETAG

  ps_function = "ps_main";
  ps_mintarget = ps_2_0;
  ps_mintargetDX11 = ps_4_0_level_9_1;

  //------ compute shader source ------
  cs_mintarget = cs_4_0;

  //------ platform specific bytecode ------
}

SHADER TintColor {
  RenderStateContainerID = 1;
  IsAutoGenerated = false;
  UsesPermutationVariables = false;
  streammask = 17;
  RecompilationRequiredOnPlatforms = 0;
  supportedplatforms = 551;
  compileflags = 0;
  hs_controlpoints = 3;

  //------ Texture samplers ------
  numsamplers_vs = 0;
  numsamplers_hs = 0;
  numsamplers_ds = 0;
  numsamplers_gs = 0;
  numsamplers_ps = 1;
  SAMPLER_PS 0 = {
    samplername = "";
    texturetype = base_texture;
    textureindex = 0;
    texturefile = "";
    filtermode = default;
    textureaddressmode = wrap,wrap,wrap;
    m_fLodBias = 0.000000;
    m_iMaxAnisotropy = 16;
    comparisonfunc = less;
    bordercolor = 0.000000,0.000000,0.000000,1.000000;
    minlod = 0.000000;
    maxlod = 1024.000000;
  }
  numsamplers_cs = 0;

  //------ vertex shader source ------

  vs_sourcecode=$SOURCECODETAG{
//
#include <Shaders/VisionCommon.inc>

#ifdef _VISION_DX11
cbuffer g_GlobalConstantBufferObject : register (b1)
{
  float4x4 matMVP : packoffset(c4);   // model view projection matrix
}
#else
  float4x4 matMVP : register(c8);
#endif

struct VS_IN
{
  float3 ObjPos  : POSITION;
  float2 UV0     : TEXCOORD0;
};

struct VS_OUT
{
  float4 ProjPos : SV_Position;
  float2 UV0     : TEXCOORD0;
};

VS_OUT vs_main( VS_IN In )
{
  VS_OUT Out;
  Out.ProjPos = mul( matMVP, float4(In.ObjPos, 1.0f) );
  Out.UV0 = In.UV0;
  return Out;
}
  }$SOURCECODETAG

  vs_function = "vs_main";
  vs_mintarget = vs_2_0;
  vs_mintargetDX11 = vs_4_0_level_9_1;
  svs_mintarget = vs_2_0;
  svs_mintargetDX11 = vs_4_0_level_9_1;

  //------ hull shader source ------
  hs_mintarget = hs_5_0;

  //------ domain shader source ------
  ds_mintarget = ds_5_0;

  //------ geometry shader source ------
  gs_mintarget = gs_4_0;
  gs_mintargetDX11 = gs_4_0;

  //------ pixel shader source ------

  ps_sourcecode=$SOURCECODETAG{
//
#include <Shaders/VisionCommon.inc>

#ifdef _VISION_DX11
  Texture2D <float4> BaseTexture        : register(t0);
  sampler            BaseTextureSampler : register(s0);

cbuffer g_GlobalConstantBufferUser : register (b2)
{
  float4             Color              : packoffset(c0);
}
#else
  sampler2D          BaseTexture        : register(s0);

  #if defined(_VISION_PS3) || defined(_VISION_PSP2) || defined(_VISION_GLES2) || defined(_VISION_WIIU)
    float4             Color              : register(c32);
  #else  
    float4             Color;
  #endif
#endif

struct PS_IN
{
  float4 ProjPos : SV_Position;
  float2 UV0     : TEXCOORD0;
};

float4 ps_main( PS_IN In ) : SV_Target
{
  return vTex2D(BaseTexture, BaseTextureSampler, In.UV0)*Color;
}
  }$SOURCECODETAG

  ps_function = "ps_main";
  ps_mintarget = ps_2_0;
  ps_mintargetDX11 = ps_4_0_level_9_1;

  //------ compute shader source ------
  cs_mintarget = cs_4_0;

  //------ platform specific bytecode ------
}

SHADER TintColorClip {
  RenderStateContainerID = 2;
  IsAutoGenerated = false;
  UsesPermutationVariables = false;
  streammask = 17;
  RecompilationRequiredOnPlatforms = 0;
  supportedplatforms = 551;
  compileflags = 0;
  hs_controlpoints = 3;

  //------ Texture samplers ------
  numsamplers_vs = 0;
  numsamplers_hs = 0;
  numsamplers_ds = 0;
  numsamplers_gs = 0;
  numsamplers_ps = 1;
  SAMPLER_PS 0 = {
    samplername = "";
    texturetype = base_texture;
    textureindex = 0;
    texturefile = "";
    filtermode = default;
    textureaddressmode = wrap,wrap,wrap;
    m_fLodBias = 0.000000;
    m_iMaxAnisotropy = 16;
    comparisonfunc = less;
    bordercolor = 0.000000,0.000000,0.000000,1.000000;
    minlod = 0.000000;
    maxlod = 1024.000000;
  }
  numsamplers_cs = 0;

  //------ vertex shader source ------

  vs_sourcecode=$SOURCECODETAG{
//
#include <Shaders/VisionCommon.inc>

#ifdef _VISION_DX11
cbuffer g_GlobalConstantBufferObject : register (b1)
{
  float4x4 matMVP : packoffset(c4);   // model view projection matrix
}
#else
  float4x4 matMVP : register(c8);
#endif

struct VS_IN
{
  float3 ObjPos  : POSITION;
  float2 UV0     : TEXCOORD0;
};

struct VS_OUT
{
  float4 ProjPos : SV_Position;
  float2 UV0     : TEXCOORD0;
};

VS_OUT vs_main( VS_IN In )
{
  VS_OUT Out;
  Out.ProjPos = mul( matMVP, float4(In.ObjPos, 1.0f) );
  Out.UV0 = In.UV0;
  return Out;
}
  }$SOURCECODETAG

  vs_function = "vs_main";
  vs_mintarget = vs_2_0;
  vs_mintargetDX11 = vs_4_0_level_9_1;
  svs_mintarget = vs_2_0;
  svs_mintargetDX11 = vs_4_0_level_9_1;

  //------ hull shader source ------
  hs_mintarget = hs_5_0;

  //------ domain shader source ------
  ds_mintarget = ds_5_0;

  //------ geometry shader source ------
  gs_mintarget = gs_4_0;
  gs_mintargetDX11 = gs_4_0;

  //------ pixel shader source ------

  ps_sourcecode=$SOURCECODETAG{
//
#include <Shaders/VisionCommon.inc>

#ifdef _VISION_DX11
  Texture2D <float4> BaseTexture        : register(t0);
  sampler            BaseTextureSampler : register(s0);

cbuffer g_GlobalConstantBufferUser : register (b2)
{
  float4             Color              : packoffset(c0);
  float              AlphaThreshold     : packoffset(c1);
}
#else
  sampler2D          BaseTexture        : register(s0);

  #if defined(_VISION_PS3) || defined(_VISION_PSP2) || defined(_VISION_GLES2) || defined(_VISION_WIIU)
    float4             Color              : register(c32);
    float              AlphaThreshold     : register(c33);
  #else  
    float4             Color;
    float              AlphaThreshold;
  #endif
#endif

struct PS_IN
{
  float4 ProjPos : SV_Position;
  float2 UV0     : TEXCOORD0;
};

float4 ps_main( PS_IN In ) : SV_Target
{
  float4 cColor = vTex2D(BaseTexture, BaseTextureSampler, In.UV0);
  clip(cColor.a - AlphaThreshold);
  return cColor * Color;
}
  }$SOURCECODETAG

  ps_function = "ps_main";
  ps_mintarget = ps_2_0;
  ps_mintargetDX11 = ps_4_0_level_9_1;

  //------ compute shader source ------
  cs_mintarget = cs_4_0;

  //------ platform specific bytecode ------
}

//////////////////////////////////////////////////////////////////////////////

EFFECT SimpleFullbright {
  DESCRIPTION = {"Full bright shader for non lit geometry"};
  TECHNIQUE "sm11"
  {
    passes="Fullbright";
    passtype = pre_basepass;
    IsPermutationTechnique=false;
    IsAutoGenerated=false;
  }
}

EFFECT TintColor {
  DESCRIPTION = {};
  PARAMCOMMENT={"Color","Color to tint the base texture","1,1,1,1",float4,color};
  TECHNIQUE "sm11"
  {
    passes="TintColor";
    passtype = pre_basepass;
    IsPermutationTechnique=false;
    IsAutoGenerated=false;
  }
}

EFFECT TintColorAlphaThreshold {
  DESCRIPTION = {};
  PARAMCOMMENT={"AlphaThreshold","","0.01",float,none};
  PARAMCOMMENT={"Color","","1,1,1,1",float4,color};
  TECHNIQUE "new_technique"
  {
    passes="TintColorClip";
    passtype = pre_basepass;
    IsPermutationTechnique=false;
    IsAutoGenerated=false;
  }
}

