; =================================================================================
; 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 = 3DVision

;============================================================================================= 
; 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 = 100

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

; 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 = 110 

;============================================================================================= 
; 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 = flrOutput.position;"

;============================================================================================= 
; Stereo Correction String
;============================================================================================= 
ShaderStereoString1 = "flrOutput.position.x += vk3d_params.stereo.x * (flrOutput.position.w - vk3d_params.stereo.y);\ngl_Position = flrOutput.position;"

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

;============================================================================================= 
; Supported Shader Types:
; Vertex   ;ShaderType1 = Vertex
; Fragment ;ShaderType1 = Fragment
; Compute  ShaderType1 = Compute
;============================================================================================= 
ShaderType1 = 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

[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 = true

; 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
;=============================================================================================

;0 convergence.
[Key1]
Key = 113 ; F2
Type = once
Convergence = 0.0
StartDelay = 50
ReleaseDelay = 250

;Low convergence.
[Key2]
Key = 114 ; F3
Type = once
Convergence = 150.0
StartDelay = 50
ReleaseDelay = 250

;High convergence.
[Key3]
Key = 115 ; F4
Type = once
Convergence = 300.0
StartDelay = 50
ReleaseDelay = 250

;0 separation and 0 convergence.
[Key4]
Key = 116 ; F5
Type = toggle
Separation = 0.0
Convergence = 0.0

;Toggle specular reflections at surface depth.
[Key5]
Key = 117 ; F6
Type = toggle
x = 1

;Toggle extended LOD.
[Key6]
Key = 119 ; F8
Type = toggle
y = 1

;HUD depth.
[Key7]
Key = 48 ; 0
Type = toggle
z = 0.5

;Volumetric temporal.
[Key8]
Key = 57 ; 9
Type = toggle
w = 1.0

; 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]