L4D Glow Effect.h

From Valve Developer Community
Revision as of 18:08, 27 November 2009 by Killermonkey (talk | contribs) (Created page with 'Copy and paste this code into a file called ge_screeneffects.h into ''SourceSDKCode_Dir''\game\client\ <script lang=cpp> ///////////// Copyright © 2009, Goldeneye: Source. All …')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Copy and paste this code into a file called ge_screeneffects.h into SourceSDKCode_Dir\game\client\

<script lang=cpp> ///////////// Copyright © 2009, Goldeneye: Source. All rights reserved. ///////////// // // File: ge_screeneffects.h // Description: // Post process effects for GoldenEye: Source // // Created On: 25 Nov 09 // Created By: Jonathan White <killermonkey> /////////////////////////////////////////////////////////////////////////////

  1. ifndef GE_SCREENSPACEEFFECTS_H
  2. define GE_SCREENSPACEEFFECTS_H
  3. ifdef _WIN32
  4. pragma once
  5. endif
  1. include "ScreenSpaceEffects.h"

class CEntGlowEffect : public IScreenSpaceEffect { public: CEntGlowEffect( void ) { };

virtual void Init( void ); virtual void Shutdown( void ); virtual void SetParameters( KeyValues *params ) {}; virtual void Enable( bool bEnable ) {}; virtual bool IsEnabled( void ) { return true; }

virtual void RegisterEnt( EHANDLE hEnt, Color glowColor = Color(255,255,255,64), float fGlowScale = 1.0f ); virtual void DeregisterEnt( EHANDLE hEnt );

virtual void SetEntColor( EHANDLE hEnt, Color glowColor ); virtual void SetEntGlowScale( EHANDLE hEnt, float fGlowScale );

virtual void Render( int x, int y, int w, int h );

protected: int FindGlowEnt( EHANDLE hEnt ); void RenderToStencil( int idx, IMatRenderContext *pRenderContext ); void RenderToGlowTexture( int idx, IMatRenderContext *pRenderContext );

private: struct sGlowEnt { EHANDLE m_hEnt; float m_fColor[4]; float m_fGlowScale; };

CUtlVector<sGlowEnt*> m_vGlowEnts;

CTextureReference m_GlowBuff1; CTextureReference m_GlowBuff2;

CMaterialReference m_WhiteMaterial; CMaterialReference m_EffectMaterial;

CMaterialReference m_BlurX; CMaterialReference m_BlurY; };

  1. endif

</script>