#ifndef _RUSHADER_D3D_PAPERDOLL_H_
#define _RUSHADER_D3D_PAPERDOLL_H_

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

#pragma unmanaged

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

/* 
	SHADER CONSTANTS
	----------------

	Base pixel shader constants breakdown:

	[  2 -   2] Layer 0 color
	[  3 -   3] Layer 1 color
	[  4 -   4] Layer 2 color
	[  5 -   5] Layer 3 color

*/
class CRuShader_Paperdoll_SH9_Gloss : public CRuShader_Static_Base
{
public:
											CRuShader_Paperdoll_SH9_Gloss(CRuEngineD3D *engine);
	virtual									~CRuShader_Paperdoll_SH9_Gloss();

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

	// Rendering setup
	virtual void							BeginPass(INT32 passNumber);
	virtual void							EndPass(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_Paperdoll_SH9_Gloss::GetShaderName() const
{
	return "ruSHADER_PAPERDOLL_SH9_GLOSS";
}

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

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

inline INT32 CRuShader_Paperdoll_SH9_Gloss::GetNumSamplers(INT32 passNumber) const
{
	return 4;
}

inline RuTextureChannel CRuShader_Paperdoll_SH9_Gloss::GetTextureChannel(INT32 passNumber, INT32 samplerNumber) const
{
	switch(passNumber)
	{
		case 0:
			{
				switch(samplerNumber)
				{
					case 0:	return ruTEXCHANNEL_DIFFUSEMAP;
					case 1:	return ruTEXCHANNEL_PAPERDOLL_MASK_COMPOSITE;
					case 2:	return ruTEXCHANNEL_PAPERDOLL_COLORMAP;
					case 3:	return ruTEXCHANNEL_GLOSSMAP;
				}
			}

			break;
	}

	return ruTEXCHANNEL_INVALID;
}

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

#pragma managed

#endif
