Frenchy's NVG mod for DCS 1.5.x and 2.x - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 11-02-2015, 12:38 AM   #1
tacca
Member
 
tacca's Avatar
 
Join Date: Apr 2014
Location: Australia
Posts: 109
Reputation power: 5
tacca has a spectacular aura abouttacca has a spectacular aura abouttacca has a spectacular aura abouttacca has a spectacular aura about
Default Frenchy's NVG mod for DCS 1.5.x and 2.x

Introduction

This is an NVG mod I reworked for DCS World 1.5 and 2.0 to generate a realistic NVG effect instead of the stock effect. It is based on the work created Nrgized with the help of PeterP and few others from the eagle dynamic forums on this thread (in future I will refer to this as Version 1). The rework was required since DCS 1.5 and above uses the new Eagle Dynamics Graphics Engine (EDGE) which is based on DirextX11 (DX11). Version 1 was coded using DX9 and was not compatible at all due to the significant changes, for the better, in the Higher Level Shading Language (HLSL).

A quote of mine from the initial thread I started on the Online 1st Cav Div forums (online handle is Frenchy) can give some perspective on where I started skill wise in this endeavor. I want to emphasis I have no background in shader coding at all but all my maths studies at uni (some in writing code to calculate numerical solutions for 2nd order non linear differential equations for example) have given me a nice advantage.

Quote:
Hey guys, Uni is finished for the year and this is number 1 on my to do list.
Spent all day breaking down the standard DCS NVG implementation and learning some basics of HLSL. Im now confident in how I need to go about making basic color and intensity changes.
Ive just started looking into what this actual mod did and how. Will take me a little bit (next few days around work etc) to figure it all out but I think I will be able to achieve something similar if not it will at least be stepping stones to getting close.
My plan of attack is first and easiest (i think) should be the color/intensities. Next will be the noise (or lack thereof if the scene is bright) and then finally the zoom and ring.
PS. I dont have the black shark so the A10 is my primary concern but once done i might get the blackshark and try to do that one as well.
Now that “few days” turned into a few weeks banging my head against a wall learning the intricacies of HLSL and decomposing the version 1 mod with no comments which overall wasn’t very clear or efficient.
Current Status

Version 2.0.6.1 patch for DCS 1.5.5 & DCS 2.0.4
- FIXED random little bu, dcs has taken out a shader they still reference in their own code???
- download version 2.0.6 of mod (if you dont already have it.
- copy this nvd.fx file into /my mod folder/Bazar/shaders/PostEffects/nvd.fx and over write the old one.
-apply mod like normal using JSGME etc.

only a one file patch rather than a whole version so people keep all their settings

Version 2.0.6
– NATO and Russian NVG’s simulated with user controllable gain, noise/grain, size and ring thickness.
– Third iteration of my code development to simplify understanding and make more efficient.
– JSGME ready, just extract to your JSGME mod folder and then install with JSGME
– Download Here



Instructions

1. Extract from .rar to JSGME mod folder
2. Adjust variables in “JSGME MOD FOLDER\Frenchys NVG Mod 2.0.6\Bazar\shaders\common\MOD_nvg.hlsl” to change shape etc. You MUST change the variables before applying the mod in JSGME
3. Apply Mod in JSGME

Variables Guide

Render Mode:


0 = full screen,
1 = NVG with no ring,
2 = NVG with Ring,
3 = NVG with ring and slight zoom (not functional)


Eye Size and position:


EYE_CENTER = sets center point of NVG effect on screen as percentage of X and Y starting at bottom left corner. eg (0.5f, 0.655f) = 50% across and 65.5% up.
EYE_SIZE = Sets X and Y diameter of NVG as percentage of screen size. eg (0.47f, 0.75f) = 47% of width of screen and 75% of screen height. Since most monitors aren’t square the y value will have to be larger than the x value to make a perfect circle; the ratio between the two numbers will be the same as your monitor aspect ratio

Gain/Noise controls:

NVG_LIFT = gain multiplication value (.10 for A10 and .08 for KA50 are good starting points)
NVG_NOISE = noise division value, larger value means less noise (3 for A10 and 4 for KA50 are good starting points)

Ring Thickness:
Note – if using render mode 1 nvg will only be size of RInner. ie size = RInner(percentage) * Eye_Size = actual size.

ROFade = % radius of circle where black ring starts to fade out to regular view
RMerge = % radius of circle where black ring becomes 100% black on inside edge
RInner = % radius of circle where green NVG lens start to transition to black ring

I personally prefer a thin ring and this mod is released as such but some real world users (thank you Giaco) recommend the following ring sizes (that you need to set yourself):

Quote:
static const float ROFade = 0.90f;
static const float RMerge = 0.65f;
static const float RInner = 0.63f;
Release History

Version 2.0.6.1 patch for DCS 1.5.5 & DCS 2.0.4
- FIXED random little bu, dcs has taken out a shader they still reference in their own code???
- download version 2.0.6 of mod (if you dont already have it.
- copy this nvd.fx file into /my mod folder/Bazar/shaders/PostEffects/nvd.fx and over write the old one.
-apply mod like normal using JSGME etc.

only a one file patch rather than a whole version so people keep all their settings

Version 2.0.6
- Download Here
- Re coded noise and gain code to something I understand and a little simpler
- Added user controllable gain and noise settings
---- NVG_LIFT = gain multiplication value (.10 for A10 and .08 for KA50 are good starting points)
---- NVG_NOISE = noise division value, larger value means less noise (3 for A10 and 4 for KA50 are good starting points)

- Ring thickness now user controlled by adjustable parameters. (SAME AS 2.0.5)
---- ROFade = % radius of circle where black ring starts to fade out to regular view
---- RMerge = % radius of circle where black ring becomes 100% black on inside edge
---- RInner = % radius of circle where green NVG lens start to transition to black ring

NOTE1: if using render mode 1 nvg will only be size of RInner. ie size = RInner(percentage) * Eye_Size = actual size

NOTE2: I personally prefer a thin ring and this mod is released as such but some real world users (thankyou Giaco) recommend ring sizes as follows (that you need to set yourself):
static const float ROFade = 0.90f;
static const float RMerge = 0.65f;
static const float RInner = 0.63f;

- As per 2.0.4 DONT USE render mode 3, not implemented yet (possibly never, personally not very interested in the effect since mouse clicking buttons don't line up)
- Adjust variables in "\Frenchys NVG Mod 2.0.6\Bazar\shaders\common\MOD_nvg.hlsl" to change shape etc.

Version 2.0.5
- Download Here
- Re coded lens, ring and overall mask equations. Neater code in my opinion
- Fixed laser mask issue (possibly discovered bug in DCS with regards to laser rendering - see black line on laser path outside NVG ring in picture below)
- Ring thickness now user controlled by adjustable parameters.
---- ROFade = % radius of circle where black ring starts to fade out to regular view
---- RMerge = % radius of circle where black ring becomes 100% black on inside edge
---- RInner = % radius of circle where green NVG lens start to transition to black ring
NOTE: if using render mode 1 nvg will only be size of RInner. ie size = RInner(percentage) * Eye_Size = actual size

- As per 2.0.4 DONT USE render mode 3, not implemented yet
- Adjust variables in "\Frenchys NVG Mod 2.0.5\Bazar\shaders\common\MOD_nvg.hlsl" to change shape etc.




Version 2.0.4
- Download Here
- Included render mode setting, sets which NVG type to use. 0 = full screen, 1 = NVG with no ring, 2 = NVG with Ring, 3 = NVG with ring and slight zoom (not functional)
- Render mode 2 is default.
- As above DONT USE mode 3, not implemented yet
- Adjust variables in "\Frenchys NVG Mod 2.0.4\Bazar\Effects\common\MOD_nvg.hlsl" to change shape etc.



Version 2.0.3
- Download Here
- Include fade and ring at edge of lens, this is based off my own code and not Nrgizers. I understood what his code did but not how so I wrote my own version. It may not be the most efficient code??? but it works and I know how to troubleshoot it
- Adjust variables in "\Frenchys NVG Mod 2.0.3\Bazar\Effects\common\MOD_nvg.hlsl" to change shape etc.
- Minimal comments/instructions in code at the moment. Implementation is extremely similar to V1.0...






Version 2.0.2
- Download Here
- Added user controlled parametric mask for shape, size and center point of NVG lens.
- Removes reliance on mask.png
- Doesn't include fade or ring at edge of lens, this will be the focus of the next release.
- Adjust variables in "\Frenchys NVG Mod 2.0.2\Bazar\shaders\common\MOD_nvg.hlsl" to change shape etc.
- Minimal comments/instructions in code at the moment. Implementation is extremely similar to V1.0...




Version 2.0.1

- Download Here
- Updated Nrgizers mod here to DX11 standard
- JSMGE ready, just extract to your JSMGE folder.
- Achieves same color, intensity and noise effects as Nrgizers for BOTH NATO AND RUSSIAN NVG.
- Shape still relies on the focus.png file for mask, ring and size (main priority for next release is to have procedural mask user controls)
- Lots of excess code, comments user variable parameters that currently have no effect.
- Mod includes a large wide view focus.png If you dont like it UNAPPLY the mod and delete "\Frenchys NVG Mod 2.0.1\Bazar\Effects\PostEffects\focus.png" or rename to anything else and mod will use stock NVG field of view native to DCS 1.5






Pre Release Development

Hi, first of the guys from the Online 1st Cav Div know me as frenchy and it is my normal online handle but cant change my one on here.

Second, I cannot and will not take any credit for the amazing appearance/effect this NVG mod generates, its all by nrgized here on this thread with the help of PeterP and few others (in future I will refer to this as Version 1).
With nrgized last being active 04-17-2013 08:53 PM I have taken it upon myself to update this mod so it works for DX11 DCS1.5

With DCS1.5/2.0 changing to DX11 pretty much all shader/appearance mods wont work since the HLSL (High Level Shading Language that pretty makes up 2D rendering output component of DX9/10/11) used by graphics cards was changed (for the better) between DX9 and DX10.

All my effort currently and in the future is to rewrite the code to the new HLSL standard and DCS file format so it works and appears just the same as how nrgizer had it working.

A quote of mine from the old thread. I want to emphasis I have no background in coding at all (self taught in the last 4 days) but all my maths studies at uni are giving me a nice advantage.
Quote:
Originally Posted by tacca View Post
Hey guys, Uni is finished and this is number 1 on my to do list.

Spent all day breaking down the standard DCS NVG implementation and learning some basics of HLSL. Im now confident in how I need to go about making basic color and intensity changes.

Ive just started looking into what this actual mod did and how. Will take me a little bit (next few days around work etc) to figure it all out but I think I will be able to achieve something similar if not it will at least be stepping stones to getting close.

My plan of attack is first and easiest (i think) should be the color/intensities. next will be the noise (or lack thereof if the scene is bright) and then finally the zoom and ring.

PS. I dont have the black shark so the A10 is my primary concern but once done i might get the blackshark and try to do that one as well.
Currently I don't have anything to upload but I am very close to getting nrgizer's basic intensity and color look for the NVG working. I have also now realized that getting the Blark Shark look wont take much at all either. Expect both of these within the next 2 to 3 days

The zoom, noise and adjustable ring size will take a bit longer as the coding is a bit more involved, particularly the shader/hlsl side of things so I personally have a bit more work to do.

Last edited by tacca; 11-19-2016 at 08:37 PM. Reason: adding video and formatting
tacca is offline   Reply With Quote
Old 11-02-2015, 04:03 AM   #2
Charly_Owl
Senior Member
 
Join Date: Apr 2012
Location: Montreal (QC), Canada
Posts: 1,528
Reputation power: 25
Charly_Owl is a name known to allCharly_Owl is a name known to allCharly_Owl is a name known to allCharly_Owl is a name known to allCharly_Owl is a name known to allCharly_Owl is a name known to allCharly_Owl is a name known to allCharly_Owl is a name known to allCharly_Owl is a name known to allCharly_Owl is a name known to allCharly_Owl is a name known to all
Default

Nrgized's mod for the NVGs really kicked ass. It would be really cool to have those available in the default game!
Charly_Owl is offline   Reply With Quote
Old 11-02-2015, 10:08 AM   #3
NeilWillis
Veteran
 
Join Date: Jun 2013
Location: United Kingdom
Posts: 3,909
Reputation power: 19
NeilWillis is just really niceNeilWillis is just really niceNeilWillis is just really niceNeilWillis is just really niceNeilWillis is just really niceNeilWillis is just really niceNeilWillis is just really niceNeilWillis is just really niceNeilWillis is just really niceNeilWillis is just really niceNeilWillis is just really nice
Default

Excellent, looking forward to these.
NeilWillis is offline   Reply With Quote
Old 11-02-2015, 02:48 PM   #4
tacca
Member
 
tacca's Avatar
 
Join Date: Apr 2014
Location: Australia
Posts: 109
Reputation power: 5
tacca has a spectacular aura abouttacca has a spectacular aura abouttacca has a spectacular aura abouttacca has a spectacular aura about
Default

Quick update, A10C color, intensity and noise working. Very tired (3am morning here). Will post current work tomorrow morning AUS time.

Frenchy
tacca is offline   Reply With Quote
Old 11-02-2015, 07:12 PM   #5
Grand+
Posting Rights Revoked
 
Join Date: May 2015
Posts: 65
Reputation power: 0
Grand is on a distinguished road
Default

This is starting to sound promising!
Grand is offline   Reply With Quote
Old 11-02-2015, 07:51 PM   #6
tomcatter
Member
 
tomcatter's Avatar
 
Join Date: Mar 2012
Location: Mediterranean Sea
Posts: 393
Reputation power: 10
tomcatter is just really nicetomcatter is just really nicetomcatter is just really nicetomcatter is just really nicetomcatter is just really nicetomcatter is just really nicetomcatter is just really nicetomcatter is just really nicetomcatter is just really nicetomcatter is just really nice
Default

Super, bring it back.
For me this one was one of the most immersive mods for the Hog, on the same level than Ricardo´s cockpit, I love night flying and this mod really enhances the experience.
So good luck with your work,much appreciated.
tomcatter is offline   Reply With Quote
Old 11-02-2015, 11:03 PM   #7
tacca
Member
 
tacca's Avatar
 
Join Date: Apr 2014
Location: Australia
Posts: 109
Reputation power: 5
tacca has a spectacular aura abouttacca has a spectacular aura abouttacca has a spectacular aura abouttacca has a spectacular aura about
Default

Version 2.0.1 Released.

See Here for file and notes

Last edited by tacca; 11-03-2015 at 12:29 AM.
tacca is offline   Reply With Quote
Old 11-02-2015, 11:27 PM   #8
dabomb
Member
 
Join Date: Feb 2012
Posts: 130
Reputation power: 6
dabomb will become famous soon enoughdabomb will become famous soon enough
Default

Thanks Frenchy.
dabomb is offline   Reply With Quote
Old 11-02-2015, 11:34 PM   #9
tacca
Member
 
tacca's Avatar
 
Join Date: Apr 2014
Location: Australia
Posts: 109
Reputation power: 5
tacca has a spectacular aura abouttacca has a spectacular aura abouttacca has a spectacular aura abouttacca has a spectacular aura about
Default

Fixed upload file, folder structure was wrong for JSMGE :/
tacca is offline   Reply With Quote
Old 11-03-2015, 05:54 AM   #10
zaelu
Veteran
 
zaelu's Avatar
 
Join Date: Sep 2005
Location: Nice, France
Posts: 3,839
Reputation power: 33
zaelu is a glorious beacon of lightzaelu is a glorious beacon of lightzaelu is a glorious beacon of lightzaelu is a glorious beacon of lightzaelu is a glorious beacon of lightzaelu is a glorious beacon of lightzaelu is a glorious beacon of lightzaelu is a glorious beacon of lightzaelu is a glorious beacon of lightzaelu is a glorious beacon of lightzaelu is a glorious beacon of light
Default

thanks!! Looking really good. One thing though. The mask that now is on horizontal makes the image looks like this, as in not centered. Also maybe it was set on vertical for VR headsets users?
(the green line, I draw it)

__________________
zaelu is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 12:42 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.