arc9_fx_rtblur arc9_fx_adsblur ATT.RTBlurAdsAnyway

This commit is contained in:
Darsu 2022-11-13 01:40:49 +07:00
parent a83ffb9cb9
commit 9c7d85708f
7 changed files with 88 additions and 22 deletions

View File

@ -118,6 +118,7 @@ ATT.RTScopeReticle = Material("")
ATT.RTScopeReticleScale = 1
ATT.RTScopeShadowIntensity = 1.5
ATT.RTCollimator = false -- Disables cheap scopes fov boost, disables sensivity adjustements
ATT.RTBlurAdsAnyway = false -- If arc9_fx_adsblur 1 then blur gun anyway (as on non-rt sights). Disabled by default because it can blur and distort rt image
ATT.RTScopeNoPP = false
ATT.RTScopeNoShadow = false
ATT.RTScopeBlackBox = false

View File

@ -453,6 +453,16 @@ local conVars = {
default = "0",
client = true
},
{
name = "fx_rtblur",
default = "1",
client = true
},
{
name = "fx_adsblur",
default = "1",
client = true
},
}
local prefix = "arc9_"

View File

@ -49,7 +49,9 @@ function ENT:PhysicsCollide(colData, collider)
snd = table.Random(tbl)
end
if snd then
self:EmitSound(snd)
end
end
function ENT:Think()

View File

@ -1,16 +1,43 @@
local vignette = Material("arc9/bgvignette.png", "mips smooth")
-- local vignette2 = Material("arc9/bgvignette2.png", "mips smooth")
local adsblur = Material("pp/arc9/adsblur")
local function arc9toytown(amount) -- cool ass blur
if amount > 0 then
local scrw, scrh = ScrW(), ScrH()
cam.Start2D()
surface.SetMaterial(adsblur)
surface.SetDrawColor(255, 255, 255, 255)
for i = 1, 5 * amount do -- 5 looking pretty cool
render.CopyRenderTargetToTexture(render.GetScreenEffectTexture())
surface.DrawTexturedRect(scrw*.5-scrh*.5, scrh*.58, scrh, scrh*0.42)
end
cam.End2D()
end
end
function SWEP:PreDrawViewModel()
if ARC9.PresetCam then
self:DoBodygroups(false)
return
end
local getsights = self:GetSight()
local sightamount = self:GetSightAmount()
-- global for accessing later
ARC9.ShouldRTBlur = sightamount > 0 and GetConVar("arc9_fx_rtblur"):GetBool() and getsights.atttbl and getsights.atttbl.RTScopeFOV and getsights.atttbl.RTScopeFOV > 4.5 and !getsights.Disassociate and !getsights.atttbl.RTCollimator
if ARC9.ShouldRTBlur then DrawBokehDOF(2 * sightamount, 1, 0) end
ARC9.ShouldRTBlur = ARC9.ShouldRTBlur and !(getsights.atttbl and getsights.atttbl.RTBlurAdsAnyway) or false
local custdelta = self.CustomizeDelta
if custdelta > 0 then
if GetConVar("arc9_cust_blur"):GetBool() then DrawBokehDOF( 10 * custdelta, 1, 0.1 ) end
if GetConVar("arc9_cust_blur"):GetBool() then DrawBokehDOF(5 * custdelta, 1, 0.1) end
cam.Start2D()
surface.SetDrawColor(0, 0, 0, 180 * custdelta)
@ -22,7 +49,7 @@ function SWEP:PreDrawViewModel()
end
if GetConVar("arc9_cust_light"):GetBool() and self:GetCustomize() then
-- render.SuppressEngineLighting( true )
-- render.SuppressEngineLighting(true)
-- render.ResetModelLighting(0.6, 0.6, 0.6)
-- render.SetModelLighting(BOX_TOP, 4, 4, 4)
local light = DynamicLight(self:EntIndex(), true)
@ -35,7 +62,7 @@ function SWEP:PreDrawViewModel()
light.Size = 500
light.DieTime = CurTime() + 0.1
-- else
-- render.SuppressEngineLighting( false )
-- render.SuppressEngineLighting(false)
-- render.ResetModelLighting(1,1,1)
end
@ -43,38 +70,41 @@ function SWEP:PreDrawViewModel()
self:DoBodygroups(false)
local bipodamount = self:GetBipodAmount()
local vm = self:GetVM()
self:GetVM():SetPoseParameter("sights", math.max(self:GetSightAmount(), bipodamount))
vm:SetPoseParameter("sights", math.max(sightamount, bipodamount))
if self:GetValue("BoneMods") then for i, k in pairs(self:GetValue("BoneMods")) do
local boneindex = self:GetVM():LookupBone(i)
local boneindex = vm:LookupBone(i)
if !boneindex then continue end
self:GetVM():ManipulateBonePosition(boneindex, k.pos or vector_origin)
self:GetVM():ManipulateBoneAngles(boneindex, k.ang or angle_zero)
self:GetVM():ManipulateBoneScale(boneindex, k.scale or vector_origin)
vm:ManipulateBonePosition(boneindex, k.pos or vector_origin)
vm:ManipulateBoneAngles(boneindex, k.ang or angle_zero)
vm:ManipulateBoneScale(boneindex, k.scale or vector_origin)
end end
self:GetVM():InvalidateBoneCache()
vm:InvalidateBoneCache()
self.ViewModelFOV = self:GetViewModelFOV()
local vmfov = self:GetViewModelFOV()
self.ViewModelFOV = vmfov
if !GetConVar("arc9_dev_benchgun"):GetBool() then
cam.Start3D(nil, nil, self:WidescreenFix(self:GetViewModelFOV()), nil, nil, nil, nil, 0.5, 10000)
cam.Start3D(nil, nil, self:WidescreenFix(vmfov), nil, nil, nil, nil, 0.5, 10000)
end
-- self:DrawCustomModel(true, EyePos() + EyeAngles():Forward() * 16, EyeAngles())
self:GetVM():SetSubMaterial()
vm:SetSubMaterial()
if self:GetHolsterTime() < CurTime() and self.RTScope and self:GetSightAmount() > 0 then
self:DoRTScope(self:GetVM(), self:GetTable(), self:GetSightAmount() > 0)
if self:GetHolsterTime() < CurTime() and self.RTScope and sightamount > 0 then
self:DoRTScope(vm, self:GetTable(), ssightamount > 0)
end
self:GetVM():SetMaterial(self:GetProcessedValue("Material"))
vm:SetMaterial(self:GetProcessedValue("Material"))
cam.IgnoreZ(true)
if self:GetSightAmount() > 0.75 and self:GetSight().FlatScope and !self:GetSight().FlatScopeKeepVM then
if sightamount > 0.75 and getsights.FlatScope and !getsights.FlatScopeKeepVM then
render.SetBlend(0)
end
end
@ -120,7 +150,7 @@ function SWEP:PostDrawViewModel()
cam.End3D()
end
cam.Start3D(nil, nil, self:WidescreenFix(self:GetViewModelFOV()), nil, nil, nil, nil, 1, 10000 )
cam.Start3D(nil, nil, self:WidescreenFix(self:GetViewModelFOV()), nil, nil, nil, nil, 1, 10000)
for _, model in ipairs(self.VModel) do
local slottbl = model.slottbl
local atttbl = self:GetFinalAttTable(slottbl)
@ -133,5 +163,7 @@ function SWEP:PostDrawViewModel()
end
cam.End3D()
if !ARC9.ShouldRTBlur and GetConVar("arc9_fx_adsblur"):GetBool() then arc9toytown(self:GetSightAmount()) end -- cool ass blur
-- render.UpdateFullScreenDepthTexture()
end

View File

@ -858,7 +858,7 @@ SWEP.HoldTypeBlindfire = "pistol"
SWEP.HoldTypeNPC = nil
SWEP.AnimShoot = ACT_HL2MP_GESTURE_RANGE_ATTACK_AR2
SWEP.AnimReload = ACT_HL2MP_GESTURE_RELOAD_AR2 -- While in TPIK only
SWEP.AnimReload = ACT_HL2MP_GESTURE_RELOAD_AR2 -- While in TPIK only -- Tip: if you dont want any additional anim put ACT_HL2MP_GESTURE_RELOAD_MAGIC here instead!
SWEP.NonTPIKAnimReload = ACT_HL2MP_GESTURE_RELOAD_AR2 -- Non TPIK
SWEP.AnimDraw = false
SWEP.AnimMelee = ACT_GMOD_GESTURE_MELEE_SHOVE_2HAND
@ -954,7 +954,7 @@ SWEP.Attachments = {
-- Ang = Angle(0, 0, 0),
-- CorrectiveAng = Angle(0, 0, 0), -- sometimes, the autosolver needs a little help. Try (-1, -1, 0)
-- Scale = 1,
-- DuplicateModels = { -- For guns that require duplicating attachment models, e.g. akimbo
-- DuplicateModels = { -- For guns that require duplicating attachment models, e.g. akimbo or guns with 2 mags on model
-- {
-- Bone = "",
-- Pos = Vector(0, 0, 0),

View File

@ -0,0 +1,21 @@
"Refract"
{
"$basetexture" "_rt_FullFrameFB"
"$normalmap" "pp/arc9/adsblur"
"$fbtexture" "_rt_FullFrameFB"
"$refractamount" "0"
"$vertexalpha" "0"
"$vertexcolor" "0"
"$translucent" "0"
"$forcerefract" "1"
"$bluramount" "1"
"$nofog" "0"
"$ignorez" "1"
"$nocull" "1"
// "$model" "1"
"Refract_DX60"
{
"$fallbackmaterial" "null"
}
}

Binary file not shown.