My Project
GlowEffect.h
1 #pragma once
2 
3 namespace ParaEngine
4 {
11  {
12  public:
13  CGlowEffect(void);
14  ~CGlowEffect(void);
15  public:
16  HRESULT InvalidateDeviceObjects(); // called just before device is Reset
17  HRESULT RestoreDeviceObjects(); // called when device is restored
18 
30  //the first and second parameter on longer stands for blend factor and we don't use bUseAlpha any more;
31  //fGlowThreshold : pixel intensity less than fGlowThreshold has no glow effect.
32  //fGlowAmount is related to glow area size and weight usually between [0,10] , 0 means no glow --clayman 2011.7.19
33  HRESULT Render(float fGlowThreshold = 0.7f, float fGlowAmount= 2.0f, bool bUseAlpha = false);
34 
36  void SaveGlowTexturesToFile(const string& filename);
37  private:
39  LPDIRECT3DSURFACE9 m_pBackBuffer, m_pZBuffer;
40 
41  LPDIRECT3DTEXTURE9 m_pRTHalfSizeTexture;
42  LPDIRECT3DTEXTURE9 m_pRTGlowSourceTexture;
43  LPDIRECT3DTEXTURE9 m_pRTBlurHorizTexture;
44  LPDIRECT3DTEXTURE9 m_pRTBlurVertTexture; // usually same RT texture as m_pRTGlowSourceTexture
45 
46  LPDIRECT3DSURFACE9 m_pRTHalfSizeSurface;
47  LPDIRECT3DSURFACE9 m_pRTGlowSourceSurface;
48  LPDIRECT3DSURFACE9 m_pRTBlurHorizSurface;
49  LPDIRECT3DSURFACE9 m_pRTBlurVertSurface;
50 
51  float m_glowtextureWidth;
52  float m_glowtextureHeight;
53 
54  //calculate blurring texture coordinate offset --clayman 2011.7.19
55  void SetBlurEffectParameters(float dx,float dy,float blurAmount,CEffectFile* effect);
56  float ComputeGaussian(float n,float blurAmount);
57  };
58 
59 }
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: effect_file.h:323
implementation of the full screen glow effect.
Definition: GlowEffect.h:10
void SaveGlowTexturesToFile(const string &filename)
this is just for debugging purposes.
Definition: GlowEffect.cpp:341
HRESULT Render(float fGlowThreshold=0.7f, float fGlowAmount=2.0f, bool bUseAlpha=false)
apply the full screen glow effect to the current render target.
Definition: GlowEffect.cpp:97