render.EnableClipping
Example
Properly using the function.
-- Inside some rendering hook
local oldclip = render.EnableClipping( true )
-- Your code here
render.EnableClipping( oldclip )
Example
Clips the lower half of your custom entity
function ENT:Draw()
local normal = self:GetUp() -- Everything "behind" this normal will be clipped
local position = normal:Dot( self:GetPos() ) -- self:GetPos() is the origin of the clipping plane
local oldEC = render.EnableClipping( true )
render.PushCustomClipPlane( normal, position )
self:DrawModel()
render.PopCustomClipPlane()
render.EnableClipping( oldEC )
end