#ifndef _RUSHADER_D3D_SKINNED_FX_H_
#define _RUSHADER_D3D_SKINNED_FX_H_

// Rune system core
#include "../../Direct3D/Shader/RuShader_D3D_Base.h"

#pragma managed(push, off)

// ************************************************************************************************************************************************************

class CRuShader_Skin_Z : public CRuShader_Skin_Base
{
public:
											CRuShader_Skin_Z(CRuEngineD3D *engine);
	virtual									~CRuShader_Skin_Z();

	// Shader capabilities query
	virtual const char*						GetShaderName() const;
	virtual INT32							GetShaderPriority() const;
	virtual DWORD							GetCaps() const;

	// Rendering setup
	virtual void							BeginPass(INT32 passNumber);

	// Shader texture placement query
	virtual INT32							GetNumSamplers(INT32 passNumber) const;
	virtual RuTextureChannel				GetTextureChannel(INT32 passNumber, INT32 samplerNumber) const;

	// Shader parameter setup
	virtual void							SetParameters(const CRuParameterCache *paramCache);
};

// ************************************************************************************************************************************************************

class CRuShader_Skin_Unshaded : public CRuShader_Skin_Base
{
public:
											CRuShader_Skin_Unshaded(CRuEngineD3D *engine);
	virtual									~CRuShader_Skin_Unshaded();

	// Shader capabilities query
	virtual const char*						GetShaderName() const;
	virtual INT32							GetShaderPriority() const;
	virtual DWORD							GetCaps() const;

	// Rendering setup
	virtual void							BeginPass(INT32 passNumber);

	// Shader texture placement query
	virtual INT32							GetNumSamplers(INT32 passNumber) const;
	virtual RuTextureChannel				GetTextureChannel(INT32 passNumber, INT32 samplerNumber) const;

	// Shader parameter setup
	virtual void							SetParameters(const CRuParameterCache *paramCache);
};

// ************************************************************************************************************************************************************

/* 
	SHADER CONSTANTS
	----------------
	[ 27 -  27] Highlight color

*/
class CRuShader_Skin_Highlight : public CRuShader_Skin_Base
{
public:
											CRuShader_Skin_Highlight(CRuEngineD3D *engine);
	virtual									~CRuShader_Skin_Highlight();

	// Shader capabilities query
	virtual const char*						GetShaderName() const;
	virtual INT32							GetShaderPriority() const;
	virtual DWORD							GetCaps() const;

	// Rendering setup
	virtual void							BeginPass(INT32 passNumber);

	// Shader texture placement query
	virtual INT32							GetNumSamplers(INT32 passNumber) const;
	virtual RuTextureChannel				GetTextureChannel(INT32 passNumber, INT32 samplerNumber) const;

	// Shader parameter setup
	virtual void							SetParameters(const CRuParameterCache *paramCache);
};

// ************************************************************************************************************************************************************

class CRuShader_Skin_CelHighlight : public CRuShader_Skin_Base
{
public:
											CRuShader_Skin_CelHighlight(CRuEngineD3D *engine);
	virtual									~CRuShader_Skin_CelHighlight();

	// Shader capabilities query
	virtual const char*						GetShaderName() const;
	virtual INT32							GetShaderPriority() const;
	virtual DWORD							GetCaps() const;

	// Rendering setup
	virtual void							BeginPass(INT32 passNumber);

	// Shader texture placement query
	virtual INT32							GetNumSamplers(INT32 passNumber) const;
	virtual RuTextureChannel				GetTextureChannel(INT32 passNumber, INT32 samplerNumber) const;

	// Shader parameter setup
	virtual void							SetParameters(const CRuParameterCache *paramCache);
};

// ************************************************************************************************************************************************************

inline const char *CRuShader_Skin_Z::GetShaderName() const
{
	return "ruSHADER_SKIN_Z";
}

inline INT32 CRuShader_Skin_Z::GetShaderPriority() const
{
	return 900;
}

inline DWORD CRuShader_Skin_Z::GetCaps() const
{
	return 0x00000000;
}

inline INT32 CRuShader_Skin_Z::GetNumSamplers(INT32 passNumber) const
{
	return 1;
}

inline RuTextureChannel CRuShader_Skin_Z::GetTextureChannel(INT32 passNumber, INT32 samplerNumber) const
{
	switch(passNumber)
	{
		case 0:
			{
				switch(samplerNumber)
				{
					case 0:	return ruTEXCHANNEL_DIFFUSEMAP;
				}
			}

			break;
	}

	return ruTEXCHANNEL_INVALID;
}

// ************************************************************************************************************************************************************

inline const char *CRuShader_Skin_Unshaded::GetShaderName() const
{
	return "ruSHADER_SKIN_UNSHADED";
}

inline INT32 CRuShader_Skin_Unshaded::GetShaderPriority() const
{
	return 1000;
}

inline DWORD CRuShader_Skin_Unshaded::GetCaps() const
{
	return 0x00000000;
}

inline INT32 CRuShader_Skin_Unshaded::GetNumSamplers(INT32 passNumber) const
{
	return 1;
}

inline RuTextureChannel CRuShader_Skin_Unshaded::GetTextureChannel(INT32 passNumber, INT32 samplerNumber) const
{
	switch(passNumber)
	{
		case 0:
			{
				switch(samplerNumber)
				{
					case 0:	return ruTEXCHANNEL_DIFFUSEMAP;
				}
			}

			break;
	}

	return ruTEXCHANNEL_INVALID;
}

// ************************************************************************************************************************************************************

inline const char *CRuShader_Skin_Highlight::GetShaderName() const
{
	return "ruSHADER_SKIN_HIGHLIGHT";
}

inline INT32 CRuShader_Skin_Highlight::GetShaderPriority() const
{
	return 1000;
}

inline DWORD CRuShader_Skin_Highlight::GetCaps() const
{
	return 0x00000000;
}

inline INT32 CRuShader_Skin_Highlight::GetNumSamplers(INT32 passNumber) const
{
	return 1;
}

inline RuTextureChannel CRuShader_Skin_Highlight::GetTextureChannel(INT32 passNumber, INT32 samplerNumber) const
{
	switch(passNumber)
	{
		case 0:
			{
				switch(samplerNumber)
				{
					case 0:	return ruTEXCHANNEL_DIFFUSEMAP;
				}
			}

			break;
	}

	return ruTEXCHANNEL_INVALID;
}

// ************************************************************************************************************************************************************

inline const char *CRuShader_Skin_CelHighlight::GetShaderName() const
{
	return "ruSHADER_SKIN_CELHIGHLIGHT";
}

inline INT32 CRuShader_Skin_CelHighlight::GetShaderPriority() const
{
	return 1000;
}

inline DWORD CRuShader_Skin_CelHighlight::GetCaps() const
{
	return 0x00000000;
}

inline INT32 CRuShader_Skin_CelHighlight::GetNumSamplers(INT32 passNumber) const
{
	return 0;
}

inline RuTextureChannel CRuShader_Skin_CelHighlight::GetTextureChannel(INT32 passNumber, INT32 samplerNumber) const
{
	return ruTEXCHANNEL_INVALID;
}

// ************************************************************************************************************************************************************

#pragma managed(pop)

#endif
