Night vision shader for anomaly re-imagined. Now features MCM settings to adjust NVGs to your taste, a totally rewritten rendering pipeline, and a bunch more.
Thanks to F.E.A.R and Haruka for Russian translation
Introduces a shader based NVG effect to Stalker Anomaly, instead of the more limited .ppe effect. Currently replaces Gen1 thru Gen3 head mounted NVG effects. Can be expanded by modders to create additional effects, such as non-fullscreen NVG scopes and other possibilities.
New Keybinding: Long press "N" (or your nightvision keybind) to enable/disable NVGs, short press to adjust brightness
Follow future developments at Github.com
**********************************************
MUST READ THIS SECTION
**********************************************
Functions on DX10/11 only - future DX8/9 compatibility is possible, but I'm not touching it just yet.
After installing this mod or making any adjustments to night_vision.h, you must restart the game and select DELETE SHADER CACHE or changes will not take effect. The Anomaly launcher recompiles its shaders from the gamedata/shaders folder ONLY if this option is checked. Once you have done this once, you will not need to do it again unless you make changes to head_mounted_nvg_shader.h or other shaders.
**********************************************
END MUST READ
**********************************************
Installation Steps:
- If you have Glossy SSR, Enhanced Shaders, Arszi Rad overhaul, place these before Beef's NVGs
- Install Beef's NVGs
- If you are using Glossy SSR and Enhanced shaders, , use the included patch. now (currently the patch included with those mods is for NVG v0.9 and will not work)
- If you are using Enhanced shaders but not glossy SSR, use the included patch now.
- If you are using Glossy SSR but not enhanced shaders, use the included patch now.
- If you are using Arszi's rad overhaul, use the included patch now.
- Configure MCM
- Calibration per-PC is still in its draft stage, a better process is in the works but this is one way to do it.
- First, load up in debug mode
- In MCM menu, turn min gain as high as it goes, and max gain as low as it goes
- Go outdoors in some map and change the weather to clear_1 and time to midnight
- Turn on Gen 3 NVGs and adjust the gain offset higher or lower until the moonlight on the ground and buildings just barely doesn't wash out - after changing MCM setting you have to turn off and back on the NVGs for it to take effect
- Change the weather to cloudy_2_dark change max gain to 2, then turn off and on the NVGs. Quick press N until you are at the brightest setting. You should be able to see outside "ok" with Gen 3 but somewhat poorly with gen 1 and gen 2. If you want more brightness you can increase max gain slightly more. If you want to focus on 'gameplay' and don't like the 'realism' then go back to step 5 and increase your gain offset so that the 'base' brightness is higher, then come back to step 6 and so on.
- Change the time to noon and keep the weather on cloudy_2_dark. Quick press N until you are at the lowest setting. Adjust the min gain in MCM lower until you can see during the day (should be somewhere between 0.3 and 0.5 generally)
- Adjust the number of tubes per generation as you see fit, as well as the overlays you want
- Close out the game and turn debug mode back off, and you shouldn't need to adjust NVGs any more other than with a quick press of the nightvision keybind when you enter bright or dark areas.
- Profit
Intent:
I want to create NVGs for Stalker that mirror real-life NVGs, without overdoing it. Likewise, I also want these NVGs to be highly configurable, to allow users to edit them without having to dig through files to change lines of code. To achieve this, I created this shader-based NVG effect to fill what I saw as a missing piece of the Stalker experience.
v1.1.1 Chagelog:
- Fixed small chance of NVG's enabling before RegisterScriptCallback completed, causing the NVGs to get stuck in the "up" position, thanks to Lenny for coming across this
v1.1 Changelog:
- Now uses renamed folder structure from Mr Minotaur for better compatibility with MO2 and future updates.
- Added NVG turn-on animations
- Added NVG shader animations
- Now requires shader_param_7, so its 100% not compatible with Enhanced Shaders Color Grading full shader controls, only the simple controls (or no controls)
- Added controls for radius and vertical positioning of NVGS (for animation / scope compatibility)
- Improved compatibility with Shader Based 2d Scopes (alternate sights still need fixing)
- Improve performance potentially by unregistering unused callbacks when NVGs are disabled
- Added additional checks to prevent issues when turning on / off NVGs while ADS and other actions
- Fixed issue with glossy SSR patch
- Fixed binocular compatibility
- Added sound to brightness adjustment action
v1.0.1 Changelog:
- Added compatibility option for Shader Based 2d Scopes into MCM menu
v1.0 Changelog:
- Complete rewrite, added MCM Support
- Separated image / lightmap /albedo as inputs to rendering
- Updated comments in night_vision.h for advanced user-adjustable settings
- Added separate sky adjustment to night_vision.h
- Glitch effect from blowouts added
- Auto-turn off NVG when PDA opened functionality (MCM configurable)
- Prevent NVG's from enabling when ADS (MCM configurable)
- Compatibility with Glossy SSR / Enhanced shaders
- Russian localization
- Ability to set the number of tubes in each generation (MCM configurable)
- Probably a lot more that I forgot
Previous Changelog:
- v0.9 - complete rewrite, introduces tons of new bugs, but improves performance/adjustability
- v0.85 - updated for RC19 compatibility - patches may be out of date
- v0.84 - updated all compatibility patches for Feel_Fried's animations
- v0.83 - version update for the people who downloaded .82 before I ninja-updated an error
- v0.82 - added compatibility patch for Nav's Definitive Masks
- v0.81 - added two new configurations, brighter and brighter+arcade
- v0.8 - fixed distortion, improved effects, implemented new features, uploaded to MODDB
Update 17 November:
Alternate sights still need to be fixed, but squashed a fair number of issues and bugs, particularly with shader scopes and got a little bit more functionality in.
Next up on the roadmap:
- Fix alternate sights
- Add 2d overlay functionality
- Reorganize MCM menu into submenus
- Add DOF effect control to MCM
- Add control for # of brightness intervals to MCM
- Dynamic tube control (e.g. able to flip up left half of multi-tube NVGs to see detector while artifact hunting)
- Improve turn-on animations (and perhaps add flip-up animation? I don't want to overdo it)
Second Update (1.1.1 fix) Fixed small chance of Script callbacks not registering correctly.
shader based scopes has a patch in it´s mcm menu
o k but hwat is the hardcore cheeki breeki track id
Oh damn, these... these really make me want to replace My Little NVGs. Oh man, but with 108 mods I have installed, one might not be happy... but it is shader based... hmmmmmmmmm.
Decided to bite the bullet - only thing I had to change in Beef's item script was for the Anomaly Detector since I have Arszis' Anomaly Detector Restored mod.
Funny enough, trying to replace My Little NVGs with my own .ppe effect was where I fell down the rabbit hole of learning shaders and ended up here.
ITS HERE
Do you mind if I post a bug report here or in the Github repository or on the comments?
Never mind, turns out I just incorrectly copied the lines from Arszi's Restored Anomaly Detector item_device.script into your's. Game's working just fine and dandy now - still need to calibrate the brightness but this is certainly cool as hell.
Nice i like, but as of now I use Boomsticks and SharpSticks and the included NVG scopes does not like your new version.
editing shader files is beyond me at this point.
I tried.
Hopefully that gets updated soon. i like the brightness adjustments and auto on off for a pda.
Yeah, the new version has to pack more data into fewer shader_params, so it doesn't play nicely with v0.9 NVG shader.
Creativity 80 lvl, because preview.
You're a real one, Beef. This has loads of options, for casual gamers and realism enthusiasts alike. Right on!
HOLY ****.
I love how now I found another way to die on my 1 life ironman play throughs!
Getting blinded by my own gun's flash!
Use a suppressor to deaden your muzzle flash when wearing NVGs
Yup!
But I won't because I like to torture myself.
video preview: Youtu.be
with shader scope: Youtu.be
Compatibility with shader based 2d scopes is added in new version
Also for others, you can edit some of the 'advanced' settings in night_vision.h for things like changing the colors as Kraizer has done here for B/W vision - I have some example color schemes in that file as well.
Oooooh man that's so good :D
(Google TL)
I remember that in the old versions there was an animation of turning on the headlamp when the NVG was turned on, when will it be again?
v1.1 I will add some more animations, not just for player character but also for the nvg effect itself, such as flipping up NVG effect
This comment is currently awaiting admin approval, join now to view.
Will it go to the boomstick?
There can be some problem with the boomstick nightvision scopes and the current NVGs, but I don't know if it would crash or simply not work correctly. There will be no issues with the rest of boomsticks, and I am working with Mich to help him with updating his scopes that use my old nv shader to use the new one.
To answer your question more directly,you should have no issue with boomsticks so long as you don't use the NV scopes patch.
Put everything in the correct order and with all the patches, but Pastebin.com
I also use B&S
Something is overwriting either pp_blur.ps or night_vision.h, more likely night_vision.h
As a result, B&S is rewriting night_vision.h, but when corrected, it appears like this
(53,16): error X3013: 'calc_vignette': function does not take 2 parameters
Are you using the NV scopes patch for B&S? If so, that will be the problem, it must be updated to using v1.0's new pipeline. I didn't see this conflict at first since I have been using B&S while testing the NV scopes, and in some ways it is indispensable since it adds lasers to weapons (and the next update of B&S is likely to include the ability to turn on / off lasers)
I have the BaS nv scope patch disabled yet I'm experiencing the same crash.
can u make work for dx8? i realy love your mod
I will make a pared down version for dx8/9 one day, since I don't think I will change the pipeline for a 5th time. Unfortunately, a lot of features will have to be stripped out and refactored to make it work ...
Nice.... I'll gonna try this new version, but I will deactivate the BAS NVG Scope patch, just in case hehe
Привет автор!
столкнулся с проблемой я поставил новую версию beef shadeer nvgs (я пытался зарегаться на imgur но пишет что в моём регионе нельзя) у меня установлено в след порядке
Beefs_Shader_Based_NVG_v1.0.1
Beefs_Shader_Based_NVG_v1.0.1 - Glossy SSR patch
Glossy_SSR_0.13
GLossy_SSR_0.13 water optional
GLossy_SSR_0.13 nvgs patch (на старой)
и не работает на новой версии
а когда на старой было то все работало что делать?
попробуйте этот список
Glossy_SSR_0.13
GLossy_SSR_0.13 water optional
Beefs_Shader_Based_NVG_v1.0.1
Beefs_Shader_Based_NVG_v1.0.1 - Glossy SSR patch
я поставил в таком порядке после чего зашел в игру
создал новую игру и прописал себе 3 фонарика с ночным виденьем проверил каждый нажимаю N но ничего не работает а включается только свет L
Вы удалили кэш шейдеров?
Так же, аддон меняет управление ПНВ:
Для включения/отключения необходимо зажать N.
Короткое нажатие на N регулирует яркость.
Странно я вроде ничего не удалял а нажатие на N не удерживая ничего не происходит и долгое нажатие тоже не работает
Если при длительном нажатии N (более полсекунды) вы слышите шум,но худ ПНВ не отображается, шейдер работает некорректно.
Если при длительном нажатии N (более полсекунды) не включается ни худ ПНВ, ни его звук, ни ночного видения, значит, скрипт работает некорректно возможно его перезаписал другой аддон.
Спасибо большое помогло оказывается теперь на удержание N работает 100/10
Доброй охоты, сталкер
hey theRealBeef, since on you're on fire recently, I have a mod suggestion:
let grenades, anomalies and critical damage attacks have a chance at damaging the side of your equipment you usually take for granted: NVGs, PDAs, flashlights, detectors.
This would make them less of a permanent one-off purchases you take for granted, turning them instead into good succeptible to damage as any other in sometimes very undesirable situations (night escapade far from home where you take a critical hit into your NVGs).
While implementing damage system to those items similar to weapons may be difficult (I don't know, it's a semi-educated guess), two simple alternatives would be to either make such item completely despawn from player inventory (destroyed... puff!) or simply making them loose all their battery charge whenever a check for damage comes back positive.
I always disliked how those things were a one off - once you had them you took them for granted for the remainder of the game, risk-free.
Not a bug regarding beef's mod, but if you use a retexture for gunsight reticles, you run the risk of having bloom become overwhelming to the point you may not be able to use the optic at all during NVG use.
I am using bert's Moddb.com for reference, and the Kobra sight retexture is unusable on anything below a threshold for washout setting of 0.9. Again, not an issue with this mod and removal of the offending sight texture will fix the issue, but it's something to keep in mind perhaps. Everything else seems to be working as intended on the v1.0.1 release of Beefs NVG's for 1.5.1.
In chasing realism sometimes it makes things more complex in a game. The easiest answer is to get adjustable brightness for the scope reticles so they can have a day and a night mode ... it's on the 1.2 figure-out-how-to-do list anyway, perhaps triggered by turning on NVGs. Green lasers and sights from B&S also get washed out but red do not (as much) due to the YUV conversion that I use to pack the image data into a single channel in order to manipulate the lightmap and albedo in the other two color channels.
I hope you're able to keep making progress on your mod and don't run into any more issues now that you've gotten it into a state you're happy with. I was able to add v1.0.1 to my extensive load-order today thanks to the newly found compatibility for other mods, including shader-based 2d scopes and if I'm not misremembering, Food, Drugs & Drinks animations and perhaps Groks masks. I've played with it a little more since installation and noticed binoculars have trouble displaying properly under NVG unless you activate it post-zoom.
I'll try to keep track of any other issues I may find during testing, and I'm eager to see what else you do, Beef's NVG's or otherwise. :D
Edit: Just a stray thought, but perhaps either as a part of or post-release of v1.2, you could redo binoculars entirely as an optional addon as they have NVG upgrades. It occurred to me when I saw you were also considering tweaking other devices/items.
I've added fixing the binoculars to the todo list for 1.1, thanks for the heads up
As far as the long term nvg upgrades for bino stuff, its also a pretty good idea, but I have to keep 'scope creep' or whatever its called within check, so that I finish what's in front of me before adding too much to the todo list, but its not a bad idea. Thanks for sharing :)
is this ready for DX8? :D
It's almost at the stage where I know I won't be rewriting pipeline in the future, I just need to add all the MCM features that will need to talk to shaders first and have a long talk with the bottom of a few bottles of liquor and then I'll have the strength to write some DX8/9 compatible version.
awesome, can't wait :D
This is awesome great work! Adjusting brightness is wonderful, would it be possible to add a sound to that?
Definitely looking forward to the fix for those thermal colors, at least turning scope_blur_inner to 0 is a quick temporary fix. I'm not sure if you already know, but there seems to be a bug where if you have NVG on and then look through the binoculars, it's just black. Works find if you look through binocs and then turn NVG on. Maybe just me.
In next update the shader scopes patch will keep your original scope_blur_inner value when you don't have nvgs, and disable it when you are using nvgs, then restore it afterwards.
Adding a sound to brightness adjustment is a good idea, I've added it to the v1.1 todo list
I also added fixing the binocular error to the 1.1 todo list.
Hey think I found another lil bug, using Gen 3 night vision & if I zoom in it changes from a quad tube to a single tube, same if I switch from scope to iron sights with Alternate Aim mod. When I zoom back out it switches back to a quad tube. If I zoom in then turn NVG on, it's quad tube with the thermal-looking colors outside, but when I zoom out and zoom back in it's back to single tube. (I don't remember if that was happening a few days ago when I installed, but don't think I changed anything either.)
I did this when shader scopes is enabled as my only real option with shader 2d scopes because there's some conflict with the two shaders that I can't easily resolve, so when you zoom in and shader scopes takes over it needs to switch to a single tube or the data packing gets displayed instead of the actual NVG image.
I've got some progress to make on differentiating between the shader 2d scopes and ironsights
That's better than nothing or wonky colors I suppose. Would it be possible to make it differentiate between scoping in with the scope and scoping in with iron sights through Alt. Aim mod? If not, same as above...
(Normal iron sights with no scope attached work fine, to clarify.)
Bloodsucker's seem to have the washout effect from lights applied to them when they are cloaked, makes those suckers even easier to kill with NVG, unfortunately.
I.imgur.com
I'll take a look at the alt sights
As far as bloodsuckers...damn
I'll see if I can do anything about this, but if not then I'm gonna chalk it up some explanation like 'their skin absorbs visible light and emits it in NIR band so that they can become invisible but if you're wearing NVGs then they show up better' or some **** and call it a feature not a bug ;)
"call it a feature not a bug ;)"
Yes, I am familiar with the S.T.A.L.K.E.R. games =P
Honestly it is still a little difficult and jarring, you go from able to track them when they are invisible to suddenly having to adjust to them not being a washed out blob when they get closer and attack. Especially difficult if there are other washed out blobs of light around you.