render.EnableClipping

From GMod Wiki

Jump to: navigation, search
Function
Syntax render.EnableClipping( Boolean Enabled )
Where is this used?
Description:
Enables or disables the use of clipping planes.
Returns: Boolean Previous state
Part of Library: render
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Render.EnableClipping]Render.EnableClipping [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionEnables clipping and draws a model with a clipping plane.
Used onNewerClient.png
Code
local normal = Vector( 0, 0, 1 );
local distance = normal:Dot( vector_origin );
 
local alreadyClipping = render.EnableClipping( true );
render.PushCustomClipPlane( normal, distance );
self:DrawModel();
render.PopCustomClipPlane();
render.EnableClipping( alreadyClipping ); -- We must not disable clipping if there is already clipping ongoing.
OutputN/A

Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox