#include "Effect.h"
#include "MaterialStruct.h"

class PhongEffect :public Effect
{
	private:
	ID3D10Effect*						effect;
	ID3D10EffectTechnique*				technique;
	ID3D10EffectMatrixVariable*			modelMatrixVariable;
	ID3D10EffectMatrixVariable*			viewMatrixVariable;
	ID3D10EffectMatrixVariable*			projectionMatrixVariable;
	ID3D10EffectMatrixVariable*			lightViewMatrixVariable;
	ID3D10EffectMatrixVariable*			lightProjectionMatrixVariable;
	ID3D10EffectShaderResourceVariable*	diffuseTexture;
	ID3D10EffectShaderResourceVariable*	normalMapTexture;
	ID3D10EffectShaderResourceVariable*	shadowMap;
	ID3D10EffectVectorVariable*			eyePointVariable;
	ID3D10InputLayout*					vertexLayout;
	ID3D10EffectVariable*				materialVariable;
	ID3D10EffectScalarVariable*			hasNormalMapVariable;
	ID3D10EffectVariable*				pcfOffsetsVariable;
	

	public:
	HRESULT init();
	void setModelMatrix(D3DXMATRIX* modelMatrix);
	void setViewMatrix(D3DXMATRIX* viewMatrix);
	void setProjectionMatrix(D3DXMATRIX* projMatrix);
	void setDiffuseTexture(ID3D10ShaderResourceView* textureResrc);
	void setNormalMap(ID3D10ShaderResourceView* normalMapResrc);
	void setEyePoisition(D3DXVECTOR3* eye);
	void setLightViewMatrix(D3DXMATRIX* viewMatrix);
	void setLightProjectionMatrix(D3DXMATRIX* projMatrix);
	void setShadowMapTexture(ID3D10ShaderResourceView* textureResrc);
	ID3D10Effect* getEffectVariable();
	ID3D10EffectTechnique* getTechniqueVariable();
	void setMaterial(MaterialPack material);
	void setHasNormalMap(BOOL hasNormalMap);
	void setPCFOffsets(D3DXVECTOR2* pcfOffsets);
	void setInputLayout();
	~PhongEffect();
};