#ifdef CUSTOMIZING

float4 vPrimaryColor : DIFFUSE 
<
	string Usage = "PrimaryColor";
	int _unitID = 0;	// compatibility with igIniShaderFactory approach
	string UIWidget = "color";
	string UIName = "Primary color used where mask texture is red";
>
= {1.f, 0.f, 0.f, 1.f };

float4 vSecondaryColor : DIFFUSE 
<
	string Usage = "SecondaryColor";
	int _unitID = 1;	// compatibility with igIniShaderFactory approach
	string UIWidget = "color";
	string UIName = "Secondary color used where mask texture is green";
>
= {0.f, 1.f, 0.f, 1.f };

float4 vSkinColor : DIFFUSE
<
	string Usage = "SkinColor";
	int _unitID = 2;	// compatibility with igIniShaderFactory approach
	string UIWidget = "color";
	string UIName = "Skin color";
>
= {1.f, 0.0f, 0.0f, 1.f };

// uv offset and scale
//
extern float4 vUVOffset <
	string Usage = "UVOffset";
	int _unitID = 3;	// compatibility with igIniShaderFactory approach
> = { 0.f, 0.f, 0.f, 0.f };

extern float4 vUVScale <
	string Usage = "UVScale";
	int _unitID = 4;	// compatibility with igIniShaderFactory approach
> = { 1.f, 1.f, 1.f, 1.f };

#endif

//
// Rim light constants
//

float4 vRimLightColor : Diffuse
<
  string Usage = "pbs.rimlight.avatar.color";
  string UIName = "Avatar Rim Light Color";
  string Object = "DirectionalLight";
> = {1.0f, 0.0f, 0.0f, 1.0f};

float4 vRimLightDirectionObject : Direction
<
	string Usage = "pbs.rimlight.avatar.direction";
	string Object = "DirectionalLight";
	string Space = "WorldToObjectDirection";
	bool Normalize = true;
> = {1.0f, -1.0f, 1.0f, 0.0f};

float4 vRimLightDirectionWorld : Direction
<
	string Usage = "pbs.rimlight.avatar.direction";
	string Object = "DirectionalLight";
> = {1.0f, -1.0f, 1.0f, 0.0f};

//
// float attrs and constants
//

// light wrapping factor
//
float fLightWrap
<
	string Usage = "LightWrap";
	int _unitID = 0;	// compatibility with igIniShaderFactory approach
	string UIWidget = "slider";
	float UIMin = 0.0;
	float UIMax = 1.0;
	float UIStep = 0.1;
	string UIName = "light wrap factor";
> = 0.f;

// specular coef
//
float fSpecCoef : SpecularPower
<
	string Usage = "SpecularCoef";
	int _unitID = 1;	// compatibility with igIniShaderFactory approach
	string UIWidget = "slider";
	float UIMin = 1.0;
	float UIMax = 128.0;
	float UIStep = 1.0;
	string UIName = "specular power coefficient";
> = 30.0;
 
// specular amount coefficient used by characterAlpha.fx
float fSpecularAmount
<
	string Usage = "SpecularValue";
	int _unitID = 2;
	string UIWidget = "slider";
	float UIMin = 0.;
	float UIMax = 100.0;
	float UIStep = 1.0;
	string UIName = "specular amount";
> = 50.0;

// texture bindings
//
//------------------------------------
// basetexture - 3 colors plus specular map (alpha channel)
texture baseTexture : Diffuse
<
	string Usage = "BaseTexture";
	int _unitID = 0;	// compatibility with igIniShaderFactory approach
	string ResourceName = "default_color.dds";
	string UIName = "Base Texture (3 colors plus gloss map)";
>;

sampler baseTextureSampler = sampler_state 
{
	texture = <baseTexture>;
	AddressU  = WRAP;		  
	AddressV  = WRAP;
	AddressW  = WRAP;
	MIPFILTER = LINEAR;
	MINFILTER = LINEAR;
	MAGFILTER = LINEAR;
};


// normal map, in tangent-space
texture normalTexture : Diffuse
<
	string Usage = "NormalMap";
	int _unitID = 1;	// compatibility with igIniShaderFactory approach
	string ResourceName = "default_bump_normal.dds";
	string UIName = "tangent-space normal map";
>;

sampler2D normalMapSampler = sampler_state {
	Texture = <normalTexture>;
	MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
	AddressU = Wrap;
	AddressV = Wrap;
};

#ifdef CUSTOMIZING
// mask texture, R is primary, G is secondary
texture maskTexture : Diffuse
<
	string Usage = "MaskTexture";
	int _unitID = 2;	// compatibility with igIniShaderFactory approach
	string ResourceName = "default_color.dds";
	string UIName = "Mask Texture - red is primary, green is secondary";
>
;
sampler2D maskTextureSampler = sampler_state {
	Texture = <maskTexture>;
	MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
	AddressU = Wrap;
	AddressV = Wrap;
};
#endif


#ifdef USING_RAMP
texture rampTexture : Diffuse
<
	string Usage = "RampMap";
	int _unitID = 3;	// compatibility with igIniShaderFactory approach
	string ResourceName = "default_color.dds";
	string UIName = "1D ramp map for lighting";
>;

sampler2D rampTextureSampler = sampler_state {
	Texture = <rampTexture>;
	MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
	AddressU = Clamp;
	AddressV = Clamp;
};
#endif


// Some extra light constants
//
float4 vPointLightPosObject : Position <
	string Usage = "pbs.avatar.lightPosition";
	string Object = "PointLight";
	string Space = "WorldToObject";
> = { 1.f, 1.f, 1.f, 1.f };

float4 vPointLightPosWorld : Position <
	string Usage = "pbs.avatar.lightPosition";
	string Object = "PointLight";
> = { 1.f, 1.f, 1.f, 1.f };

// [characterLightColor]
float4 vPointLightColor : Diffuse <
	string Usage = "pbs.avatar.lightColor";
	string Object = "PointLight";
> = {1.f, 1.f, 1.f, 1.f};

// [characterLightMaxDistance]
float fPointLightMaxDistance : LightRange <
	string Usage = "pbs.avatar.lightDistance";
	string Object = "PointLight";
> = 1000.f;



//
// Bone matrix palette for skinning.
//
#define MAX_PALETTE_SIZE 68
#pragma pack_matrix (row_major)
float3x4 Bones[ MAX_PALETTE_SIZE] <
	string Usage = "matrix.blending";
	string Object = "AVATAR";
>;

texture GlowInitialTexture <
	int _unitID = 0;
>;

texture GlowBlurredTexture <
	int _unitID = 1;
>;

sampler samplerGlowBlurred = sampler_state {
	texture = <GlowBlurredTexture>;
    MinFilter = LINEAR;
    MagFilter = LINEAR;

};

sampler samplerGlow = sampler_state {
	texture = <GlowInitialTexture>;
    MinFilter = LINEAR;
    MagFilter = LINEAR;

};

float glowRange <
	string Usage = "pbs.glow.glowRange";
> = 40.0;

float3 glowBlurColor <
	string Usage = "pbs.glow.blurColor";
>;

float4 ghostAmbient <
	string Usage = "pbs.glow.ghostAmbient";
>;

