Working with Reshade and LUT (using XP11b14 as an example)
==============================================================

Updated instructions are at:
https://www.nzfsim.org/shaders/xp11-shader-tweaks/

Though I think XP11 lighting is far superior to Prepar3D, I still think there are ways to produce more 
realistic/natural looking visuals. To do this, I use two excellent (and free) utilities:

1) FlyAGI
https://flyagi.de/
This is a “Swiss Army Knife” of a utility – allowing you to control fog/haze, sky/clouds, water textures and has a 
whole host of other useful features. I use it frequently to change visibilty/haze in-sim.

2) Reshade
https://reshade.me
This is a generic post-processing tool that can be used on many games/sims – including XP11 and P3D. It works 
independently (and on top of) all graphic output and uses a very functional GUI that allows you to control output 
“on the fly”. It does not change any core files or settings of the sim.


There’s a multitude of freely available shader scripts that can be used with Reshade – though I find I only need 
a handful to cover most aspects of visual output in flight sims. These are:

*   DisplayLUT/ApplyLUT/LUT: create/display/apply the LUT png file.
*   prod80_01_Color_Gamut: matches output to your monitor profile.
*   prod80_03_Shadows_Midtones_Highlights: combines brightness, contrast, hue, saturation etc. independently 
    for each of the three tonal ranges (brilliant!).
*   Deband: great for smoothing out the sky.
*   LumaSharpen (or AdaptiveSharpen): adds a controllable amount of sharpness.
*   Clarity: adds a little definition to the landscape.

==============================================================

A LUT in Reshade is a convenient way of combining and sharing a complete set of Reshade tweaks. 
All the user needs to do is to import the lut.png and apply it – with no need to install (or apply) 
any of the individual shaders used to create it. However – if you want to adjust or refine the palette 
further, you’ll need to add the original shader scripts.

Full Reshade step-by-step tutorial
------------------------------------

1)  Download Reshade: https://reshade.me.
2)  Install: the installer can be run multiple times (once for each sim). 
    Simply follow the prompts and point it at your sim root folder. 
	If using XP Beta, make sure you enable Vulkan mode,
3)  Shaders: sets of shaders can be added during the install process. 
    Un-needed ones can safely be deleted from your reshade-shaders folder.
4)  Hotkeys: set up (or check) the default hot-keys for both the Reshade GUI and screenshot key.
5)  LumaSharpen (or AdaptiveSharpen): adds a controllable amount of sharpness.
6)  LUA file: place [XXX]lua[XXX].png in reshade-shaders/Textures.
7)  LUA shader: edit the target png file entry to the one copied into textures.
8)  Other shaders: enable the LUT shader but make sure you have all other shaders disabled – 
    unless they relate only to sharpening/debanding etc. (ie. nothing to do with lighting or colouring).

Screenshots in XP11
------------------------------------
Note that the default XP11 screenshot method does NOT store the post-processed image as viewed when using Reshade. 
You’ll need to use the Reshade function instead. However if you’re pausing the sim, Reshade captures the top menu as well. 
This can be avoided by using a handy LUA script that “freezes” XP without the menu showing:

User Aircraft Physics Freezer
https://forums.x-plane.org/index.php?/files/file/61318-user-aircraft-physics-freezer/

Images
------------------------------------
1: All shaders active - no LUT applied (lut_pic_01.png)
   If creating a new LUT (or editing existing shaders), disable “Performance Mode” to 
   change the settings per shader script.

2: Setting up the LUT file (lut_pic_02.png)
   Enter the filename of your 1024*32px PNG file here. These files should be saved *uncompressed*.

3: Displaying the LUT (lut_pic_03.png, lut_pic_03.jpg)
   Note: The “Display LUT” shader has to be the very first entry (move by sliding up/down). 
   Make sure the main LUT preset (from maybe a previous session) is *inactive*.

4: The LUT in action (lut_pic_04.png)
   The LUT file in use – with no other shaders active.
   
5) The LUT file (LUT_Adam_TEGBS_01.png)
   
Other Files
------------------------------------  
I've included my FTU/FlyAGI Tweak Utility ini file (FTU_XXXXXX_Global_Settings.lua). 
These files are saved on a *per aircraft* basis. 
Rename this file to include your aircraft name and copy it to:
[your_location]X-Plane 11\Resources\plugins\FlyWithLua\Scripts\FlyAgi_Tweak_Utility\Userdata\Settings

My Reshade ini file:
Adam_TEGBS_XP11_01.ini
Note that this includes reference to unused/redundant Reshade shader scripts.

   
==============================================================
Adamski_NZ
www.nzfsim.org
21 July 2020
