A little help with d3dx.ini for setting constants with a keyboard toggle
Morning!
I am trying to set up a toggle so that if I press say '/' the fix toggles to the default (unfixed) depth, press it again and it switches to the fixed depth.
If I add a couple of fixed shaders (so I can see how to do it for objects using shaders requiring different values) and the d3dx.ini, would someone edit it with comments so I can then copy and paste please?
Shader #1
[code]//Earthlike Planet atmos too near
cbuffer cb0 : register(b0)
{
float4 cb0[5];
}
cbuffer cb1 : register(b1)
{
float4 cb1[12];
}
Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);
void main(
float4 v0 : NORMAL0,
float4 v1 : POSITION0,
float4 v2 : TANGENT0,
float4 v3 : TEXCOORD0,
out float4 o0 : TEXCOORD0,
out float o1 : TEXCOORD1,
out float4 o2 : SV_Position0)
{
float4 r0,r1,r2;
uint4 bitmask, uiDest;
float4 fDest;
r0.x = 1.000000e+000 / cb0[4].y;
o0.w = cb0[4].x * r0.x;
r1.xyz = v1.xyz;
r1.w = 1.000000000e+000;
r2.x = dot(cb1[9].xyzw, r1.xyzw);
r2.y = dot(cb1[10].xyzw, r1.xyzw);
r2.z = dot(cb1[11].xyzw, r1.xyzw);
r0.xyz = r2.xyz * r0.xxx;
r2.xyz = cb0[1].xyz * r0.yyy;
r0.xyw = r0.xxx * cb0[0].xyz + r2.xyz;
o0.xyz = r0.zzz * cb0[2].xyz + r0.xyw;
o1.x = 1.000000000e+000;
o2.x = dot(cb1[4].xyzw, r1.xyzw);
o2.y = dot(cb1[5].xyzw, r1.xyzw);
o2.z = dot(cb1[6].xyzw, r1.xyzw);
o2.w = dot(cb1[7].xyzw, r1.xyzw);
// Move planet further to depth.
float4 st = StereoParams.Load(0);
float separation = st.x; float convergence = st.y;
o2.x += separation * 30000;
return;
}
[/code]
Shader #2
[code]//Earthlike planet clouds too near
cbuffer cb0 : register(b0)
{
float4 cb0[8];
}
cbuffer cb1 : register(b1)
{
float4 cb1[12];
}
Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);
void main(
float4 v0 : POSITION0,
out float3 o0 : TEXCOORD0,
out float3 o1 : TEXCOORD1,
out float3 o2 : TEXCOORD2,
out float3 o3 : TEXCOORD3,
out float4 o4 : SV_Position0)
{
float4 r0,r1,r2;
uint4 bitmask, uiDest;
float4 fDest;
r0.xyz = v0.xyz;
r0.w = 1.000000000e+000;
r1.x = dot(cb1[10].xyzw, r0.xyzw);
r1.xyz = cb1[10].xyz * r1.xxx;
r1.w = dot(cb1[9].xyzw, r0.xyzw);
r1.xyz = r1.www * cb1[9].xyz + r1.xyz;
r1.w = dot(cb1[11].xyzw, r0.xyzw);
r1.xyz = r1.www * cb1[11].xyz + r1.xyz;
o0.x = dot(cb0[2].xyz, r1.xyz);
o0.y = dot(cb0[3].xyz, r1.xyz);
o0.z = dot(cb0[4].xyz, r1.xyz);
r1.xyz = cb1[10].xyz * -cb0[0].yyy;
r1.xyz = -cb0[0].xxx * cb1[9].xyz + r1.xyz;
r1.xyz = -cb0[0].zzz * cb1[11].xyz + r1.xyz;
o1.x = dot(cb0[2].xyz, r1.xyz);
o1.y = dot(cb0[3].xyz, r1.xyz);
o1.z = dot(cb0[4].xyz, r1.xyz);
r1.x = dot(v0.xyz, v0.xyz);
r1.x = rsqrt(r1.x);
r1.xyz = v0.xyz * r1.xxx;
r2.xyz = cb0[6].xyz * r1.yyy;
r1.xyw = r1.xxx * cb0[5].xyz + r2.xyz;
o2.xyz = r1.zzz * cb0[7].xyz + r1.xyw;
o3.x = dot(cb0[2].xyz, v0.xyz);
o3.y = dot(cb0[3].xyz, v0.xyz);
o3.z = dot(cb0[4].xyz, v0.xyz);
o4.x = dot(cb1[4].xyzw, r0.xyzw);
o4.y = dot(cb1[5].xyzw, r0.xyzw);
o4.z = dot(cb1[6].xyzw, r0.xyzw);
o4.w = dot(cb1[7].xyzw, r0.xyzw);
// Move Clouds to depth.
float4 st = StereoParams.Load(0);
float separation = st.x; float convergence = st.y;
o4.x += separation * 210000;
return;
}
[/code]
the d3dx.ini file
[code];------------------------------------------------------------------------------------------------------
; Logging options.
; Comment line or set value to 0 for no logging.
;------------------------------------------------------------------------------------------------------
[Logging]
; Log all API usage
calls=0
; Log Input key actions
input=0
; Super verbose massive log
debug=0
; Unbuffered logging to avoid missing anything at file end
unbuffered=0
; Force the CPU affinity to use only a single CPU for debugging multi-threaded
force_cpu_affinity=0
; Log NVAPI convergence modifications
convergence=0
; Log NVAPI separation modifications
separation=0
; ------------------------------------------------------------------------------------------------------
; Default constants to pass directly to shaders as IniParams
; ------------------------------------------------------------------------------------------------------
[Constants]
; x = 0.8
; y = 1.0
; z = 1.2
; w = 2.0
;------------------------------------------------------------------------------------------------------
; Custom settings override for any of [convergence, separation, x, y, z, w]
;
; Four types are supported - by default the bindings will simply load the
; configured settings, but type=hold can be specified to have a preset
; active while the button is held, type=toggle can be used to make a simple
; on/off toggle, and type=cycle can be used to cycle between several presets.
;
; Delays (type=hold only) and linear or cosine trasition periods (any key type)
; can be used to better synchonrise setting changes to the game's animations,
; or to smoothly adjust UI elements over a short period of time.
;
; Key bindings: For A-Z and 0-9 on the number row, just use that single
; character. For everything else (including mouse buttons), use the virtual key
; name (with or without the VK_ prefix) or hex code from this article:
; http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
;
; Keys can also be from XBox controllers using:
; XB_LEFT_TRIGGER, XB_RIGHT_TRIGGER,
; XB_LEFT_SHOULDER, XB_RIGHT_SHOULDER,
; XB_LEFT_THUMB, XB_RIGHT_THUMB,
; XB_DPAD_UP, XB_DPAD_DOWN, XB_DPAD_LEFT, XB_DPAD_RIGHT,
; XB_A, XB_B, XB_X, XB_Y, XB_START, XB_BACK
; By default all attached controllers are used - to associate a binding with a
; specific controller add the controller number 1-4 to the prefix, like
; XB2_LEFT_TRIGGER, though this may be more useful for hunting than playing.
;------------------------------------------------------------------------------------------------------
; Example for changing default settings
;[Key1]
;Key = z
;separation = 100.0
;convergence = 4.0
;x = 0.98
; Example to support momentary hold type overrides, like aiming.
;[Key2]
;Key = RBUTTON
;convergence = 0.1
;type = hold
; Example for a toggle override.
;[Key3]
;Key = q
;separation = 0.1
;type = toggle
;y = 0.0
; Example for a momentary hold, but with a delay followed by a smooth
; transition (ms) on hold and release to sync better with the game. Note that
; delay only works with type=hold (for now), while transitions will work with
; all types.
;[Key4]
;Key = XB_LEFT_TRIGGER
;type = hold
;y = 0.25
;delay = 100
;transition = 100
;transition_type = linear
;release_delay = 0
;release_transition = 500
;release_transition_type = cosine
; Example of a cycle transition that might be used to provide several presets
; that set both convergence and UI depth to suit different scenes in a game.
; Cosine transitions are used to smooth the changes over 1/10 of a second.
;[Key5]
;Key = Q
;type = cycle
;convergence = 1.45, 1.13, 0.98
;z = 0.25, 0.5, 0.75
;transition = 100
;transition_type = cosine
;------------------------------------------------------------------------------------------------------
; Shader hunting options.
; Default setup is to use keyboard similar to Helix presets
;------------------------------------------------------------------------------------------------------
[Hunting]
; Release mode is with shader hunting disabled, optimized for speed.
hunting=0
; Highlight mode of currently selected shader / rendertarget.
; "skip" = skip shader. don't render anything using the currently selected shader.
; "original" = fall back to original shader if the currently selected shader was patched.
; "mono" = disable stereo for the selected shader / rendertarget.
; "zero" = shader output is all zero. NOTE: this has a big performance impact.
marking_mode=skip
; Key bindings: For A-Z and 0-9 on the number row, just use that single
; character. For everything else (including mouse buttons), use the virtual key
; name (with or without the VK_ prefix) or hex code from this article:
; http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
;
; XBox controllers are supported using the same bindings as the [Key] sections
; (see above). If the game already uses the first controller you might try
; using the second controller for hunting with e.g. XB2_LEFT_SHOULDER
; rotate through all VISIBLE pixel shaders at the current scene.
next_pixelshader=VK_NUMPAD2
previous_pixelshader=VK_NUMPAD1
mark_pixelshader=VK_NUMPAD3
; rotate through all VISIBLE vertex shaders at the current scene.
next_vertexshader=VK_NUMPAD5
previous_vertexshader=VK_NUMPAD4
mark_vertexshader=VK_NUMPAD6
; rotate through all USED index buffers at the current scene.
next_indexbuffer=VK_NUMPAD8
previous_indexbuffer=VK_NUMPAD7
mark_indexbuffer=VK_NUMPAD9
; rotate through all USED render targets at the current scene.
next_rendertarget=VK_MULTIPLY
previous_rendertarget=VK_DIVIDE
mark_rendertarget=VK_SUBTRACT
; Re-enable shaders once done with hunting:
done_hunting=VK_ADD
; Screenshot as pns
take_screenshot=VK_SNAPSHOT
; reload all fixes from ShaderFixes folder
reload_fixes=VK_F10
; Uncomment to enable experimental support to reload the d3dx.ini live. Note
; that certain settings may only take effect when the game is first launched or
; otherwise may not reload properly, so if something doesn't seem to work after
; reloading the config you should restart the game (e.g. hunting can be enabled
; live, but copy on mark won't work). This can be the same key as reload_fixes
; for convenience, or a different key may be used to avoid resetting the ini
; parameters every time the shaders are reloaded.
;reload_config=VK_F10
; Hold this key to temporarily disable the fix - useful to quickly check what
; an effect looked like in the original game.
;show_original=VK_F11
; tunable parameter to use in modified shaders as variable (StereoParams.Load(int3(1,0,0)).xyzw)
; enabling tuning results in a small performance hit because the parameter texture
;tune1_up=VK_INSERT
;tune1_down=VK_DELETE
; Auto-repeat key rate in events per second.
repeat_rate=6
;------------------------------------------------------------------------------------------------------
; Chain load other wrapper DLLs instead of system DLLs.
;------------------------------------------------------------------------------------------------------
[System]
;proxy_d3d9=d3d9_helix.dll
;proxy_d3d11=d3d11_helix.dll
;------------------------------------------------------------------------------------------------------
; Settings to force display device to a specific mode.
; Uncomment a value to force the specific setting.
;------------------------------------------------------------------------------------------------------
[Device]
; overrides screen resolution.
;width=1280
;height=720
; overrides refresh rate set by game.
;refresh_rate=60
; filters available video modes to those providing given refresh rates.
; some games don't explicitely set the refresh rate, but use the video mode.
; use this if setting refresh_rate doesn't work.
;filter_refresh_rate=24,59,60
; forces creation of full screen devices and swap chains.
; use this for 3dtvplay if game won't active stereo mode.
; a value of 0 doesn't deactivate this option like on the others but
; forces the application into windowed mode.
;full_screen=1
; some games explicitely disable stereo, prohibiting any stereo attempts.
; settings this to 1 ignores all stereo disabling calls and also calls NvAPI_Stereo_Enable to force stereo on.
;force_stereo=1
; almost all DX11 games deactivate window message handling.
; setting this to 1 reenables print screen handling, alt-tab key handling etc.
;allow_windowcommands=1
;------------------------------------------------------------------------------------------------------
; Settings for NVidia stereo driver.
;------------------------------------------------------------------------------------------------------
[Stereo]
; games which have their own stereo renderer disable the NVidia automatic
; stereo mode and render themselves into stereo buffers (Crysis 3 for example).
; Setting this to 1 disables the game stereo renderer and enables NVidia auto stereo mechanism.
automatic_mode=0
; Some games (CryEngine games, for example) lock the separation to a specific
; value, which can be undesirable. Set this to 1 to ignore these requests from
; the game to unlock the separation:
unlock_separation=0
; games without predefined profiles can't save stereo settings.
; enabling this options automatically creates a profile for unknown games.
create_profile=0
; sets the global surface creation heuristic for NVidia stero driver.
; 0 = NVAPI_STEREO_SURFACECREATEMODE_AUTO - use driver registry profile settings for surface creation mode.
; 1 = NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO - Always create stereo surfaces.
; 2 = NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO - Always create mono surfaces.
;surface_createmode=1
; overrides surface creation mode for square surfaces.
;surface_square_createmode=1
;------------------------------------------------------------------------------------------------------
; Settings for GPU manipulations.
; Render settings override
;------------------------------------------------------------------------------------------------------
[Rendering]
; GPU program manipulations.
;
; Shaders in game will be replaced by these custom shaders.
override_directory=ShaderFixes
; Automatically patched shaders will be written here if caching is enabled.
cache_directory=ShaderCache
; Shaders that are directly compiled by the game, instead of binary, go here.
storage_directory=ShaderFromGame
; cache all compiled .txt shaders into .bin. this removes loading stalls.
cache_shaders=1
; preload all patched shaders. there's a bug in NVidia auto stereoization if stereo shaders
; are being loaded during the game on some HW/SW combinations, which turns off auto patching
; for those stereo shaders (results in partial mono rendering). this is a workaround for this case.
preload_shaders=0
; thread save data structure access. required on multithreaded rendering.
use_criticalsection=1
; Setting this option disables scissor limits
rasterizer_disable_scissor=0
;------------------------------------------------------------------------------------------------------
; Analyzation options.
;
; save all autofixed shaders as HLSL
export_fixed=0
; save all shaders sent to DX11 as ASM, or as HLSL text files if compiled by game.
export_shaders=0
; save all shaders seen as HLSL code, autofixed or not. 1= HLSL only, 2=HLSL+OriginalASM, 3=HLSL+OriginalASM+RecompiledASM
export_hlsl=0
; stores a ShaderUsage.txt file on any marking button press.
dump_usage=0
;------------------------------------------------------------------------------------------------------
; Automatic shader fixes. Those settings here apply only on newly read shaders.
; All existing *_replace.txt or *_replace.bin files are not tampered with.
; If you change settings here, the best workflow is to delete all shaders in
; the shader cache directory and let them be fixed again.
; Stereoize all shader parameters with position semantic.
fix_sv_position=0
; Pixel depth evaluation.
;fix_ZRepair_DepthTexture1=SceneDepthTexture.x
;fix_ZRepair_Dependencies1=MinZ_MaxZRatio
;fix_ZRepair_ZPosCalc1=zTex * MinZ_MaxZRatio.z - MinZ_MaxZRatio.w
;fix_ZRepair_DepthTexture2=SceneDepthTexture.x
;fix_ZRepair_Dependencies2=
;fix_ZRepair_ZPosCalc2=zTex
;fix_ZRepair_PositionTexture=PositionTexture
;fix_ZRepair_PositionCalc=1024 * %s
; Inject depth texture if other depth sources are unavailable.
;fix_ZRepair_DepthTextureHash=8a19f087b004598f
; Correct inverse transformations in pixel shaders using evaluated depth.
;fix_InvTransform=ScreenToLight,InverseTranslatedViewProjectionMatrix
; Back projection coordinate fix.
;
; Available variables in expressions:
; stereoParams.x = Separation value in range [0..1] or [-0..-1] dependent on active eye
; stereoParams.y = Convergence value in w coordinates (1/z)
; stereoParams.z = -1/1 for left/right eye
; stereoParams.w = Separation value without eye separation
; stereoTune.x = tune value 1 (default is 1)
; stereoTune.y = tune value 2 (default is 1)
; stereoTune.z = tune value 3 (default is 1)
; stereoTune.w = tune value 4 (default is 1)
; stereoScreenRes.x = Primary swap chain backbuffer horizontal resolution
; stereoScreenRes.y = Primary swap chain backbuffer vertical resolution
; zpos = current pixel z position in pixel shader
; wpos = current pixel w position in pixel shader
; Send inverse transformations from vertex shaders to pixel shaders.
;fix_BackProjectionTransform1=ScreenToTranslatedWorldMatrix._m00,ScreenToTranslatedWorldMatrix._m02,ScreenToTranslatedWorldMatrix._m01
;fix_BackProjectionTransform2=ScreenToWorld._m00,ScreenToWorld._m02,ScreenToWorld._m01
; Position variables to correct in pixel shaders.
;fix_ObjectPosition1=PointPositionAndInverseRadius
;fix_ObjectPosition1Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5, -0.5
;fix_ObjectPosition2=SpotPositionAndInverseRadius
;fix_ObjectPosition2Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5, -0.5
; Matrix multiplications to correct in pixel shaders.
;fix_MatrixOperand1=TranslatedWorldToShadowMatrix
;fix_MatrixOperand1Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5 - viewDirection.z*0.05 + (0.02791946-stereoParams.x/stereoParams.w), 0
; autofix shader option: recompiles all vertex shaders. fixes minor differences in deferred rendering.
;recompile_all_vs=0
;------------------------------------------------------------------------------------------------------
; Shader manipulations without patches + shader filtering.
;------------------------------------------------------------------------------------------------------
;[ShaderOverride1]
;Hash=69732c4f23cb6c48
; Custom stereo separation value while rendering objects using this shader.
;Separation=0
; Custom stereo convergence value while rendering objects using this
; shader (e.g. convergence=0 will move an object to infinity).
;Convergence=0
; don't draw anything using this shader.
;Handling=skip
; advanced option: use this to override only if this shader is used rendering the given index buffer.
;IndexBufferFilter=b3e56ebcb0d20c32
; Use replaced shader only when there is no active depth buffer (for UI filtering)
;depth_filter = depth_inactive
; Use replaced shader only when there *IS* an active depth buffer (for UI filtering)
;depth_filter = depth_active
; Only use replaced shader when it is used in conjunction with a specific shader
; (e.g. to adjust a vertex shader ONLY when it is used with a specific pixel shader)
;partner=af7b880f07630615
;------------------------------------------------------------------------------------------------------
; texture / render target manipulations
;------------------------------------------------------------------------------------------------------
;[TextureOverride1]
;Hash=c3e55ebdb0d20c35
; NVidia stores surface creation mode heuristics in the game profile. setting
; this option overrides the creation mode for a given texture / buffer.
; 0 = NVAPI_STEREO_SURFACECREATEMODE_AUTO - use driver registry profile settings.
; 1 = NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO - create stereo surface.
; 2 = NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO - create mono surface.
;StereoMode=2
;[TextureOverride2]
;...
;------------------------------------------------------------------------------------------------------
; Example of settings override by mouse button configuration
; Mapping of from game provided hard coded convergence values to custom values
; Those are values for L.A. Noir
; Example of settings override by mouse button configuration
;------------------------------------------------------------------------------------------------------
;[ConvergenceMap]
;Map1=from 3e99999a to 0.3
;Map2=from 3f800000 to 1.0
;Map3=from 3f666666 to 0.9
[/code]
Thank you very much in advance! :)
I am trying to set up a toggle so that if I press say '/' the fix toggles to the default (unfixed) depth, press it again and it switches to the fixed depth.
If I add a couple of fixed shaders (so I can see how to do it for objects using shaders requiring different values) and the d3dx.ini, would someone edit it with comments so I can then copy and paste please?
;------------------------------------------------------------------------------------------------------
; Logging options.
; Comment line or set value to 0 for no logging.
;------------------------------------------------------------------------------------------------------
[Logging]
; Log all API usage
calls=0
; Log Input key actions
input=0
; Super verbose massive log
debug=0
; Unbuffered logging to avoid missing anything at file end
unbuffered=0
; Force the CPU affinity to use only a single CPU for debugging multi-threaded
force_cpu_affinity=0
; ------------------------------------------------------------------------------------------------------
; Default constants to pass directly to shaders as IniParams
; ------------------------------------------------------------------------------------------------------
[Constants]
; x = 0.8
; y = 1.0
; z = 1.2
; w = 2.0
;------------------------------------------------------------------------------------------------------
; Custom settings override for any of [convergence, separation, x, y, z, w]
;
; Four types are supported - by default the bindings will simply load the
; configured settings, but type=hold can be specified to have a preset
; active while the button is held, type=toggle can be used to make a simple
; on/off toggle, and type=cycle can be used to cycle between several presets.
;
; Delays (type=hold only) and linear or cosine trasition periods (any key type)
; can be used to better synchonrise setting changes to the game's animations,
; or to smoothly adjust UI elements over a short period of time.
;
; Key bindings: For A-Z and 0-9 on the number row, just use that single
; character. For everything else (including mouse buttons), use the virtual key
; name (with or without the VK_ prefix) or hex code from this article:
; http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx ;
; Keys can also be from XBox controllers using:
; XB_LEFT_TRIGGER, XB_RIGHT_TRIGGER,
; XB_LEFT_SHOULDER, XB_RIGHT_SHOULDER,
; XB_LEFT_THUMB, XB_RIGHT_THUMB,
; XB_DPAD_UP, XB_DPAD_DOWN, XB_DPAD_LEFT, XB_DPAD_RIGHT,
; XB_A, XB_B, XB_X, XB_Y, XB_START, XB_BACK
; By default all attached controllers are used - to associate a binding with a
; specific controller add the controller number 1-4 to the prefix, like
; XB2_LEFT_TRIGGER, though this may be more useful for hunting than playing.
;------------------------------------------------------------------------------------------------------
; Example for changing default settings
;[Key1]
;Key = z
;separation = 100.0
;convergence = 4.0
;x = 0.98
; Example to support momentary hold type overrides, like aiming.
;[Key2]
;Key = RBUTTON
;convergence = 0.1
;type = hold
; Example for a toggle override.
;[Key3]
;Key = q
;separation = 0.1
;type = toggle
;y = 0.0
; Example for a momentary hold, but with a delay followed by a smooth
; transition (ms) on hold and release to sync better with the game. Note that
; delay only works with type=hold (for now), while transitions will work with
; all types.
;[Key4]
;Key = XB_LEFT_TRIGGER
;type = hold
;y = 0.25
;delay = 100
;transition = 100
;transition_type = linear
;release_delay = 0
;release_transition = 500
;release_transition_type = cosine
; Example of a cycle transition that might be used to provide several presets
; that set both convergence and UI depth to suit different scenes in a game.
; Cosine transitions are used to smooth the changes over 1/10 of a second.
;[Key5]
;Key = Q
;type = cycle
;convergence = 1.45, 1.13, 0.98
;z = 0.25, 0.5, 0.75
;transition = 100
;transition_type = cosine
;------------------------------------------------------------------------------------------------------
; Shader hunting options.
; Default setup is to use keyboard similar to Helix presets
;------------------------------------------------------------------------------------------------------
[Hunting]
; Release mode is with shader hunting disabled, optimized for speed.
hunting=0
; Highlight mode of currently selected shader / rendertarget.
; "skip" = skip shader. don't render anything using the currently selected shader.
; "original" = fall back to original shader if the currently selected shader was patched.
; "mono" = disable stereo for the selected shader / rendertarget.
; "zero" = shader output is all zero. NOTE: this has a big performance impact.
marking_mode=skip
; Key bindings: For A-Z and 0-9 on the number row, just use that single
; character. For everything else (including mouse buttons), use the virtual key
; name (with or without the VK_ prefix) or hex code from this article:
; http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx ;
; XBox controllers are supported using the same bindings as the [Key] sections
; (see above). If the game already uses the first controller you might try
; using the second controller for hunting with e.g. XB2_LEFT_SHOULDER
; rotate through all VISIBLE pixel shaders at the current scene.
next_pixelshader=VK_NUMPAD2
previous_pixelshader=VK_NUMPAD1
mark_pixelshader=VK_NUMPAD3
; rotate through all VISIBLE vertex shaders at the current scene.
next_vertexshader=VK_NUMPAD5
previous_vertexshader=VK_NUMPAD4
mark_vertexshader=VK_NUMPAD6
; rotate through all USED index buffers at the current scene.
next_indexbuffer=VK_NUMPAD8
previous_indexbuffer=VK_NUMPAD7
mark_indexbuffer=VK_NUMPAD9
; rotate through all USED render targets at the current scene.
next_rendertarget=VK_MULTIPLY
previous_rendertarget=VK_DIVIDE
mark_rendertarget=VK_SUBTRACT
; Re-enable shaders once done with hunting:
done_hunting=VK_ADD
; Screenshot as pns
take_screenshot=VK_SNAPSHOT
; reload all fixes from ShaderFixes folder
reload_fixes=VK_F10
; Uncomment to enable experimental support to reload the d3dx.ini live. Note
; that certain settings may only take effect when the game is first launched or
; otherwise may not reload properly, so if something doesn't seem to work after
; reloading the config you should restart the game (e.g. hunting can be enabled
; live, but copy on mark won't work). This can be the same key as reload_fixes
; for convenience, or a different key may be used to avoid resetting the ini
; parameters every time the shaders are reloaded.
;reload_config=VK_F10
; Hold this key to temporarily disable the fix - useful to quickly check what
; an effect looked like in the original game.
;show_original=VK_F11
; tunable parameter to use in modified shaders as variable (StereoParams.Load(int3(1,0,0)).xyzw)
; enabling tuning results in a small performance hit because the parameter texture
;tune1_up=VK_INSERT
;tune1_down=VK_DELETE
; Auto-repeat key rate in events per second.
repeat_rate=6
;------------------------------------------------------------------------------------------------------
; Chain load other wrapper DLLs instead of system DLLs.
;------------------------------------------------------------------------------------------------------
[System]
;------------------------------------------------------------------------------------------------------
; Settings to force display device to a specific mode.
; Uncomment a value to force the specific setting.
;------------------------------------------------------------------------------------------------------
[Device]
; overrides refresh rate set by game.
;refresh_rate=60
; filters available video modes to those providing given refresh rates.
; some games don't explicitely set the refresh rate, but use the video mode.
; use this if setting refresh_rate doesn't work.
;filter_refresh_rate=24,59,60
; forces creation of full screen devices and swap chains.
; use this for 3dtvplay if game won't active stereo mode.
; a value of 0 doesn't deactivate this option like on the others but
; forces the application into windowed mode.
;full_screen=1
; some games explicitely disable stereo, prohibiting any stereo attempts.
; settings this to 1 ignores all stereo disabling calls and also calls NvAPI_Stereo_Enable to force stereo on.
;force_stereo=1
; almost all DX11 games deactivate window message handling.
; setting this to 1 reenables print screen handling, alt-tab key handling etc.
;allow_windowcommands=1
;------------------------------------------------------------------------------------------------------
; Settings for NVidia stereo driver.
;------------------------------------------------------------------------------------------------------
[Stereo]
; games which have their own stereo renderer disable the NVidia automatic
; stereo mode and render themselves into stereo buffers (Crysis 3 for example).
; Setting this to 1 disables the game stereo renderer and enables NVidia auto stereo mechanism.
automatic_mode=0
; Some games (CryEngine games, for example) lock the separation to a specific
; value, which can be undesirable. Set this to 1 to ignore these requests from
; the game to unlock the separation:
unlock_separation=0
; games without predefined profiles can't save stereo settings.
; enabling this options automatically creates a profile for unknown games.
create_profile=0
; sets the global surface creation heuristic for NVidia stero driver.
; 0 = NVAPI_STEREO_SURFACECREATEMODE_AUTO - use driver registry profile settings for surface creation mode.
; 1 = NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO - Always create stereo surfaces.
; 2 = NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO - Always create mono surfaces.
;surface_createmode=1
; overrides surface creation mode for square surfaces.
;surface_square_createmode=1
; GPU program manipulations.
;
; Shaders in game will be replaced by these custom shaders.
override_directory=ShaderFixes
; Automatically patched shaders will be written here if caching is enabled.
cache_directory=ShaderCache
; Shaders that are directly compiled by the game, instead of binary, go here.
storage_directory=ShaderFromGame
; cache all compiled .txt shaders into .bin. this removes loading stalls.
cache_shaders=1
; preload all patched shaders. there's a bug in NVidia auto stereoization if stereo shaders
; are being loaded during the game on some HW/SW combinations, which turns off auto patching
; for those stereo shaders (results in partial mono rendering). this is a workaround for this case.
preload_shaders=0
; thread save data structure access. required on multithreaded rendering.
use_criticalsection=1
; Setting this option disables scissor limits
rasterizer_disable_scissor=0
;------------------------------------------------------------------------------------------------------
; Analyzation options.
;
; save all autofixed shaders as HLSL
export_fixed=0
; save all shaders sent to DX11 as ASM, or as HLSL text files if compiled by game.
export_shaders=0
; save all shaders seen as HLSL code, autofixed or not. 1= HLSL only, 2=HLSL+OriginalASM, 3=HLSL+OriginalASM+RecompiledASM
export_hlsl=0
; stores a ShaderUsage.txt file on any marking button press.
dump_usage=0
;------------------------------------------------------------------------------------------------------
; Automatic shader fixes. Those settings here apply only on newly read shaders.
; All existing *_replace.txt or *_replace.bin files are not tampered with.
; If you change settings here, the best workflow is to delete all shaders in
; the shader cache directory and let them be fixed again.
; Stereoize all shader parameters with position semantic.
fix_sv_position=0
; Inject depth texture if other depth sources are unavailable.
;fix_ZRepair_DepthTextureHash=8a19f087b004598f
; Correct inverse transformations in pixel shaders using evaluated depth.
;fix_InvTransform=ScreenToLight,InverseTranslatedViewProjectionMatrix
; Back projection coordinate fix.
;
; Available variables in expressions:
; stereoParams.x = Separation value in range [0..1] or [-0..-1] dependent on active eye
; stereoParams.y = Convergence value in w coordinates (1/z)
; stereoParams.z = -1/1 for left/right eye
; stereoParams.w = Separation value without eye separation
; stereoTune.x = tune value 1 (default is 1)
; stereoTune.y = tune value 2 (default is 1)
; stereoTune.z = tune value 3 (default is 1)
; stereoTune.w = tune value 4 (default is 1)
; stereoScreenRes.x = Primary swap chain backbuffer horizontal resolution
; stereoScreenRes.y = Primary swap chain backbuffer vertical resolution
; zpos = current pixel z position in pixel shader
; wpos = current pixel w position in pixel shader
; Send inverse transformations from vertex shaders to pixel shaders.
;fix_BackProjectionTransform1=ScreenToTranslatedWorldMatrix._m00,ScreenToTranslatedWorldMatrix._m02,ScreenToTranslatedWorldMatrix._m01
;fix_BackProjectionTransform2=ScreenToWorld._m00,ScreenToWorld._m02,ScreenToWorld._m01
; Position variables to correct in pixel shaders.
;fix_ObjectPosition1=PointPositionAndInverseRadius
;fix_ObjectPosition1Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5, -0.5
;fix_ObjectPosition2=SpotPositionAndInverseRadius
;fix_ObjectPosition2Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5, -0.5
; Matrix multiplications to correct in pixel shaders.
;fix_MatrixOperand1=TranslatedWorldToShadowMatrix
;fix_MatrixOperand1Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5 - viewDirection.z*0.05 + (0.02791946-stereoParams.x/stereoParams.w), 0
; autofix shader option: recompiles all vertex shaders. fixes minor differences in deferred rendering.
;recompile_all_vs=0
;------------------------------------------------------------------------------------------------------
; Shader manipulations without patches + shader filtering.
;------------------------------------------------------------------------------------------------------
;[ShaderOverride1]
;Hash=69732c4f23cb6c48
; Custom stereo separation value while rendering objects using this shader.
;Separation=0
; Custom stereo convergence value while rendering objects using this
; shader (e.g. convergence=0 will move an object to infinity).
;Convergence=0
; don't draw anything using this shader.
;Handling=skip
; advanced option: use this to override only if this shader is used rendering the given index buffer.
;IndexBufferFilter=b3e56ebcb0d20c32
; Use replaced shader only when there is no active depth buffer (for UI filtering)
;depth_filter = depth_inactive
; Use replaced shader only when there *IS* an active depth buffer (for UI filtering)
;depth_filter = depth_active
; Only use replaced shader when it is used in conjunction with a specific shader
; (e.g. to adjust a vertex shader ONLY when it is used with a specific pixel shader)
;partner=af7b880f07630615
;------------------------------------------------------------------------------------------------------
; texture / render target manipulations
;------------------------------------------------------------------------------------------------------
;[TextureOverride1]
;Hash=c3e55ebdb0d20c35
; NVidia stores surface creation mode heuristics in the game profile. setting
; this option overrides the creation mode for a given texture / buffer.
; 0 = NVAPI_STEREO_SURFACECREATEMODE_AUTO - use driver registry profile settings.
; 1 = NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO - create stereo surface.
; 2 = NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO - create mono surface.
;StereoMode=2
;[TextureOverride2]
;...
;------------------------------------------------------------------------------------------------------
; Example of settings override by mouse button configuration
; Mapping of from game provided hard coded convergence values to custom values
; Those are values for L.A. Noir
; Example of settings override by mouse button configuration
;------------------------------------------------------------------------------------------------------
;[ConvergenceMap]
;Map1=from 3e99999a to 0.3
;Map2=from 3f800000 to 1.0
;Map3=from 3f666666 to 0.9
Thank you very much in advance! :)
Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.
-------------------
Vitals: Windows 7 64bit, i5 2500 @ 4.4ghz, SLI GTX670, 8GB, Viewsonic VX2268WM
What you need to do is:
1) in d3dx.ini add something like:
[code]
[Key1]
Key = /
; You can pick any constant you like. For example we will use ".w"
w = 1.0
type=toggle
[/code]
2) In your shader (for ex Vertex):
[code]
//Earthlike Planet atmos too near
cbuffer cb0 : register(b0)
{
float4 cb0[5];
}
cbuffer cb1 : register(b1)
{
float4 cb1[12];
}
Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);
void main(
float4 v0 : NORMAL0,
float4 v1 : POSITION0,
float4 v2 : TANGENT0,
float4 v3 : TEXCOORD0,
out float4 o0 : TEXCOORD0,
out float o1 : TEXCOORD1,
out float4 o2 : SV_Position0)
{
float4 r0,r1,r2;
uint4 bitmask, uiDest;
float4 fDest;
r0.x = 1.000000e+000 / cb0[4].y;
o0.w = cb0[4].x * r0.x;
r1.xyz = v1.xyz;
r1.w = 1.000000000e+000;
r2.x = dot(cb1[9].xyzw, r1.xyzw);
r2.y = dot(cb1[10].xyzw, r1.xyzw);
r2.z = dot(cb1[11].xyzw, r1.xyzw);
r0.xyz = r2.xyz * r0.xxx;
r2.xyz = cb0[1].xyz * r0.yyy;
r0.xyw = r0.xxx * cb0[0].xyz + r2.xyz;
o0.xyz = r0.zzz * cb0[2].xyz + r0.xyw;
o1.x = 1.000000000e+000;
o2.x = dot(cb1[4].xyzw, r1.xyzw);
o2.y = dot(cb1[5].xyzw, r1.xyzw);
o2.z = dot(cb1[6].xyzw, r1.xyzw);
o2.w = dot(cb1[7].xyzw, r1.xyzw);
// Move planet further to depth.
// Load Stereo Parameters
float4 st = StereoParams.Load(0);
float separation = st.x;
float convergence = st.y;
// Load Custom Parameters used by 3dMigoto
float4 params = IniParams.Load(0);
// We check to see that ".w" is coming from the "Key press" or not.
// If the value is less than 1.0 (it means that we didn't set it by our key press)
if (params.w < 1.0)
{
// Apply normal separation
o2.x += separation * 30000;
}
// Else the above instruction will not be executed and thus no correction applied
return;
}
[/code]
Hope this helps and shows how you can use a key to send a custom parameter in a shader. Check it in the shader and select the execution mode based on it;)
Cheers!
Helifax
// Move planet further to depth.
// Load Stereo Parameters
float4 st = StereoParams.Load(0);
float separation = st.x;
float convergence = st.y;
// Load Custom Parameters used by 3dMigoto
float4 params = IniParams.Load(0);
// We check to see that ".w" is coming from the "Key press" or not.
// If the value is less than 1.0 (it means that we didn't set it by our key press)
if (params.w < 1.0)
{
// Apply normal separation
o2.x += separation * 30000;
}
// Else the above instruction will not be executed and thus no correction applied
return;
}
Hope this helps and shows how you can use a key to send a custom parameter in a shader. Check it in the shader and select the execution mode based on it;)
Cheers!
Helifax
1x Palit RTX 2080Ti Pro Gaming OC(watercooled and overclocked to hell)
3x 3D Vision Ready Asus VG278HE monitors (5760x1080).
Intel i9 9900K (overclocked to 5.3 and watercooled ofc).
Asus Maximus XI Hero Mobo.
16 GB Team Group T-Force Dark Pro DDR4 @ 3600.
Lots of Disks:
- Raid 0 - 256GB Sandisk Extreme SSD.
- Raid 0 - WD Black - 2TB.
- SanDisk SSD PLUS 480 GB.
- Intel 760p 256GB M.2 PCIe NVMe SSD.
Creative Sound Blaster Z.
Windows 10 x64 Pro.
etc
Mate!
Thanks, helpful commenting too.
It's not working for me though. I am not sure why because I can read the logic and it even makes sense to me: If w is less than 1 then do shader; else do nothing. The toggle is 1.
It is like the shaders aren't working at all. Presumably I have missed something?
I tried setting the w constant near the top to 0 but that didn't do anything either. I also tried different keys e.g. ']'
I am using the 1.0.1 version of 3DMigoto but I that shouldn't make a difference because the comments seem built into the d3dx.ini.
[code];------------------------------------------------------------------------------------------------------
; Logging options.
; Comment line or set value to 0 for no logging.
;------------------------------------------------------------------------------------------------------
[Logging]
; Log all API usage
calls=0
; Log Input key actions
input=0
; Super verbose massive log
debug=0
; Unbuffered logging to avoid missing anything at file end
unbuffered=0
; Force the CPU affinity to use only a single CPU for debugging multi-threaded
force_cpu_affinity=0
; Log NVAPI convergence modifications
convergence=0
; Log NVAPI separation modifications
separation=0
; ------------------------------------------------------------------------------------------------------
; Default constants to pass directly to shaders as IniParams
; ------------------------------------------------------------------------------------------------------
[Constants]
; x = 0.8
; y = 1.0
; z = 1.2
; w = 0
;------------------------------------------------------------------------------------------------------
; Custom settings override for any of [convergence, separation, x, y, z, w]
;
; Four types are supported - by default the bindings will simply load the
; configured settings, but type=hold can be specified to have a preset
; active while the button is held, type=toggle can be used to make a simple
; on/off toggle, and type=cycle can be used to cycle between several presets.
;
; Delays (type=hold only) and linear or cosine trasition periods (any key type)
; can be used to better synchonrise setting changes to the game's animations,
; or to smoothly adjust UI elements over a short period of time.
;
; Key bindings: For A-Z and 0-9 on the number row, just use that single
; character. For everything else (including mouse buttons), use the virtual key
; name (with or without the VK_ prefix) or hex code from this article:
; http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
;
; Keys can also be from XBox controllers using:
; XB_LEFT_TRIGGER, XB_RIGHT_TRIGGER,
; XB_LEFT_SHOULDER, XB_RIGHT_SHOULDER,
; XB_LEFT_THUMB, XB_RIGHT_THUMB,
; XB_DPAD_UP, XB_DPAD_DOWN, XB_DPAD_LEFT, XB_DPAD_RIGHT,
; XB_A, XB_B, XB_X, XB_Y, XB_START, XB_BACK
; By default all attached controllers are used - to associate a binding with a
; specific controller add the controller number 1-4 to the prefix, like
; XB2_LEFT_TRIGGER, though this may be more useful for hunting than playing.
;------------------------------------------------------------------------------------------------------
; Example for changing default settings
[Key1]
Key = /
type = toggle
w = 1.0
;separation = 100.0
;convergence = 4.0
;x = 0.98
; Example to support momentary hold type overrides, like aiming.
;[Key2]
;Key = RBUTTON
;convergence = 0.1
;type = hold
; Example for a toggle override.
;[Key3]
;Key = q
;separation = 0.1
;type = toggle
;y = 0.0
; Example for a momentary hold, but with a delay followed by a smooth
; transition (ms) on hold and release to sync better with the game. Note that
; delay only works with type=hold (for now), while transitions will work with
; all types.
;[Key4]
;Key = XB_LEFT_TRIGGER
;type = hold
;y = 0.25
;delay = 100
;transition = 100
;transition_type = linear
;release_delay = 0
;release_transition = 500
;release_transition_type = cosine
; Example of a cycle transition that might be used to provide several presets
; that set both convergence and UI depth to suit different scenes in a game.
; Cosine transitions are used to smooth the changes over 1/10 of a second.
;[Key5]
;Key = Q
;type = cycle
;convergence = 1.45, 1.13, 0.98
;z = 0.25, 0.5, 0.75
;transition = 100
;transition_type = cosine
;------------------------------------------------------------------------------------------------------
; Shader hunting options.
; Default setup is to use keyboard similar to Helix presets
;------------------------------------------------------------------------------------------------------
[Hunting]
; Release mode is with shader hunting disabled, optimized for speed.
hunting=0
; Highlight mode of currently selected shader / rendertarget.
; "skip" = skip shader. don't render anything using the currently selected shader.
; "original" = fall back to original shader if the currently selected shader was patched.
; "mono" = disable stereo for the selected shader / rendertarget.
; "zero" = shader output is all zero. NOTE: this has a big performance impact.
marking_mode=skip
; Key bindings: For A-Z and 0-9 on the number row, just use that single
; character. For everything else (including mouse buttons), use the virtual key
; name (with or without the VK_ prefix) or hex code from this article:
; http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
;
; XBox controllers are supported using the same bindings as the [Key] sections
; (see above). If the game already uses the first controller you might try
; using the second controller for hunting with e.g. XB2_LEFT_SHOULDER
; rotate through all VISIBLE pixel shaders at the current scene.
next_pixelshader=VK_NUMPAD2
previous_pixelshader=VK_NUMPAD1
mark_pixelshader=VK_NUMPAD3
; rotate through all VISIBLE vertex shaders at the current scene.
next_vertexshader=VK_NUMPAD5
previous_vertexshader=VK_NUMPAD4
mark_vertexshader=VK_NUMPAD6
; rotate through all USED index buffers at the current scene.
next_indexbuffer=VK_NUMPAD8
previous_indexbuffer=VK_NUMPAD7
mark_indexbuffer=VK_NUMPAD9
; rotate through all USED render targets at the current scene.
next_rendertarget=VK_MULTIPLY
previous_rendertarget=VK_DIVIDE
mark_rendertarget=VK_SUBTRACT
; Re-enable shaders once done with hunting:
done_hunting=VK_ADD
; Screenshot as pns
take_screenshot=VK_SNAPSHOT
; reload all fixes from ShaderFixes folder
reload_fixes=VK_F10
; Uncomment to enable experimental support to reload the d3dx.ini live. Note
; that certain settings may only take effect when the game is first launched or
; otherwise may not reload properly, so if something doesn't seem to work after
; reloading the config you should restart the game (e.g. hunting can be enabled
; live, but copy on mark won't work). This can be the same key as reload_fixes
; for convenience, or a different key may be used to avoid resetting the ini
; parameters every time the shaders are reloaded.
;reload_config=VK_F10
; Hold this key to temporarily disable the fix - useful to quickly check what
; an effect looked like in the original game.
;show_original=VK_F11
; tunable parameter to use in modified shaders as variable (StereoParams.Load(int3(1,0,0)).xyzw)
; enabling tuning results in a small performance hit because the parameter texture
;tune1_up=VK_INSERT
;tune1_down=VK_DELETE
; Auto-repeat key rate in events per second.
repeat_rate=6
;------------------------------------------------------------------------------------------------------
; Chain load other wrapper DLLs instead of system DLLs.
;------------------------------------------------------------------------------------------------------
[System]
;proxy_d3d9=d3d9_helix.dll
;proxy_d3d11=d3d11_helix.dll
;------------------------------------------------------------------------------------------------------
; Settings to force display device to a specific mode.
; Uncomment a value to force the specific setting.
;------------------------------------------------------------------------------------------------------
[Device]
; overrides screen resolution.
;width=1280
;height=720
; overrides refresh rate set by game.
;refresh_rate=60
; filters available video modes to those providing given refresh rates.
; some games don't explicitely set the refresh rate, but use the video mode.
; use this if setting refresh_rate doesn't work.
;filter_refresh_rate=24,59,60
; forces creation of full screen devices and swap chains.
; use this for 3dtvplay if game won't active stereo mode.
; a value of 0 doesn't deactivate this option like on the others but
; forces the application into windowed mode.
;full_screen=1
; some games explicitely disable stereo, prohibiting any stereo attempts.
; settings this to 1 ignores all stereo disabling calls and also calls NvAPI_Stereo_Enable to force stereo on.
;force_stereo=1
; almost all DX11 games deactivate window message handling.
; setting this to 1 reenables print screen handling, alt-tab key handling etc.
;allow_windowcommands=1
;------------------------------------------------------------------------------------------------------
; Settings for NVidia stereo driver.
;------------------------------------------------------------------------------------------------------
[Stereo]
; games which have their own stereo renderer disable the NVidia automatic
; stereo mode and render themselves into stereo buffers (Crysis 3 for example).
; Setting this to 1 disables the game stereo renderer and enables NVidia auto stereo mechanism.
automatic_mode=0
; Some games (CryEngine games, for example) lock the separation to a specific
; value, which can be undesirable. Set this to 1 to ignore these requests from
; the game to unlock the separation:
unlock_separation=0
; games without predefined profiles can't save stereo settings.
; enabling this options automatically creates a profile for unknown games.
create_profile=0
; sets the global surface creation heuristic for NVidia stero driver.
; 0 = NVAPI_STEREO_SURFACECREATEMODE_AUTO - use driver registry profile settings for surface creation mode.
; 1 = NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO - Always create stereo surfaces.
; 2 = NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO - Always create mono surfaces.
;surface_createmode=1
; overrides surface creation mode for square surfaces.
;surface_square_createmode=1
;------------------------------------------------------------------------------------------------------
; Settings for GPU manipulations.
; Render settings override
;------------------------------------------------------------------------------------------------------
[Rendering]
; GPU program manipulations.
;
; Shaders in game will be replaced by these custom shaders.
override_directory=ShaderFixes
; Automatically patched shaders will be written here if caching is enabled.
cache_directory=ShaderCache
; Shaders that are directly compiled by the game, instead of binary, go here.
storage_directory=ShaderFromGame
; cache all compiled .txt shaders into .bin. this removes loading stalls.
cache_shaders=1
; preload all patched shaders. there's a bug in NVidia auto stereoization if stereo shaders
; are being loaded during the game on some HW/SW combinations, which turns off auto patching
; for those stereo shaders (results in partial mono rendering). this is a workaround for this case.
preload_shaders=0
; thread save data structure access. required on multithreaded rendering.
use_criticalsection=1
; Setting this option disables scissor limits
rasterizer_disable_scissor=0
;------------------------------------------------------------------------------------------------------
; Analyzation options.
;
; save all autofixed shaders as HLSL
export_fixed=0
; save all shaders sent to DX11 as ASM, or as HLSL text files if compiled by game.
export_shaders=0
; save all shaders seen as HLSL code, autofixed or not. 1= HLSL only, 2=HLSL+OriginalASM, 3=HLSL+OriginalASM+RecompiledASM
export_hlsl=0
; stores a ShaderUsage.txt file on any marking button press.
dump_usage=0
;------------------------------------------------------------------------------------------------------
; Automatic shader fixes. Those settings here apply only on newly read shaders.
; All existing *_replace.txt or *_replace.bin files are not tampered with.
; If you change settings here, the best workflow is to delete all shaders in
; the shader cache directory and let them be fixed again.
; Stereoize all shader parameters with position semantic.
fix_sv_position=0
; Pixel depth evaluation.
;fix_ZRepair_DepthTexture1=SceneDepthTexture.x
;fix_ZRepair_Dependencies1=MinZ_MaxZRatio
;fix_ZRepair_ZPosCalc1=zTex * MinZ_MaxZRatio.z - MinZ_MaxZRatio.w
;fix_ZRepair_DepthTexture2=SceneDepthTexture.x
;fix_ZRepair_Dependencies2=
;fix_ZRepair_ZPosCalc2=zTex
;fix_ZRepair_PositionTexture=PositionTexture
;fix_ZRepair_PositionCalc=1024 * %s
; Inject depth texture if other depth sources are unavailable.
;fix_ZRepair_DepthTextureHash=8a19f087b004598f
; Correct inverse transformations in pixel shaders using evaluated depth.
;fix_InvTransform=ScreenToLight,InverseTranslatedViewProjectionMatrix
; Back projection coordinate fix.
;
; Available variables in expressions:
; stereoParams.x = Separation value in range [0..1] or [-0..-1] dependent on active eye
; stereoParams.y = Convergence value in w coordinates (1/z)
; stereoParams.z = -1/1 for left/right eye
; stereoParams.w = Separation value without eye separation
; stereoTune.x = tune value 1 (default is 1)
; stereoTune.y = tune value 2 (default is 1)
; stereoTune.z = tune value 3 (default is 1)
; stereoTune.w = tune value 4 (default is 1)
; stereoScreenRes.x = Primary swap chain backbuffer horizontal resolution
; stereoScreenRes.y = Primary swap chain backbuffer vertical resolution
; zpos = current pixel z position in pixel shader
; wpos = current pixel w position in pixel shader
; Send inverse transformations from vertex shaders to pixel shaders.
;fix_BackProjectionTransform1=ScreenToTranslatedWorldMatrix._m00,ScreenToTranslatedWorldMatrix._m02,ScreenToTranslatedWorldMatrix._m01
;fix_BackProjectionTransform2=ScreenToWorld._m00,ScreenToWorld._m02,ScreenToWorld._m01
; Position variables to correct in pixel shaders.
;fix_ObjectPosition1=PointPositionAndInverseRadius
;fix_ObjectPosition1Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5, -0.5
;fix_ObjectPosition2=SpotPositionAndInverseRadius
;fix_ObjectPosition2Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5, -0.5
; Matrix multiplications to correct in pixel shaders.
;fix_MatrixOperand1=TranslatedWorldToShadowMatrix
;fix_MatrixOperand1Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5 - viewDirection.z*0.05 + (0.02791946-stereoParams.x/stereoParams.w), 0
; autofix shader option: recompiles all vertex shaders. fixes minor differences in deferred rendering.
;recompile_all_vs=0
;------------------------------------------------------------------------------------------------------
; Shader manipulations without patches + shader filtering.
;------------------------------------------------------------------------------------------------------
;[ShaderOverride1]
;Hash=69732c4f23cb6c48
; Custom stereo separation value while rendering objects using this shader.
;Separation=0
; Custom stereo convergence value while rendering objects using this
; shader (e.g. convergence=0 will move an object to infinity).
;Convergence=0
; don't draw anything using this shader.
;Handling=skip
; advanced option: use this to override only if this shader is used rendering the given index buffer.
;IndexBufferFilter=b3e56ebcb0d20c32
; Use replaced shader only when there is no active depth buffer (for UI filtering)
;depth_filter = depth_inactive
; Use replaced shader only when there *IS* an active depth buffer (for UI filtering)
;depth_filter = depth_active
; Only use replaced shader when it is used in conjunction with a specific shader
; (e.g. to adjust a vertex shader ONLY when it is used with a specific pixel shader)
;partner=af7b880f07630615
;------------------------------------------------------------------------------------------------------
; texture / render target manipulations
;------------------------------------------------------------------------------------------------------
;[TextureOverride1]
;Hash=c3e55ebdb0d20c35
; NVidia stores surface creation mode heuristics in the game profile. setting
; this option overrides the creation mode for a given texture / buffer.
; 0 = NVAPI_STEREO_SURFACECREATEMODE_AUTO - use driver registry profile settings.
; 1 = NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO - create stereo surface.
; 2 = NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO - create mono surface.
;StereoMode=2
;[TextureOverride2]
;...
;------------------------------------------------------------------------------------------------------
; Example of settings override by mouse button configuration
; Mapping of from game provided hard coded convergence values to custom values
; Those are values for L.A. Noir
; Example of settings override by mouse button configuration
;------------------------------------------------------------------------------------------------------
;[ConvergenceMap]
;Map1=from 3e99999a to 0.3
;Map2=from 3f800000 to 1.0
;Map3=from 3f666666 to 0.9
[/code]
and a shader
[code]//Star Texture
cbuffer cb0 : register(b0)
{
float4 cb0[10];
}
cbuffer cb1 : register(b1)
{
float4 cb1[12];
}
Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);
void main(
float4 v0 : TEXCOORD0,
out float4 o0 : TEXCOORD0,
out float4 o1 : TEXCOORD1,
out float3 o2 : TEXCOORD2,
out float3 o3 : TEXCOORD3,
out float3 o4 : TEXCOORD4,
out float2 o5 : TEXCOORD5,
out float4 o6 : SV_Position0)
{
float4 r0,r1,r2,r3;
uint4 bitmask, uiDest;
float4 fDest;
r0.z = dot(cb1[9].xyz, cb0[8].xyz);
r0.x = dot(cb1[10].xyz, cb0[8].xyz);
r0.y = dot(cb1[11].xyz, cb0[8].xyz);
r0.w = dot(r0.xyz, r0.xyz);
r0.w = rsqrt(r0.w);
r0.xyz = r0.xyz * r0.www;
r1.xyz = cb0[9].xyz;
r1.w = 1.000000000e+000;
r2.x = dot(cb1[9].xyzw, r1.xyzw);
r2.y = dot(cb1[10].xyzw, r1.xyzw);
r2.z = dot(cb1[11].xyzw, r1.xyzw);
r0.w = dot(r2.xyz, r2.xyz);
r1.x = rsqrt(r0.w);
r1.xyz = r2.zxy * r1.xxx;
r3.xyz = -r1.xyz * r0.xyz;
r0.xyz = -r1.zxy * r0.yzx + -r3.xyz;
r0.xyz = v0.xxx * r0.xyz;
r1.x = -cb0[9].w * cb0[9].w + r0.w;
r1.y = cb0[9].w * cb0[9].w;
r0.w = r1.y / r0.w;
r0.w = r0.w * r1.x;
r0.w = r1.y / r0.w;
r0.w = r1.y * r0.w;
r0.w = sqrt(r0.w);
r1.x = cb0[8].w * r0.w;
o1.w = r0.w;
r0.xyz = r0.xyz * r1.xxx + r2.xyz;
o3.xyz = r2.xyz;
r1.yzw = cb0[8].xyz * v0.yyy;
r0.xyz = r1.yzw * r1.xxx + r0.xyz;
o0.w = r1.x;
r1.xyzw = cb0[1].xyzw * r0.yyyy;
r1.xyzw = r0.xxxx * cb0[0].xyzw + r1.xyzw;
r1.xyzw = r0.zzzz * cb0[2].xyzw + r1.xyzw;
r1.xyzw = cb0[3].xyzw + r1.xyzw;
o0.xyz = r1.xyw;
o6.xyzw = r1.xyzw;
r1.xyz = cb0[9].xyz + -cb0[4].xyz;
o1.x = dot(cb0[5].xyz, r1.xyz);
o1.y = dot(cb0[6].xyz, r1.xyz);
o1.z = dot(cb0[7].xyz, r1.xyz);
o2.xyz = r0.xyz;
o4.x = dot(cb0[5].xyz, r0.xyz);
o4.y = dot(cb0[6].xyz, r0.xyz);
o4.z = dot(cb0[7].xyz, r0.xyz);
o5.xy = v0.xy * float2(5.000000e-001,5.000000e-001) + float2(5.000000e-001,5.000000e-001);
// Move Star further to depth.
float4 st = StereoParams.Load(0);
float separation = st.x;
float convergence = st.y;
if (params.w < 1.0)
{
o6.x += separation * 850000000;
}
return;
}
[/code]
It's not working for me though. I am not sure why because I can read the logic and it even makes sense to me: If w is less than 1 then do shader; else do nothing. The toggle is 1.
It is like the shaders aren't working at all. Presumably I have missed something?
I tried setting the w constant near the top to 0 but that didn't do anything either. I also tried different keys e.g. ']'
I am using the 1.0.1 version of 3DMigoto but I that shouldn't make a difference because the comments seem built into the d3dx.ini.
;------------------------------------------------------------------------------------------------------
; Logging options.
; Comment line or set value to 0 for no logging.
;------------------------------------------------------------------------------------------------------
[Logging]
; Log all API usage
calls=0
; Log Input key actions
input=0
; Super verbose massive log
debug=0
; Unbuffered logging to avoid missing anything at file end
unbuffered=0
; Force the CPU affinity to use only a single CPU for debugging multi-threaded
force_cpu_affinity=0
; ------------------------------------------------------------------------------------------------------
; Default constants to pass directly to shaders as IniParams
; ------------------------------------------------------------------------------------------------------
[Constants]
; x = 0.8
; y = 1.0
; z = 1.2
; w = 0
;------------------------------------------------------------------------------------------------------
; Custom settings override for any of [convergence, separation, x, y, z, w]
;
; Four types are supported - by default the bindings will simply load the
; configured settings, but type=hold can be specified to have a preset
; active while the button is held, type=toggle can be used to make a simple
; on/off toggle, and type=cycle can be used to cycle between several presets.
;
; Delays (type=hold only) and linear or cosine trasition periods (any key type)
; can be used to better synchonrise setting changes to the game's animations,
; or to smoothly adjust UI elements over a short period of time.
;
; Key bindings: For A-Z and 0-9 on the number row, just use that single
; character. For everything else (including mouse buttons), use the virtual key
; name (with or without the VK_ prefix) or hex code from this article:
; http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
;
; Keys can also be from XBox controllers using:
; XB_LEFT_TRIGGER, XB_RIGHT_TRIGGER,
; XB_LEFT_SHOULDER, XB_RIGHT_SHOULDER,
; XB_LEFT_THUMB, XB_RIGHT_THUMB,
; XB_DPAD_UP, XB_DPAD_DOWN, XB_DPAD_LEFT, XB_DPAD_RIGHT,
; XB_A, XB_B, XB_X, XB_Y, XB_START, XB_BACK
; By default all attached controllers are used - to associate a binding with a
; specific controller add the controller number 1-4 to the prefix, like
; XB2_LEFT_TRIGGER, though this may be more useful for hunting than playing.
;------------------------------------------------------------------------------------------------------
; Example for changing default settings
[Key1]
Key = /
type = toggle
w = 1.0
;separation = 100.0
;convergence = 4.0
;x = 0.98
; Example to support momentary hold type overrides, like aiming.
;[Key2]
;Key = RBUTTON
;convergence = 0.1
;type = hold
; Example for a toggle override.
;[Key3]
;Key = q
;separation = 0.1
;type = toggle
;y = 0.0
; Example for a momentary hold, but with a delay followed by a smooth
; transition (ms) on hold and release to sync better with the game. Note that
; delay only works with type=hold (for now), while transitions will work with
; all types.
;[Key4]
;Key = XB_LEFT_TRIGGER
;type = hold
;y = 0.25
;delay = 100
;transition = 100
;transition_type = linear
;release_delay = 0
;release_transition = 500
;release_transition_type = cosine
; Example of a cycle transition that might be used to provide several presets
; that set both convergence and UI depth to suit different scenes in a game.
; Cosine transitions are used to smooth the changes over 1/10 of a second.
;[Key5]
;Key = Q
;type = cycle
;convergence = 1.45, 1.13, 0.98
;z = 0.25, 0.5, 0.75
;transition = 100
;transition_type = cosine
;------------------------------------------------------------------------------------------------------
; Shader hunting options.
; Default setup is to use keyboard similar to Helix presets
;------------------------------------------------------------------------------------------------------
[Hunting]
; Release mode is with shader hunting disabled, optimized for speed.
hunting=0
; Highlight mode of currently selected shader / rendertarget.
; "skip" = skip shader. don't render anything using the currently selected shader.
; "original" = fall back to original shader if the currently selected shader was patched.
; "mono" = disable stereo for the selected shader / rendertarget.
; "zero" = shader output is all zero. NOTE: this has a big performance impact.
marking_mode=skip
;
; XBox controllers are supported using the same bindings as the [Key] sections
; (see above). If the game already uses the first controller you might try
; using the second controller for hunting with e.g. XB2_LEFT_SHOULDER
; rotate through all VISIBLE pixel shaders at the current scene.
next_pixelshader=VK_NUMPAD2
previous_pixelshader=VK_NUMPAD1
mark_pixelshader=VK_NUMPAD3
; rotate through all VISIBLE vertex shaders at the current scene.
next_vertexshader=VK_NUMPAD5
previous_vertexshader=VK_NUMPAD4
mark_vertexshader=VK_NUMPAD6
; rotate through all USED index buffers at the current scene.
next_indexbuffer=VK_NUMPAD8
previous_indexbuffer=VK_NUMPAD7
mark_indexbuffer=VK_NUMPAD9
; rotate through all USED render targets at the current scene.
next_rendertarget=VK_MULTIPLY
previous_rendertarget=VK_DIVIDE
mark_rendertarget=VK_SUBTRACT
; Re-enable shaders once done with hunting:
done_hunting=VK_ADD
; Screenshot as pns
take_screenshot=VK_SNAPSHOT
; reload all fixes from ShaderFixes folder
reload_fixes=VK_F10
; Uncomment to enable experimental support to reload the d3dx.ini live. Note
; that certain settings may only take effect when the game is first launched or
; otherwise may not reload properly, so if something doesn't seem to work after
; reloading the config you should restart the game (e.g. hunting can be enabled
; live, but copy on mark won't work). This can be the same key as reload_fixes
; for convenience, or a different key may be used to avoid resetting the ini
; parameters every time the shaders are reloaded.
;reload_config=VK_F10
; Hold this key to temporarily disable the fix - useful to quickly check what
; an effect looked like in the original game.
;show_original=VK_F11
; tunable parameter to use in modified shaders as variable (StereoParams.Load(int3(1,0,0)).xyzw)
; enabling tuning results in a small performance hit because the parameter texture
;tune1_up=VK_INSERT
;tune1_down=VK_DELETE
; Auto-repeat key rate in events per second.
repeat_rate=6
;------------------------------------------------------------------------------------------------------
; Chain load other wrapper DLLs instead of system DLLs.
;------------------------------------------------------------------------------------------------------
[System]
;------------------------------------------------------------------------------------------------------
; Settings to force display device to a specific mode.
; Uncomment a value to force the specific setting.
;------------------------------------------------------------------------------------------------------
[Device]
; overrides refresh rate set by game.
;refresh_rate=60
; filters available video modes to those providing given refresh rates.
; some games don't explicitely set the refresh rate, but use the video mode.
; use this if setting refresh_rate doesn't work.
;filter_refresh_rate=24,59,60
; forces creation of full screen devices and swap chains.
; use this for 3dtvplay if game won't active stereo mode.
; a value of 0 doesn't deactivate this option like on the others but
; forces the application into windowed mode.
;full_screen=1
; some games explicitely disable stereo, prohibiting any stereo attempts.
; settings this to 1 ignores all stereo disabling calls and also calls NvAPI_Stereo_Enable to force stereo on.
;force_stereo=1
; almost all DX11 games deactivate window message handling.
; setting this to 1 reenables print screen handling, alt-tab key handling etc.
;allow_windowcommands=1
;------------------------------------------------------------------------------------------------------
; Settings for NVidia stereo driver.
;------------------------------------------------------------------------------------------------------
[Stereo]
; games which have their own stereo renderer disable the NVidia automatic
; stereo mode and render themselves into stereo buffers (Crysis 3 for example).
; Setting this to 1 disables the game stereo renderer and enables NVidia auto stereo mechanism.
automatic_mode=0
; Some games (CryEngine games, for example) lock the separation to a specific
; value, which can be undesirable. Set this to 1 to ignore these requests from
; the game to unlock the separation:
unlock_separation=0
; games without predefined profiles can't save stereo settings.
; enabling this options automatically creates a profile for unknown games.
create_profile=0
; sets the global surface creation heuristic for NVidia stero driver.
; 0 = NVAPI_STEREO_SURFACECREATEMODE_AUTO - use driver registry profile settings for surface creation mode.
; 1 = NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO - Always create stereo surfaces.
; 2 = NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO - Always create mono surfaces.
;surface_createmode=1
; overrides surface creation mode for square surfaces.
;surface_square_createmode=1
; GPU program manipulations.
;
; Shaders in game will be replaced by these custom shaders.
override_directory=ShaderFixes
; Automatically patched shaders will be written here if caching is enabled.
cache_directory=ShaderCache
; Shaders that are directly compiled by the game, instead of binary, go here.
storage_directory=ShaderFromGame
; cache all compiled .txt shaders into .bin. this removes loading stalls.
cache_shaders=1
; preload all patched shaders. there's a bug in NVidia auto stereoization if stereo shaders
; are being loaded during the game on some HW/SW combinations, which turns off auto patching
; for those stereo shaders (results in partial mono rendering). this is a workaround for this case.
preload_shaders=0
; thread save data structure access. required on multithreaded rendering.
use_criticalsection=1
; Setting this option disables scissor limits
rasterizer_disable_scissor=0
;------------------------------------------------------------------------------------------------------
; Analyzation options.
;
; save all autofixed shaders as HLSL
export_fixed=0
; save all shaders sent to DX11 as ASM, or as HLSL text files if compiled by game.
export_shaders=0
; save all shaders seen as HLSL code, autofixed or not. 1= HLSL only, 2=HLSL+OriginalASM, 3=HLSL+OriginalASM+RecompiledASM
export_hlsl=0
; stores a ShaderUsage.txt file on any marking button press.
dump_usage=0
;------------------------------------------------------------------------------------------------------
; Automatic shader fixes. Those settings here apply only on newly read shaders.
; All existing *_replace.txt or *_replace.bin files are not tampered with.
; If you change settings here, the best workflow is to delete all shaders in
; the shader cache directory and let them be fixed again.
; Stereoize all shader parameters with position semantic.
fix_sv_position=0
; Inject depth texture if other depth sources are unavailable.
;fix_ZRepair_DepthTextureHash=8a19f087b004598f
; Correct inverse transformations in pixel shaders using evaluated depth.
;fix_InvTransform=ScreenToLight,InverseTranslatedViewProjectionMatrix
; Back projection coordinate fix.
;
; Available variables in expressions:
; stereoParams.x = Separation value in range [0..1] or [-0..-1] dependent on active eye
; stereoParams.y = Convergence value in w coordinates (1/z)
; stereoParams.z = -1/1 for left/right eye
; stereoParams.w = Separation value without eye separation
; stereoTune.x = tune value 1 (default is 1)
; stereoTune.y = tune value 2 (default is 1)
; stereoTune.z = tune value 3 (default is 1)
; stereoTune.w = tune value 4 (default is 1)
; stereoScreenRes.x = Primary swap chain backbuffer horizontal resolution
; stereoScreenRes.y = Primary swap chain backbuffer vertical resolution
; zpos = current pixel z position in pixel shader
; wpos = current pixel w position in pixel shader
; Send inverse transformations from vertex shaders to pixel shaders.
;fix_BackProjectionTransform1=ScreenToTranslatedWorldMatrix._m00,ScreenToTranslatedWorldMatrix._m02,ScreenToTranslatedWorldMatrix._m01
;fix_BackProjectionTransform2=ScreenToWorld._m00,ScreenToWorld._m02,ScreenToWorld._m01
; Position variables to correct in pixel shaders.
;fix_ObjectPosition1=PointPositionAndInverseRadius
;fix_ObjectPosition1Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5, -0.5
;fix_ObjectPosition2=SpotPositionAndInverseRadius
;fix_ObjectPosition2Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5, -0.5
; Matrix multiplications to correct in pixel shaders.
;fix_MatrixOperand1=TranslatedWorldToShadowMatrix
;fix_MatrixOperand1Multiplier=1, (stereoScreenRes.x/stereoScreenRes.y)*0.5 - viewDirection.z*0.05 + (0.02791946-stereoParams.x/stereoParams.w), 0
; autofix shader option: recompiles all vertex shaders. fixes minor differences in deferred rendering.
;recompile_all_vs=0
;------------------------------------------------------------------------------------------------------
; Shader manipulations without patches + shader filtering.
;------------------------------------------------------------------------------------------------------
;[ShaderOverride1]
;Hash=69732c4f23cb6c48
; Custom stereo separation value while rendering objects using this shader.
;Separation=0
; Custom stereo convergence value while rendering objects using this
; shader (e.g. convergence=0 will move an object to infinity).
;Convergence=0
; don't draw anything using this shader.
;Handling=skip
; advanced option: use this to override only if this shader is used rendering the given index buffer.
;IndexBufferFilter=b3e56ebcb0d20c32
; Use replaced shader only when there is no active depth buffer (for UI filtering)
;depth_filter = depth_inactive
; Use replaced shader only when there *IS* an active depth buffer (for UI filtering)
;depth_filter = depth_active
; Only use replaced shader when it is used in conjunction with a specific shader
; (e.g. to adjust a vertex shader ONLY when it is used with a specific pixel shader)
;partner=af7b880f07630615
;------------------------------------------------------------------------------------------------------
; texture / render target manipulations
;------------------------------------------------------------------------------------------------------
;[TextureOverride1]
;Hash=c3e55ebdb0d20c35
; NVidia stores surface creation mode heuristics in the game profile. setting
; this option overrides the creation mode for a given texture / buffer.
; 0 = NVAPI_STEREO_SURFACECREATEMODE_AUTO - use driver registry profile settings.
; 1 = NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO - create stereo surface.
; 2 = NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO - create mono surface.
;StereoMode=2
;[TextureOverride2]
;...
;------------------------------------------------------------------------------------------------------
; Example of settings override by mouse button configuration
; Mapping of from game provided hard coded convergence values to custom values
; Those are values for L.A. Noir
; Example of settings override by mouse button configuration
;------------------------------------------------------------------------------------------------------
;[ConvergenceMap]
;Map1=from 3e99999a to 0.3
;Map2=from 3f800000 to 1.0
;Map3=from 3f666666 to 0.9
// Move Star further to depth.
float4 st = StereoParams.Load(0);
float separation = st.x;
float convergence = st.y;
if (params.w < 1.0)
{
o6.x += separation * 850000000;
}
return;
}
Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.
-------------------
Vitals: Windows 7 64bit, i5 2500 @ 4.4ghz, SLI GTX670, 8GB, Viewsonic VX2268WM
Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.
-------------------
Vitals: Windows 7 64bit, i5 2500 @ 4.4ghz, SLI GTX670, 8GB, Viewsonic VX2268WM
Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.
-------------------
Vitals: Windows 7 64bit, i5 2500 @ 4.4ghz, SLI GTX670, 8GB, Viewsonic VX2268WM
I am trying to set up a toggle so that if I press say '/' the fix toggles to the default (unfixed) depth, press it again and it switches to the fixed depth.
If I add a couple of fixed shaders (so I can see how to do it for objects using shaders requiring different values) and the d3dx.ini, would someone edit it with comments so I can then copy and paste please?
Shader #1
Shader #2
the d3dx.ini file
Thank you very much in advance! :)
Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.
-------------------
Vitals: Windows 7 64bit, i5 2500 @ 4.4ghz, SLI GTX670, 8GB, Viewsonic VX2268WM
Handy Driver Discussion
Helix Mod - community fixes
Bo3b's Shaderhacker School - How to fix 3D in games
3dsolutionsgaming.com - videos, reviews and 3D fixes
1) in d3dx.ini add something like:
2) In your shader (for ex Vertex):
Hope this helps and shows how you can use a key to send a custom parameter in a shader. Check it in the shader and select the execution mode based on it;)
Cheers!
Helifax
1x Palit RTX 2080Ti Pro Gaming OC(watercooled and overclocked to hell)
3x 3D Vision Ready Asus VG278HE monitors (5760x1080).
Intel i9 9900K (overclocked to 5.3 and watercooled ofc).
Asus Maximus XI Hero Mobo.
16 GB Team Group T-Force Dark Pro DDR4 @ 3600.
Lots of Disks:
- Raid 0 - 256GB Sandisk Extreme SSD.
- Raid 0 - WD Black - 2TB.
- SanDisk SSD PLUS 480 GB.
- Intel 760p 256GB M.2 PCIe NVMe SSD.
Creative Sound Blaster Z.
Windows 10 x64 Pro.
etc
My website with my fixes and OpenGL to 3D Vision wrapper:
http://3dsurroundgaming.com
(If you like some of the stuff that I've done and want to donate something, you can do it with PayPal at tavyhome@gmail.com)
Thanks, helpful commenting too.
It's not working for me though. I am not sure why because I can read the logic and it even makes sense to me: If w is less than 1 then do shader; else do nothing. The toggle is 1.
It is like the shaders aren't working at all. Presumably I have missed something?
I tried setting the w constant near the top to 0 but that didn't do anything either. I also tried different keys e.g. ']'
I am using the 1.0.1 version of 3DMigoto but I that shouldn't make a difference because the comments seem built into the d3dx.ini.
and a shader
Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.
-------------------
Vitals: Windows 7 64bit, i5 2500 @ 4.4ghz, SLI GTX670, 8GB, Viewsonic VX2268WM
Handy Driver Discussion
Helix Mod - community fixes
Bo3b's Shaderhacker School - How to fix 3D in games
3dsolutionsgaming.com - videos, reviews and 3D fixes
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD
Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword
Embarrassing.
I skim read instead of reading carefully. :o
Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.
-------------------
Vitals: Windows 7 64bit, i5 2500 @ 4.4ghz, SLI GTX670, 8GB, Viewsonic VX2268WM
Handy Driver Discussion
Helix Mod - community fixes
Bo3b's Shaderhacker School - How to fix 3D in games
3dsolutionsgaming.com - videos, reviews and 3D fixes
Really easy to implement too.
Then RTFI me!
Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.
-------------------
Vitals: Windows 7 64bit, i5 2500 @ 4.4ghz, SLI GTX670, 8GB, Viewsonic VX2268WM
Handy Driver Discussion
Helix Mod - community fixes
Bo3b's Shaderhacker School - How to fix 3D in games
3dsolutionsgaming.com - videos, reviews and 3D fixes