; =================================================================================
; VK3DVision - A Vulkan Stereo3D driver made by Helifax for Stereo3D in Vulkan API. 
; www.http://3dsurroundgaming.com/
; PLEASE READ COMMENTS BELOW, to understand what the options DO!
; NOTE: Variables and names are CASE-SENSITIVE!!!
; =================================================================================

[General]
;============================================================================================= 
; Enable Shader Tracking and development mode
; WARNING: This mode will affect performance! Only use it when tracking shaders!
; WARNING: This mode will require a lot more RAM, as NO RESOURCES are DESTROYED!
;============================================================================================= 
DevelopmentMode = false

;============================================================================================= 
; Specify the viewing mode:
; OpenVR - Render in Virtual Reality with maximum performance! (Performance metrics show 14% performance loss only!!! vs regular 3DVision/SBS).
; Includes:
; - Curved Screen with Lumma Sharpen Shader FULLY TAILORED for Virtual Reality!
; - Full VR Controller mapping to XBOX Controller (via ViGEm) and configurable from SteamVR! (Valve Index & Vive Wands controller scheme currently included!)
; - Ability to modify VR Screen Size, VR Screen Height, VR Screen Distance!
; - Ability to Reset VR Screen Orientation to where you HMD is looking at!
; HelixVisionVR - requires HelixVision (https://store.steampowered.com/app/1127310/HelixVision/). A bigger performance hit than OpenVR mode, but provides other features.
; 3DVision - Uses DX9 to render. Works on driver ABOVE 452.06. Requires Nvidia 3D Vision Driver! DO NOT USE ANY OVERLAYS or Performance will be severly affected!
; 3DVision11 - Uses DX11 to render. Works on driver BELOW 452.06. Requires Nvidia 3D Vision Driver!
; SBS_LEFT - Side-by-side, left image first. No Nvidia 3D Vision Driver is required!
; SBS_RIGHT - Side-by-side, right image first. No Nvidia 3D Vision Driver is required!
; TB_LEFT - Top-Bottom, left image at topsas. No Nvidia 3D Vision Driver is required!
; TB_RIGHT - Top-Bottom, right image at top. No Nvidia 3D Vision Driver is required!
; MONO - standard 2D rendering. (Obviously - Default rendering)
;============================================================================================= 
Stereo3DViewMode = 3DVision11

;============================================================================================= 
; Synchronise with Screen Refresh rate.
; Should always keep this ON. Disabling it, will allow for higher FPS but will introduce screen tearing and the image might feel "floaty"!
;============================================================================================= 
Vsync = true

;============================================================================================= 
; Frames Per Second Limit (MAX FPS Limiter).
; 0 - No FPS Limit.
;============================================================================================= 
FPSLimit = 0

[Stereo_Injection]
;============================================================================================= 
; Enables Stereoscopic 3D Injection.
; Enables Shader Swapping with custom ones.
;============================================================================================= 
Stereo = true 

;============================================================================================= 
; Separation & Convergence values that will be used (These will also be used for Nvidia 3D Vision. Values from NvPanel and profile WILL BE IGNORED!)
; Values from 0(%) to 1000(%).
;============================================================================================= 
; Depth that is going to be used in all modes
; Use CTRL+F3/F4 to increase/decrease it.
Separation = 70 ; initial separation

; Convergence that is going to be used in all modes 
; Use CTRL+F5/F6 to increase/decrease it.
Convergence = 1.25 ; initial convergence

; Requires "Vk3DFrameSync.dll" which is a PER-GAME module. 
; If module not found, it doesn't do anything.
; Specify the "mode" index in which the sync will be done!
; (The module must be coded with the "mode" in mind for this to work)
FrameSync = 0

; Binding the Uniform buffer will use in shaders. 
;=============================================================================================
; WARNINNG: This needs to be adjusted per game/app!
; SEE LOG if a CLASH is detected!
; Not adjusting them correctly will CRASH the VULKAN DRIVER!
; KEEP IT AS LOW AS POSSIBLE to AVOID wasting MEMORY and Severly Degrade Performance!
;  See: https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#descriptorsets-sets
;=============================================================================================
UniformLayoutbinding = 45

;============================================================================================= 
; USE THIS OPTION WHEN STARTING A NEW FIX FOR A GAME!!!
; Print the values used by DescriptorSets for the "UniformLayoutBinding" above.
; Check the LOG to see what values are used and adjust "UniformLayoutBinding" accordingly so there IS NO CLASH!
; (Any manually fixed shaders will not work if this value is changed after the shader was modified!!! You will need to adjust the exported shaders with the correct Layout Slot!)
;============================================================================================= 
PrintLayoutBinding = false

;============================================================================================= 
; Part of a STRING that is FOUND in all the shaders. The Uniform Buffer will be inserted after this line.
; Support for 10 Slots: UniformInjection1 - UniformInjection9
;============================================================================================= 
UniformInjection1 = "layout(set"                    
    
;============================================================================================= 
; Part of a STRING that is FOUND in all the SHADERS.
; Support for 99 Slots: ShaderInjectionPoint1 - ShaderInjectionPoint99
;============================================================================================= 
ShaderInjectionPoint1 = "gl_Position = _"

;============================================================================================= 
; Stereo Correction String
;============================================================================================= 
ShaderStereoString1 = "gl_Position.x += vk3d_params.stereo.x * (gl_Position.w - vk3d_params.stereo.y); \n"

;============================================================================================= 
; Options:
; - insert: Will insert the "ShaderStereoString1" after all matches for "ShaderInjectionPoint1". 
; - replace: Will replace the string in "ShaderInjectionPoint1" with "ShaderStereoString1".
;============================================================================================= 
ShaderOperation1 = insert

;============================================================================================= 
; Supported Shader Types:
; Vertex   ;ShaderType1 = Vertex
; Fragment ;ShaderType1 = Fragment
; Compute  ShaderType1 = Compute
;============================================================================================= 
ShaderType1 = Vertex

; screen space
ShaderInjectionPoint2 = "Out.mScreenSpacePositionVec4 ="
ShaderStereoString2 = "Out.mScreenSpacePositionVec4.x += vk3d_params.stereo.x * (Out.mScreenSpacePositionVec4.w - vk3d_params.stereo.y); \n"
ShaderOperation2 = insert
ShaderType2 = Vertex

; temporal frames
ShaderInjectionPoint3 = "Out.mPrevScreenPosition ="
ShaderStereoString3 = "Out.mPrevScreenPosition.x -= vk3d_params.stereo.x * (Out.mPrevScreenPosition.w - vk3d_params.stereo.y); \n"
ShaderOperation3 = insert
ShaderType3 = Vertex

[Params]
;============================================================================================= 
; Values that are sent as a vec4 PER FRAME to all shaders. Can be used for custom operations.
; Currently only ONE Vec4 is sent to shaders!
;============================================================================================= 
; x = 0.0
; y = 0.0
; z = 0.0
w = 0.0 ; initial HUD separation / full depth

[Tools]
;============================================================================================= 
; This is a tool to convert the hashes of a fix made with Vk3DVision PRIOR v.2.0.0
; In V1 Mode, a shader hash was calculated on the binary supplied by the game.
; If the shader binary is recompiled (from the same source code), the hash will be different. A game update might do this!
; In V2 Mode, the hash is calculated on the Source Code of the Shader Binary, after decompilation.
; How to Use:
; Enable the option below. This will make Vk3DVision work in V1 Hash ode.
; Make sure your shaders are in "Vk3DVision/ShaderSwap".
; Start the game and play the game to load all the shaders.
; If a shader is swapped by Vk3DVision it will output the V2 Hash variant in "Vk3DVision/ShaderSwap2"
; All found shaders will be moved from "Vk3DVision/ShaderSwap" to "Vk3DVision/ShaderSwap2" with updated hashes.
; Once all hashes have been coverted, disable the option below and Rename "ShaderSwap2" to "ShaderSwap"
; Start the game again and Vk3DVision will use V2 Hash Mode.
;============================================================================================= 
ConvertHashV1ToV2 = false

;============================================================================================= 
; Enable computation of Hashes using V1 method.
; This SHOULD always be FALSE for new fixes.
; Can be used to enable Legacy compat mode with fixes made with VK3DVision v.1.0.x
;============================================================================================= 
EnableHashV1 = false

; Shortcut Keys
;============================================================================================= 
; From [Key1] to [Key50]. Key numbers MUST BE SEQUENTIAL!
; type = once, hold, toggle
; Supports: convergence, separation values
; For Keyboard Keys see: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
;=============================================================================================
; For Xbox Controller, use these values:
;=============================================================================================
; XBOX_DPAD_UP
; XBOX_DPAD_DOWN
; XBOX_DPAD_LEFT
; XBOX_DPAD_RIGHT
; XBOX_START
; XBOX_BACK
; XBOX_LEFT_THUMB
; XBOX_RIGHT_THUMB
; XBOX_LEFT_SHOULDER
; XBOX_RIGHT_SHOULDER
; XBOX_LEFT_TRIGGER
; XBOX_RIGHT_TRIGGER
; XBOX_A
; XBOX_B
; XBOX_X
; XBOX_Y
;=============================================================================================

; hotkey examples

; [Key1]
; Key = 112 ; F1
; Type = toggle
; Separation = 100
; Convergence = 0.35
; StartDelay = 50
; ReleaseDelay = 250

; [Key2]
; Key = 4 ; MOUSE MIDDLE
; Type = hold
; Separation = 100
; x = 0
; y = 0
; z = 0
; w = 0



; Any changes made for the hotkeys below take effect on the fly after pressing the Save File button up top.

; The "w" parameter controls the separation of the HUD. Use hotkeys to pull the HUD towards the camera.

; F1
[Key1]
Key = 0x70
Type = once
Convergence = 1.25

; F2
[Key2]
Key = 0x71
Type = once
Convergence = 2

; F3
[Key3]
Key = 0x72
Type = once
Convergence = 3

; F4
[Key4]
Key = 0x73
Type = once
Convergence = 6

; F5 HUD full depth
[Key5]
Key = 0x74
Type = toggle
w = 0

; F6 HUD depth
[Key6]
Key = 0x75
Type = toggle
w = 0.15

; F7 HUD depth
[Key7]
Key = 0x76
Type = toggle
w = 0.3

; F8 HUD depth
[Key8]
Key = 0x77
Type = toggle
w = 0.5

; F key used for analysis visor HUD
[Key9]
Key = 0x46
Type = hold
w = 0

; Left D-pad HUD depth - hold key to toggle
[Key10]
Key = XBOX_DPAD_LEFT
Type = toggle
w = 0.3
StartDelay = 500
ReleaseDelay = 500

; Right D-pad HUD depth - hold key to toggle
[Key11]
Key = XBOX_DPAD_RIGHT
Type = toggle
w = 0.15
StartDelay = 500
ReleaseDelay = 500


; more HUD hotkeys
; Tilde~
[Key12]
Key = 0xC0
Type = toggle
Separation = 10

; Numpad7
[Key13]
Key = 0x67
Type = toggle
w = 0.01

; Numpad8
[Key14]
Key = 0x68
Type = toggle
w = 0.05

; Numpad9
[Key15]
Key = 0x69
Type = toggle
w = 0.1

; This section is auto-generated by Vk3DVision. See Scissor Clipping section on how to generate it.
; Scissor Clipping will be extended for the following shaders:
[ScissorClipping]