source: GTP/trunk/App/Demos/Illum/Standalone/Glow [DirectX]/ToneMap.h @ 846

Revision 846, 1.3 KB checked in by szirmay, 19 years ago (diff)
Line 
1#pragma once
2
3#include "QuadRendering.h"
4#include "DXUT.h"
5#include <D3dx9math.h>
6
7class ToneMap
8{
9private:
10        // Source HDR texture
11        LPDIRECT3DTEXTURE9 sourceTexture;
12        LPDIRECT3DSURFACE9 sourceTextureSurface;
13
14        // Target HDR Texture
15        LPDIRECT3DTEXTURE9 myRenderTexture;
16        LPDIRECT3DSURFACE9 myRenderTextureSurface;
17
18        // Luminance Texture
19        LPDIRECT3DTEXTURE9 myLuminanceTexture;
20        LPDIRECT3DSURFACE9 myLuminanceTextureSurface;
21
22        // Luminance Texture
23        LPDIRECT3DTEXTURE9 myAverageLuminanceTexture[2];
24        LPDIRECT3DSURFACE9 myAverageLuminanceTextureSurface[2];
25
26        // ToneMapping Effect
27        LPD3DXEFFECT myEffect;
28
29        D3DVERTEX_1 rttVertices[3];
30        LPDIRECT3DSURFACE9 rttDepthSurface;
31        LPDIRECT3DSURFACE9 rttDepthSurface_small;
32        IDirect3DVertexDeclaration9* textureDecl;
33        LPDIRECT3DVERTEXBUFFER9 pQuadVB;
34
35        LPDIRECT3DSURFACE9 backBuffer;
36        LPDIRECT3DSURFACE9 backBufferDepthSurface;
37
38        IDirect3DDevice9* pd3dDevice;
39
40        // Gain
41        float Gain;
42        float Passes;
43
44public:
45        ToneMap(void);
46        ~ToneMap(void);
47
48        HRESULT Init( IDirect3DDevice9* pd3dDevice, LPDIRECT3DTEXTURE9 sourceTexture, LPDIRECT3DSURFACE9 targetTextureSurface);
49        void SetSource(LPDIRECT3DTEXTURE9 sourceTexture);
50        void SetGain(float gain);
51        void SetPasses(float pass);
52        void Destroy();
53        void Map();
54};
Note: See TracBrowser for help on using the repository browser.