This commit is contained in:
lifestorm
2024-08-04 23:54:45 +03:00
parent 8064ba84d8
commit 6a58f406b1
7522 changed files with 4011896 additions and 15 deletions

View File

@@ -0,0 +1,52 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local dofmat = Material("pp/dof")
function SWEP:BlurWeapon()
if !ArcCW.ConVars["blur"]:GetBool() then return end
local delta = self:GetSightDelta()
if delta >= 1 then return end
local vm = self:GetOwner():GetViewModel()
render.UpdateScreenEffectTexture()
render.ClearStencil()
render.SetStencilEnable(true)
render.SetStencilCompareFunction(STENCIL_ALWAYS)
render.SetStencilPassOperation(STENCIL_REPLACE)
render.SetStencilFailOperation(STENCIL_KEEP)
render.SetStencilZFailOperation(STENCIL_REPLACE)
render.SetStencilWriteMask(0xFF)
render.SetStencilTestMask(0xFF)
render.SetBlend(1)
render.SetStencilReferenceValue(55)
ArcCW.Overdraw = true
vm:DrawModel()
ArcCW.Overdraw = false
render.SetBlend(0)
render.SetStencilPassOperation(STENCIL_REPLACE)
render.SetStencilCompareFunction(STENCIL_EQUAL)
-- render.SetColorMaterial()
dofmat:SetFloat("bluramount", 0.1 * (1 - delta))
render.SetMaterial(dofmat)
render.DrawScreenQuad()
render.SetStencilEnable(false)
end
function SWEP:BlurNotWeapon()
if !ArcCW.ConVars["blur"]:GetBool() then return end
render.UpdateRefractTexture()
DrawToyTown(3, ScrH())
end
function SWEP:DoToyTown()
if !ArcCW.ConVars["blur_toytown"]:GetBool() then return end
render.UpdateRefractTexture()
DrawToyTown(3, ScrH() * 0.4 * (1 - self:GetSightDelta()))
end