mirror of
https://github.com/Sevii77/proper_clipping.git
synced 2025-03-04 03:13:04 -05:00
fix toolpreview
This commit is contained in:
parent
435b4594be
commit
ea967a3eb7
@ -321,6 +321,12 @@ if CLIENT then
|
|||||||
local color_green = Color(30, 255, 120, 190)
|
local color_green = Color(30, 255, 120, 190)
|
||||||
local color_green2 = Color(25, 200, 90, 100)
|
local color_green2 = Color(25, 200, 90, 100)
|
||||||
|
|
||||||
|
-- If we draw 2 models that are the same back to back with clips it freaks out
|
||||||
|
-- (it doesnt use to do this but idfk anymore)
|
||||||
|
-- this is drawn between the 2 and somehow fixes it (yay)
|
||||||
|
local model_fixer = ClientsideModel("models/error.mdl")
|
||||||
|
model_fixer:SetNoDraw(true)
|
||||||
|
|
||||||
local model1 = ClientsideModel("models/error.mdl")
|
local model1 = ClientsideModel("models/error.mdl")
|
||||||
local model2 = ClientsideModel("models/error.mdl")
|
local model2 = ClientsideModel("models/error.mdl")
|
||||||
model1:SetMaterial("models/debug/debugwhite")
|
model1:SetMaterial("models/debug/debugwhite")
|
||||||
@ -424,6 +430,8 @@ if CLIENT then
|
|||||||
DrawPreviewModel(model1)
|
DrawPreviewModel(model1)
|
||||||
render.PopCustomClipPlane()
|
render.PopCustomClipPlane()
|
||||||
|
|
||||||
|
model_fixer:DrawModel()
|
||||||
|
|
||||||
render.PushCustomClipPlane(norm * (i and -1 or 1), norm:Dot(origin) * (i and -1 or 1) + offset)
|
render.PushCustomClipPlane(norm * (i and -1 or 1), norm:Dot(origin) * (i and -1 or 1) + offset)
|
||||||
render.SetColorModulation(2, 0.2, 0.3)
|
render.SetColorModulation(2, 0.2, 0.3)
|
||||||
DrawPreviewModel(model2)
|
DrawPreviewModel(model2)
|
||||||
|
Loading…
Reference in New Issue
Block a user