User:JacobsDevelop/GlowArticle: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(seems finished)
Tag: Replaced
 
(13 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{WIP|[[User:JacobsDevelop|JacobsDevelop]] ([[User talk:JacobsDevelop|talk]])}}
{{messagebox|text=This was a "prototype" page for grand rework of [[TF2_Glow_Effect_(2013_SDK)|this page]]. Now it's just there}}
 
__FORCETOC__
 
=Activation=
 
* Add {{Key|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''':
 
<source lang=cpp>
g_GlowObjectManager.RenderGlowEffects( pSetup, 0 );
</source>
 
 
'''Materials Required:'''
[https://www.dropbox.com/s/ltyomrglekrhriv/sdk2013_tf2_glowoutlinematerials.zip?dl=0 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):
 
<source lang=cpp>
CLIENTEFFECT_REGISTER_BEGIN( PrecachePostProcessingEffectsGlow )
CLIENTEFFECT_MATERIAL( "dev/glow_color" )
CLIENTEFFECT_MATERIAL( "dev/halo_add_to_screen" )
CLIENTEFFECT_REGISTER_END_CONDITIONAL( engine->GetDXSupportLevel() >= 90 )
</source>
 
Don't forget to add the include defintion for the precache system!
<source lang=cpp>
#include "clienteffectprecachesystem.h"
</source>
 
=(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=
 
If you followed [[#.28Optional.29_Transferring_getters_and_setters_from_CBaseCombatCharacter|this step]]
 
To start a glow, call:
<source lang=cpp>
myObject->AddGlowEffect(); //Make it glow
</source>
 
To update a glow, call:
<source lang=cpp>
myObject->UpdateGlowEffect(); //Update glow
</source>
 
To stop a glow, call:
<source lang=cpp>
myObject->RemoveGlowEffect(); //Make it stop glowing
</source>
 
[[Category:Programming]]
[[Category:Snippets]]

Latest revision as of 20:04, 21 April 2025