Night Vision script

It isn’t much, but I figured someone out there must want it or need it for something.

I’ll update it if I get time.

I used to have one that was made on the Requests a while ago, but it didnt worked quite well.

Those this one really works on pitch black enviroments? or just in semi-dark atmospheres?

A video would be cool.

Mine works good I guess, I wouldn’t rely on it though.
Edit:* Miah!*
Added sounds and fixed 2 functions.

I made a night vision script a while ago, but it had one bug, if there was a spot that was 100% dark(such as the dark room in gm_construct) it couldn’t light it up. This is the one Santz is talking about, if you’d like to look at it and get ideas or what not. I see you’re only using an overlay and doing everything with console commands. You can use the surface library to play a sound.

I downloaded this and looked at the code. I decided something like this could be useful if you put a fullbright command in it and then:

function nightvision( player, command, arguments )
        player:ConCommand("r_screenoverlay effects/NIGHTVISION_overlay.vmt")
    player:ConCommand("mat_fullbright 1")
    player:ConCommand("play snapon.wav")

function normalvision( player, command, arguments )
    player:ConCommand("r_screenoverlay 0")
    player:ConCommand("mat_fullbright 0")
    player:ConCommand("play snapoff.wav")

concommand.Add( "Nightvisionon", nightvision )
concommand.Add( "Nightvisionoff", normalvision )

i would much rather force sv_cheats and use mat_fullbright

Meh, I’ll tinker with this later.

Chad, thanks for the attempt. Some of the build maps I play on have some dark tunnels. I’ve not tried yours, but hopefully it will work.
Many years ago, Tetabonita released one of the, in my opinion, best Lua and material based thermal and ‘x-ray’ vision releases I’d seen. -
Unfortunately, He removed the download, and I’ve long lost the file I downloaded.
However, if you go some pages into the release post, some people have modified versions of his still available. None of which fit my needs, but, might serve for you to improve upon/change, whatever.

Thanks, I will work on this later. I have a sourcemod to work on and another game to also work on :v:

Could you take some pics of it working?
Im gonna download it but I cant use it until the sunday :confused: and I want to see how it works.

I’ll take some pics as soon as I can, I’m working on 3 different games at the moment lol.
I’ll have screenshots up probably in about 18 hours or so…?

local enabled = CreateClientConVar( “nightvision_enabled”, 0, true, false )

local ColorModify = {}
ColorModify[ “$pp_colour_addr” ] = 0
ColorModify[ “$pp_colour_addg” ] = 8 * 0.05
ColorModify[ “$pp_colour_addb” ] = 2 * 0.05
ColorModify[ “$pp_colour_brightness” ] = 0
ColorModify[ “$pp_colour_contrast” ] = 1
ColorModify[ “$pp_colour_colour” ] = 0.25
ColorModify[ “$pp_colour_mulr” ] = 0
ColorModify[ “$pp_colour_mulg” ] = 0
ColorModify[ “$pp_colour_mulb” ] = 0

hook.Add( “RenderScreenspaceEffects”, “NightVision”, function()
if LocalPlayer():Alive() and enabled:GetBool() then
DrawColorModify( ColorModify )
DrawMotionBlur( 0.05, 0.2, 0.023) --looks kinda cool
end )

hook.Add( “HUDPaint”, “NightVisionLight”, function()
if LocalPlayer():Alive() and enabled:GetBool() then
local dlight = DynamicLight( LocalPlayer():EntIndex() )
if ( dlight ) then
local r, g, b, a = 255, 255, 255, 255
dlight.Pos = LocalPlayer():GetShootPos()
dlight.r = r
dlight.g = g
dlight.b = b
dlight.Brightness = 1
dlight.Size = 1024
dlight.Decay = 1024
dlight.DieTime = CurTime() + 0.1
end )

Wow, nice job Blackops! I’m currently re-working this though, but thanks!

I messed with Blackops’ script, and added bloom and toned down the dynamic light a LOT

Basically, I ended up recreating how night vision works in the real world, with a tiny dynamic light to add just enough light to pitch black surfaces that the bloom can do its work.

See for yourself:

With colormod disabled it looks like it’s broad daylight. It’s quite cool.

What map are you using? That looks insanely cool to test stuff on!

A modification of rp_amsterdam that’s set at night.

I think that night vision is unrealistic. In real life isn’t night vision just black and white while slightly green? I think Splinter cell’s night vision looks pretty cool even though I don’t know if it’s like that in real life.

I think mine is fairly reasonable.
Real life night vision is surprisingly green, actually.

I’ve used night vision goggles but they were pretty old and probably not the best kind. It was, as ya said, pretty green but you couldn’t see in the pitch black.

BlackOps, you nightvision reminds me Opposing Force.
Well well, dont these just like,… the old times?