Difference between revisions of "TF2 Glow Effect (2013 SDK)"
Beerdude26 (talk | contribs) m |
Beerdude26 (talk | contribs) m |
||
Line 27: | Line 27: | ||
<source lang=cpp> | <source lang=cpp> | ||
myObject->AddGlowEffect(); //Make it glow | myObject->AddGlowEffect(); //Make it glow | ||
+ | </source> | ||
+ | |||
+ | To update a glow, call: | ||
+ | <source lang=cpp> | ||
+ | myObject->UpdateGlowEffect(); //Update glow | ||
</source> | </source> | ||
Revision as of 02:23, 8 April 2014
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 );
- Create a .VMT file in /materials/dev/ called "glow_color.vmt" with the following contents:
UnlitGeneric
{
$basetexture red
$ignorez 1
$model 1
$linearwrite 1
}
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.
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