//
// Asura_Platform_FSFX_SM30.h
//
// Created by DJG 19/03/2007
// 
// Copyright (C) 2007 Rebellion (Derby), All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#if defined(ASURA_USE_FSFX)&&defined(ASURA_TARGET_SM3)

#ifndef __ASURA_PLATFORM_FSFX_SM30_H__
#define __ASURA_PLATFORM_FSFX_SM30_H__

#include "Rendering/Asura_Direct3D_Effect.h"

struct BloomVertex
{
	float fX,fY;
	float fU,fV;
};

struct ColourMapVertex
{
	float fX, fY;
	float fU, fV;
};

class Asura_Platform_FSFX_SM30
{
public:
	static void Platform_Initialise();
	static void Platform_Reset();
	static void Platform_Shutdown();

	static void  UpdateBlurredBuffer( const int iBlurPasses, const float fBlurRadius, const float fSaturation, bool bNearDepthOfField = false, float fDist0=0, float fDist1=0, float fBleedScale=1);
	static Direct3D_Texture const* GetBlurredBuffer(void);

	static Asura_Direct3D_Effect*			g_pxBloomEffect;
	static Direct3D_VertexDeclaration*		g_pxBloomVertexDecl;

	static Asura_Direct3D_Effect*			g_pxColourMapEffect;
	static Direct3D_VertexDeclaration*		g_pxColourMapVertexDecl;

	static Asura_Direct3D_Effect*			g_pxDepthOfFieldEffect;

	// parameters for the bloom effect
	static D3DXHANDLE						g_xBloomEffectSourceTextureHandle;
	static D3DXHANDLE						g_xBloomEffectUVOffsetHandle;
	static D3DXHANDLE						g_xBloomEffectExtractBrightBitsHandle;
	static D3DXHANDLE						g_xBloomEffectSaturationHandle;
	static D3DXHANDLE						g_xBloomEffectOutputColourHandle;
	static D3DXHANDLE						g_xBloomEffectInputThresholdHandle;
	static D3DXHANDLE						g_xBloomEffectBlurHandle;
	static D3DXHANDLE						g_xBloomEffectInputScaleHandle;
	static D3DXHANDLE						g_xBloomEffectAccumulateHandle;
	static D3DXHANDLE						g_xBloomEffectAccumFadeHandle;
	static D3DXHANDLE						g_xBloomEffectAccumTextureHandle;
	static D3DXHANDLE						g_xBloomEffectSecondaryUVOfsHandle;
	static float							g_fBloomEffectBlurBufferScale;

	static D3DXHANDLE						g_xBloomEffectDepthTextureHandle;
	static D3DXHANDLE						g_xBloomEffectExtractNearDepthOfFieldHandle;
	static D3DXHANDLE						g_xBloomEffectOneOverScreenDimensionsHandle;
	static D3DXHANDLE						g_xBloomEffectFocalDistancesHandle;

	// parameters for the colour map effect
	static D3DXHANDLE						g_xColourMapInitialImageHandle;
	static D3DXHANDLE						g_xColourMapHandle;
	static D3DXHANDLE						g_xColourMapIntensityHandle;

	// parameters for the depth of field effect
	static D3DXHANDLE						g_xDepthOfFieldEffectSourceTextureHandle;
	static D3DXHANDLE						g_xDepthOfFieldEffectDepthTextureHandle;
	static D3DXHANDLE						g_xDepthOfFieldEffectFocalDistances;
	static D3DXHANDLE						g_xDepthOfFieldEffectOneOverScreenDimensions;

};

#endif // ifndef __ASURA_PLATFORM_FSFX_SM30_H__


#endif // defined(ASURA_USE_FSFX)

