User:JacobsDevelop/GlowArticle: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 29: Line 29:


== (Optional) Transferring getters and setters from CBaseCombatCharacter ==
== (Optional) Transferring getters and setters from CBaseCombatCharacter ==
{{Important|This part is quite long, but fortunately most of this part is just copying/pasting code from one file to another with small changes}}


== Usage ==
== Usage ==


Objects derived from CBaseEntity are able to glow, but setters and getters for the glow effect only appear to be defined from CBaseCombatCharacter onwards.
If you followed [[


To start a glow, call:  
To start a glow, call:  

Revision as of 11:40, 22 April 2022

Template:WIP

Activation

  • Add GLOWS_ENABLE to the preprocessor directives on your client and server projects (don't forget to add it for release and debug, too!)
  • Add the following line to ClientModeShared::DoPostScreenSpaceEffects:
g_GlowObjectManager.RenderGlowEffects( pSetup, 0 );


Materials Required: SDK2013_TF2_GlowOutlineMaterials.zip


  • Precache the effect by placing this code in clientmode_shared.cpp (search for other references of CLIENTEFFECT_REGISTER_BEGIN for usage example):
CLIENTEFFECT_REGISTER_BEGIN( PrecachePostProcessingEffectsGlow )
CLIENTEFFECT_MATERIAL( "dev/glow_color" )
CLIENTEFFECT_MATERIAL( "dev/halo_add_to_screen" )
CLIENTEFFECT_REGISTER_END_CONDITIONAL( engine->GetDXSupportLevel() >= 90 )

Don't forget to add the include defintion for the precache system!

#include "clienteffectprecachesystem.h"

(Optional) Transferring getters and setters from CBaseCombatCharacter

Icon-Important.pngImportant:This part is quite long, but fortunately most of this part is just copying/pasting code from one file to another with small changes

Usage

If you followed [[

To start a glow, call:

myObject->AddGlowEffect(); //Make it glow

To update a glow, call:

myObject->UpdateGlowEffect(); //Update glow

To stop a glow, call:

myObject->RemoveGlowEffect(); //Make it stop glowing