szymski

Untitled

Aug 27th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. local function StencilStart()
  2. render.ClearStencil()
  3. render.SetStencilEnable( true )
  4. render.SetStencilWriteMask( 1 )
  5. render.SetStencilTestMask( 1 )
  6. render.SetStencilFailOperation( STENCILOPERATION_KEEP )
  7. render.SetStencilZFailOperation( STENCILOPERATION_KEEP )
  8. render.SetStencilPassOperation( STENCILOPERATION_REPLACE )
  9. render.SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_ALWAYS )
  10. render.SetStencilReferenceValue( 1 )
  11. render.SetColorModulation( 1, 1, 1 )
  12. end
  13.  
  14. local function StencilReplace()
  15. render.SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_EQUAL )
  16. render.SetStencilPassOperation( STENCILOPERATION_REPLACE )
  17. render.SetStencilReferenceValue(1)
  18. end
  19.  
  20. local function StencilEnd()
  21. render.SetStencilEnable( false )
  22. end
Add Comment
Please, Sign In to add comment