Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hook.Add("CalcView", "dynamic znear", function(ply, pos, ang, fov, znear, zfar)
- local d = util.TraceLine(
- {
- start = pos,
- endpos = pos + ang:Forward() * 20,
- filter = ply
- }
- )
- fov = -(fov / 180) + 1
- local z = d.Fraction * fov
- z = z * 20
- if z < 1 then
- z = znear
- end
- return
- {
- znear = z
- }
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement