Advertisement
keybode

source engine ForceMaterial

Jul 22nd, 2014
572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. void ForceMaterial ( Color color, IMaterial* material, bool useColor = true, bool forceMaterial = true )
  2. {
  3.     if ( useColor )
  4.     {
  5.         float temp[ 3 ] =
  6.         {
  7.             color.r (),
  8.             color.g (),
  9.             color.b ()
  10.         };
  11.  
  12.         float alpha = color.a ();
  13.  
  14.         m_pRenderView->SetBlend ( alpha );
  15.         m_pRenderView->SetColorModulation ( temp );
  16.     }
  17.  
  18.     if ( forceMaterial )
  19.         m_pModelRender->ForcedMaterialOverride ( material );
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement