3Dmigoto now open-source...
  80 / 143    
I already told helifax on Steam, but the best method (I think bo3b was the one who told me, for Lords of the Fallen) is: [code]float4 res = StereoParams.Load(int3(2,0,0));[/code] And then using res.x and res.y. No shader override needed.
I already told helifax on Steam, but the best method (I think bo3b was the one who told me, for Lords of the Fallen) is:

float4 res = StereoParams.Load(int3(2,0,0));


And then using res.x and res.y. No shader override needed.

CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: MSI GeForce RTX 2080Ti Gaming X Trio
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com

Posted 12/07/2016 11:53 PM   
Thank you guys:) Much appreciated;)
Thank you guys:) Much appreciated;)

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)

Posted 12/08/2016 12:02 AM   
[quote="mx-2"]Do you think it would be easily possible to port this feature to some kind of standalone application for use with DX9? This could solve the problems with profile installation once and for all.[/quote]At some point I want to revive the DX9 version of 3DMigoto with the goal of creating a DLL that can be chainloaded with Helix Mod to complement it in areas where it is lacking, and this feature would be one of the easiest to port since the code doesn't have any DX11 dependencies. So, the short answer is yes it is possible, but I can't give you a timeframe (basically, when I'm in the mood, have enough time to devote to it and nothing else distracts me ;-).
mx-2 said:Do you think it would be easily possible to port this feature to some kind of standalone application for use with DX9? This could solve the problems with profile installation once and for all.
At some point I want to revive the DX9 version of 3DMigoto with the goal of creating a DLL that can be chainloaded with Helix Mod to complement it in areas where it is lacking, and this feature would be one of the easiest to port since the code doesn't have any DX11 dependencies. So, the short answer is yes it is possible, but I can't give you a timeframe (basically, when I'm in the mood, have enough time to devote to it and nothing else distracts me ;-).

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

Posted 12/08/2016 01:15 AM   
In most cases you can use either method to get the resolution. The subtle difference is that StereoParams gets the values from the driver, while res_width/height get it from the game. If you find they don't seem to match what the game is set to (CryEngine 3 always uses native resolution no matter what it is set to and upscales as needed and some UE4 games also have the option to render at a different resolution from the display) try changing get_resolution_from to depth_buffer and use the res_width/height in a ShaderOverride section. Another trick is to use .GetDimensions(width, height) on a texture passed to the shader that you know matches the resolution.
In most cases you can use either method to get the resolution. The subtle difference is that StereoParams gets the values from the driver, while res_width/height get it from the game. If you find they don't seem to match what the game is set to (CryEngine 3 always uses native resolution no matter what it is set to and upscales as needed and some UE4 games also have the option to render at a different resolution from the display) try changing get_resolution_from to depth_buffer and use the res_width/height in a ShaderOverride section.

Another trick is to use .GetDimensions(width, height) on a texture passed to the shader that you know matches the resolution.

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

Posted 12/08/2016 01:19 AM   
Hello again, I tried to install 3Dmigoto 1.2.51 libraries into Steam\steamapps\common\SteamVR\bin\win64, as it seems that it is not called by DCS in VR. And the 3dmigoto lib is called by SteamVR: the file d3d11_log.txt is created (but empty) and the directory "ShaderCache" is created. But the steamVR is not working: I had a popup saying that "a key component of steamVR isn't working properly". I tried to chain the 3dmigoto with all the libs I found in the SteamVR/bin directory and the option "hook=recommended" but had no success. Does anyone have an idea if there should be option to try or what library to target ? There are 7 libs other than VS redist, and a lot of chain options, so too much things to try...
Hello again,
I tried to install 3Dmigoto 1.2.51 libraries into Steam\steamapps\common\SteamVR\bin\win64, as it seems that it is not called by DCS in VR.
And the 3dmigoto lib is called by SteamVR: the file d3d11_log.txt is created (but empty) and the directory "ShaderCache" is created. But the steamVR is not working: I had a popup saying that "a key component of steamVR isn't working properly".
I tried to chain the 3dmigoto with all the libs I found in the SteamVR/bin directory and the option "hook=recommended" but had no success.
Does anyone have an idea if there should be option to try or what library to target ? There are 7 libs other than VS redist, and a lot of chain options, so too much things to try...

Posted 12/11/2016 05:15 PM   
This might be of interest to some people - I've just released a new script in my 3d-fixes repository called "generic_shader_extractor.py". It can extract DX11 shaders from many games, and should work with all DX11 UE3.5 and UE4 games. It will *not* work with Unity or CryEngine games, and may work with other game engines (including arbitrary custom engines) provided that they do not compress, encrypt or otherwise obfuscate their shaders in the game files. It extracts the shader binary and uses cmd_Decompiler (which is available from the 3DMigoto releases page and should be extracted to the 3d-fixes directory) to decompile and disassemble the shaders. It supports the same three shader hash types as 3DMigoto (the bytecode hash requires the crcmod package to be installed - the script tells you the commands to install it if it is missing). It won't give you any more detail than dumping shaders with 3DMigoto will, but it can be useful for games that dump their shaders on demand (e.g. RotTR) or level by level (many UE games), or games that include GPU specific shaders that may not dump at all with 3DMigoto on a given system (e.g. Arkham Knight). Please note that depending on the game the script can take a long time, and DX9 shaders are not supported yet. @DJ-RK - this might be of use to you to see if KF2 includes any shaders that 3DMigoto didn't dump on your system.
This might be of interest to some people - I've just released a new script in my 3d-fixes repository called "generic_shader_extractor.py".

It can extract DX11 shaders from many games, and should work with all DX11 UE3.5 and UE4 games. It will *not* work with Unity or CryEngine games, and may work with other game engines (including arbitrary custom engines) provided that they do not compress, encrypt or otherwise obfuscate their shaders in the game files. It extracts the shader binary and uses cmd_Decompiler (which is available from the 3DMigoto releases page and should be extracted to the 3d-fixes directory) to decompile and disassemble the shaders. It supports the same three shader hash types as 3DMigoto (the bytecode hash requires the crcmod package to be installed - the script tells you the commands to install it if it is missing).

It won't give you any more detail than dumping shaders with 3DMigoto will, but it can be useful for games that dump their shaders on demand (e.g. RotTR) or level by level (many UE games), or games that include GPU specific shaders that may not dump at all with 3DMigoto on a given system (e.g. Arkham Knight).

Please note that depending on the game the script can take a long time, and DX9 shaders are not supported yet.

@DJ-RK - this might be of use to you to see if KF2 includes any shaders that 3DMigoto didn't dump on your system.

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

Posted 12/12/2016 09:49 AM   
Hello again, Stupid Me...I finally found the way to make the 3Dmogoto lib being called by SteamVR for DCS. I just had to put the mod into DCS\bin dir [u]and also[/u] into Steam\steamapps\common\SteamVR\bin\win64 dir. It allows me to change the brightness and add a zoom effect based on a pixel shader (with the SuperSampling it really makes sense). Maybe this tip will help someone...
Hello again,
Stupid Me...I finally found the way to make the 3Dmogoto lib being called by SteamVR for DCS. I just had to put the mod into DCS\bin dir and also into Steam\steamapps\common\SteamVR\bin\win64 dir.
It allows me to change the brightness and add a zoom effect based on a pixel shader (with the SuperSampling it really makes sense). Maybe this tip will help someone...

Posted 12/14/2016 09:02 PM   
Any of you wizards wanna help me fix this shader? :) [code]// ---- Created with 3Dmigoto v1.2.43 on Thu Dec 15 21:41:03 2016 Texture2D<float4> t4 : register(t4); Texture2D<float4> t3 : register(t3); Texture2D<float4> t2 : register(t2); Texture2D<uint4> t1 : register(t1); Texture2D<float4> t0 : register(t0); SamplerState s2_s : register(s2); SamplerState s1_s : register(s1); SamplerState s0_s : register(s0); cbuffer cb5 : register(b5) { float4 cb5[3]; } cbuffer cb4 : register(b4) { float4 cb4[11]; } cbuffer cb3 : register(b3) { float4 cb3[5]; } cbuffer cb2 : register(b2) { float4 cb2[2]; } cbuffer cb1 : register(b1) { float4 cb1[1]; } cbuffer cb0 : register(b0) { float4 cb0[52]; } // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( linear centroid float4 v0 : IO0_unClippedPos0, linear centroid float3 v1 : IO1_edgeuv0, nointerpolation float v2 : IO2_UI_UserBig0, nointerpolation float w2 : IO4_UI_UserSmall0, nointerpolation int w2 : IO6_UI_RenderType0, linear centroid float4 v3 : IO3_Gfx_ClipPosition0, linear centroid float2 v4 : IO5_Gfx_UV0, linear centroid float4 v5 : IO7_Gfx_Color0, float4 v6 : SV_Position0, out float4 o0 : SV_Target0) { float4 r0,r1,r2,r3,r4; uint4 bitmask, uiDest; float4 fDest; r0.xyz = v0.xyz / v0.www; r0.w = cmp(0 < asuint(cb3[0].y)); r1.x = dot(cb3[1].xyz, r0.xyz); r1.x = cb3[1].w + r1.x; r1.x = cmp(r1.x < 0); r1.x = r0.w ? r1.x : 0; if (r1.x != 0) discard; r1.x = dot(cb3[2].xyz, r0.xyz); r1.x = cb3[2].w + r1.x; r1.x = cmp(r1.x < 0); r1.x = r0.w ? r1.x : 0; if (r1.x != 0) discard; r1.x = dot(cb3[3].xyz, r0.xyz); r1.x = cb3[3].w + r1.x; r1.x = cmp(r1.x < 0); r1.x = r0.w ? r1.x : 0; if (r1.x != 0) discard; r0.x = dot(cb3[4].xyz, r0.xyz); r0.x = cb3[4].w + r0.x; r0.x = cmp(r0.x < 0); r0.x = r0.x ? r0.w : 0; if (r0.x != 0) discard; r0.xy = cb1[0].zw * v6.xy; r0.xy = (int2)r0.xy; r0.zw = float2(0,0); r0.x = t1.Load(r0.xyz).x; r0.y = (int)r0.x & asint(cb3[0].x); if (r0.y != 0) discard; r0.yz = v1.xy / v1.zz; r1.xy = r0.yz + r0.yz; r0.yz = r0.yz * float2(2,2) + float2(-1,-1); r0.yz = float2(1,1) + -abs(r0.yz); r1.zw = ddx_coarse(r1.xy); r1.xy = ddy_coarse(r1.xy); r1.xy = abs(r1.zw) + abs(r1.xy); r1.xy = float2(9.99999975e-006,9.99999975e-006) + r1.xy; r0.yz = saturate(r0.yz / r1.xy); r0.y = r0.y * r0.z; r1.w = v5.w * r0.y; t2.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z); r0.yz = uiDest.xy; r0.yz = (uint2)r0.yz; r2.xy = float2(0.0439999998,0.0370000005) * cb4[10].zz; r3.xyzw = cb4[10].zzzz * float4(0.100000001,0.100000001,0.100000001,0.100000001) + float4(0.400000006,0.0599999987,2.74000001,1.97000003); r3.xyzw = float4(0.439999998,1,5.73999977,2) * r3.xyzw; r3.xyzw = sin(r3.xyzw); r3.xyzw = r3.xyxy + r3.zwzw; r3.xyzw = float4(27.2199993,21.0400009,27.2199993,21.0400009) * r3.xyzw; r3.xyzw = floor(r3.xyzw); r3.xyzw = float4(6.5,0.0599999987,3.75999999,1.97000003) + r3.xyzw; r3.xyzw = float4(6.9000001,12.0600004,1.79999995,6.01999998) * r3.xyzw; r3.xyzw = sin(r3.xyzw); r2.zw = r3.xy + r3.zw; r2.xy = floor(r2.xy); r2.xy = r2.xy + r2.zw; r2.xy = v4.xy + r2.xy; r0.w = t4.Sample(s2_s, r2.xy).x; r2.x = saturate(w2.x * 2 + cb5[0].y); r0.w = saturate(r0.w); r2.y = cmp(r2.x >= 1); r2.z = cmp(0 >= r2.x); r2.y = (int)r2.z | (int)r2.y; r0.w = r2.x * 2 + r0.w; r0.w = saturate(-1 + r0.w); r0.w = r2.y ? r2.x : r0.w; r2.xy = float2(1,1) + -r0.yz; r2.xy = r0.ww * r2.xy + r0.yz; r2.xy = floor(r2.xy); r2.zw = v4.xy * r2.xy; r2.zw = round(r2.zw); r2.xy = r2.zw / r2.xy; r0.w = cmp(0.00100000005 >= r0.w); r0.w = r0.w ? 1.000000 : 0; r2.zw = v4.xy + -r2.xy; r2.xy = r0.ww * r2.zw + r2.xy; r0.w = cmp((int)w2.x == 1); if (r0.w != 0) { r2.w = t2.SampleLevel(s1_s, r2.xy, 0).x; r2.z = 1; r3.xyzw = r2.zzzw; } if (r0.w == 0) { r0.w = cmp((int)w2.x == 2); if (r0.w != 0) { r2.z = asint(cb2[1].z); r2.zw = r0.yz / r2.zz; r2.zw = r2.zw * r2.xy; r4.xy = ddx_coarse(r2.zw); r2.zw = ddy_coarse(r2.zw); r2.zw = abs(r4.xy) + abs(r2.zw); r2.z = max(r2.z, r2.w); r2.w = cmp(1.39999998 < r2.z); if (r2.w != 0) { r4.x = t2.SampleLevel(s1_s, r2.xy, 0).x; } if (r2.w == 0) { r2.w = t2.SampleLevel(s1_s, r2.xy, 0).x; r2.w = -0.5 + r2.w; r4.z = 0.5 * r2.z; r2.z = r2.z * 0.25 + r2.w; r4.x = saturate(r2.z / r4.z); } r4.y = 1; r3.xyzw = r4.yyyx; } if (r0.w == 0) { r0.w = cmp((int)w2.x == 3); if (r0.w != 0) { r0.yz = r2.xy * r0.yz; r2.zw = ddx_coarse(r0.yz); r0.yz = ddy_coarse(r0.yz); r0.yz = abs(r2.zw) + abs(r0.yz); r0.y = max(r0.y, r0.z); r0.z = cmp(1.39999998 < r0.y); if (r0.z != 0) { r2.z = t2.SampleLevel(s1_s, r2.xy, 0).x; } if (r0.z == 0) { r0.z = t2.SampleLevel(s1_s, r2.xy, 0).x; r0.z = -0.5 + r0.z; r4.x = 0.5 * r0.y; r0.y = r0.y * 0.25 + r0.z; r2.z = saturate(r0.y / r4.x); } r2.w = 1; r3.xyzw = r2.wwwz; } if (r0.w == 0) { r0.y = t2.CalculateLevelOfDetail(s1_s, r2.xy); r3.xyzw = t2.SampleLevel(s1_s, r2.xy, r0.y).xyzw; } } } r1.xyz = v5.xyz; r1.xyzw = r3.xyzw * r1.xyzw; r0.yz = cb1[0].xy * v6.xy; r0.yz = r0.yz * cb0[50].zw + cb0[51].xy; r0.y = t0.SampleLevel(s0_s, r0.yz, 0).x; r0.y = v3.w + -r0.y; r0.z = -cb5[0].z + r0.y; r0.w = cb5[0].w + -cb5[0].z; r0.z = saturate(r0.z / r0.w); r2.xy = cb5[1].yw + -cb5[1].xz; r0.z = r0.z * r2.x + cb5[1].x; r0.y = -cb5[1].z + r0.y; r0.y = saturate(r0.y / r2.y); r0.w = cb5[2].y + -cb5[2].x; r0.y = r0.y * r0.w + cb5[2].x; r0.x = (uint)r0.x; r0.x = cmp(r0.x == 1.000000); r0.x = r0.x ? 1.000000 : 0; r0.y = r0.y + -r0.z; r0.x = r0.x * r0.y + r0.z; r0.yz = v6.xy * cb0[50].zw + cb0[51].xy; r0.y = t3.Sample(s1_s, r0.yz).x; r0.z = saturate(v2.x); r0.y = r0.x * r0.y + -r0.x; r0.x = r0.z * r0.y + r0.x; r1.w = r1.w * r0.x; r0.x = 1; r0.w = cb5[0].x; r0.xyzw = r1.xyzw * r0.xxxw; r2.x = 1; r2.w = 1 + -cb5[0].x; r1.xyzw = r2.xxxw * r1.xyzw; r1.xyz = r1.xyz * r1.www; o0.xyz = r0.xyz * r0.www + r1.xyz; o0.w = r1.w; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) D3D Shader Disassembler // // using 3Dmigoto v1.2.43 on Thu Dec 15 21:41:03 2016 // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // IO0_unClippedPos 0 xyzw 0 NONE float xyzw // IO1_edgeuv 0 xyz 1 NONE float xyz // IO2_UI_UserBig 0 x 2 NONE float x // IO4_UI_UserSmall 0 y 2 NONE float y // IO6_UI_RenderType 0 z 2 NONE int z // IO3_Gfx_ClipPosition 0 xyzw 3 NONE float w // IO5_Gfx_UV 0 xy 4 NONE float xy // IO7_Gfx_Color 0 xyzw 5 NONE float xyzw // SV_Position 0 xyzw 6 POS float xy // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Target 0 xyzw 0 TARGET float xyzw // ps_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[52], immediateIndexed dcl_constantbuffer cb1[1], immediateIndexed dcl_constantbuffer cb2[2], immediateIndexed dcl_constantbuffer cb3[5], immediateIndexed dcl_constantbuffer cb4[11], immediateIndexed dcl_constantbuffer cb5[3], immediateIndexed dcl_sampler s0, mode_default dcl_sampler s1, mode_default dcl_sampler s2, mode_default dcl_resource_texture2d (float,float,float,float) t0 dcl_resource_texture2d (uint,uint,uint,uint) t1 dcl_resource_texture2d (float,float,float,float) t2 dcl_resource_texture2d (float,float,float,float) t3 dcl_resource_texture2d (float,float,float,float) t4 dcl_input_ps linear centroid v0.xyzw dcl_input_ps linear centroid v1.xyz dcl_input_ps constant v2.x dcl_input_ps constant v2.y dcl_input_ps constant v2.z dcl_input_ps linear centroid v3.w dcl_input_ps linear centroid v4.xy dcl_input_ps linear centroid v5.xyzw dcl_input_ps_siv linear noperspective v6.xy, position dcl_output o0.xyzw dcl_temps 5 div r0.xyz, v0.xyzx, v0.wwww ult r0.w, l(0), cb3[0].y dp3 r1.x, cb3[1].xyzx, r0.xyzx add r1.x, r1.x, cb3[1].w lt r1.x, r1.x, l(0.000000) and r1.x, r0.w, r1.x discard_nz r1.x dp3 r1.x, cb3[2].xyzx, r0.xyzx add r1.x, r1.x, cb3[2].w lt r1.x, r1.x, l(0.000000) and r1.x, r0.w, r1.x discard_nz r1.x dp3 r1.x, cb3[3].xyzx, r0.xyzx add r1.x, r1.x, cb3[3].w lt r1.x, r1.x, l(0.000000) and r1.x, r0.w, r1.x discard_nz r1.x dp3 r0.x, cb3[4].xyzx, r0.xyzx add r0.x, r0.x, cb3[4].w lt r0.x, r0.x, l(0.000000) and r0.x, r0.x, r0.w discard_nz r0.x mul r0.xy, v6.xyxx, cb1[0].zwzz ftoi r0.xy, r0.xyxx mov r0.zw, l(0,0,0,0) ld_indexable(texture2d)(uint,uint,uint,uint) r0.x, r0.xyzw, t1.xyzw and r0.y, r0.x, cb3[0].x discard_nz r0.y div r0.yz, v1.xxyx, v1.zzzz add r1.xy, r0.yzyy, r0.yzyy mad r0.yz, r0.yyzy, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000) add r0.yz, -|r0.yyzy|, l(0.000000, 1.000000, 1.000000, 0.000000) deriv_rtx_coarse r1.zw, r1.xxxy deriv_rty_coarse r1.xy, r1.xyxx add r1.xy, |r1.xyxx|, |r1.zwzz| add r1.xy, r1.xyxx, l(0.000010, 0.000010, 0.000000, 0.000000) div_sat r0.yz, r0.yyzy, r1.xxyx mul r0.y, r0.z, r0.y mul r1.w, r0.y, v5.w resinfo_indexable(texture2d)(float,float,float,float)_uint r0.yz, l(0), t2.zxyw utof r0.yz, r0.yyzy mul r2.xy, cb4[10].zzzz, l(0.044000, 0.037000, 0.000000, 0.000000) mad r3.xyzw, cb4[10].zzzz, l(0.100000, 0.100000, 0.100000, 0.100000), l(0.400000, 0.060000, 2.740000, 1.970000) mul r3.xyzw, r3.xyzw, l(0.440000, 1.000000, 5.740000, 2.000000) sincos r3.xyzw, null, r3.xyzw add r3.xyzw, r3.zwzw, r3.xyxy mul r3.xyzw, r3.xyzw, l(27.219999, 21.040001, 27.219999, 21.040001) round_ni r3.xyzw, r3.xyzw add r3.xyzw, r3.xyzw, l(6.500000, 0.060000, 3.760000, 1.970000) mul r3.xyzw, r3.xyzw, l(6.900000, 12.060000, 1.800000, 6.020000) sincos r3.xyzw, null, r3.xyzw add r2.zw, r3.zzzw, r3.xxxy round_ni r2.xy, r2.xyxx add r2.xy, r2.zwzz, r2.xyxx add r2.xy, r2.xyxx, v4.xyxx sample_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t4.yzwx, s2 mad_sat r2.x, v2.y, l(2.000000), cb5[0].y mov_sat r0.w, r0.w ge r2.y, r2.x, l(1.000000) ge r2.z, l(0.000000), r2.x or r2.y, r2.z, r2.y mad r0.w, r2.x, l(2.000000), r0.w add_sat r0.w, r0.w, l(-1.000000) movc r0.w, r2.y, r2.x, r0.w add r2.xy, -r0.yzyy, l(1.000000, 1.000000, 0.000000, 0.000000) mad r2.xy, r0.wwww, r2.xyxx, r0.yzyy round_ni r2.xy, r2.xyxx mul r2.zw, r2.xxxy, v4.xxxy round_ne r2.zw, r2.zzzw div r2.xy, r2.zwzz, r2.xyxx ge r0.w, l(0.001000), r0.w and r0.w, r0.w, l(0x3f800000) add r2.zw, -r2.xxxy, v4.xxxy mad r2.xy, r0.wwww, r2.zwzz, r2.xyxx ieq r0.w, v2.z, l(1) if_nz r0.w sample_l_indexable(texture2d)(float,float,float,float) r2.w, r2.xyxx, t2.zwyx, s1, l(0.000000) mov r2.z, l(1.000000) mov r3.xyzw, r2.zzzw endif if_z r0.w ieq r0.w, v2.z, l(2) if_nz r0.w itof r2.z, cb2[1].z div r2.zw, r0.yyyz, r2.zzzz mul r2.zw, r2.xxxy, r2.zzzw deriv_rtx_coarse r4.xy, r2.zwzz deriv_rty_coarse r2.zw, r2.zzzw add r2.zw, |r2.zzzw|, |r4.xxxy| max r2.z, r2.w, r2.z lt r2.w, l(1.400000), r2.z if_nz r2.w sample_l_indexable(texture2d)(float,float,float,float) r4.x, r2.xyxx, t2.xyzw, s1, l(0.000000) endif if_z r2.w sample_l_indexable(texture2d)(float,float,float,float) r2.w, r2.xyxx, t2.yzwx, s1, l(0.000000) add r2.w, r2.w, l(-0.500000) mul r4.z, r2.z, l(0.500000) mad r2.z, r2.z, l(0.250000), r2.w div_sat r4.x, r2.z, r4.z endif mov r4.y, l(1.000000) mov r3.xyzw, r4.yyyx endif if_z r0.w ieq r0.w, v2.z, l(3) if_nz r0.w mul r0.yz, r0.yyzy, r2.xxyx deriv_rtx_coarse r2.zw, r0.yyyz deriv_rty_coarse r0.yz, r0.yyzy add r0.yz, |r0.yyzy|, |r2.zzwz| max r0.y, r0.z, r0.y lt r0.z, l(1.400000), r0.y if_nz r0.z sample_l_indexable(texture2d)(float,float,float,float) r2.z, r2.xyxx, t2.zwxy, s1, l(0.000000) endif if_z r0.z sample_l_indexable(texture2d)(float,float,float,float) r0.z, r2.xyxx, t2.yzxw, s1, l(0.000000) add r0.z, r0.z, l(-0.500000) mul r4.x, r0.y, l(0.500000) mad r0.y, r0.y, l(0.250000), r0.z div_sat r2.z, r0.y, r4.x endif mov r2.w, l(1.000000) mov r3.xyzw, r2.wwwz endif if_z r0.w lod r0.y, r2.xyxx, t2.x, s1 sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t2.xyzw, s1, r0.y endif endif endif mov r1.xyz, v5.xyzx mul r1.xyzw, r1.xyzw, r3.xyzw mul r0.yz, v6.xxyx, cb1[0].xxyx mad r0.yz, r0.yyzy, cb0[50].zzwz, cb0[51].xxyx sample_l_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t0.yxzw, s0, l(0.000000) add r0.y, -r0.y, v3.w add r0.z, r0.y, -cb5[0].z add r0.w, -cb5[0].z, cb5[0].w div_sat r0.z, r0.z, r0.w add r2.xy, -cb5[1].xzxx, cb5[1].ywyy mad r0.z, r0.z, r2.x, cb5[1].x add r0.y, r0.y, -cb5[1].z div_sat r0.y, r0.y, r2.y add r0.w, -cb5[2].x, cb5[2].y mad r0.y, r0.y, r0.w, cb5[2].x utof r0.x, r0.x eq r0.x, r0.x, l(1.000000) and r0.x, r0.x, l(0x3f800000) add r0.y, -r0.z, r0.y mad r0.x, r0.x, r0.y, r0.z mad r0.yz, v6.xxyx, cb0[50].zzwz, cb0[51].xxyx sample_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t3.yxzw, s1 mov_sat r0.z, v2.x mad r0.y, r0.x, r0.y, -r0.x mad r0.x, r0.z, r0.y, r0.x mul r1.w, r0.x, r1.w mov r0.x, l(1.000000) mov r0.w, cb5[0].x mul r0.xyzw, r0.xxxw, r1.xyzw mov r2.x, l(1.000000) add r2.w, -cb5[0].x, l(1.000000) mul r1.xyzw, r1.xyzw, r2.xxxw mul r1.xyz, r1.wwww, r1.xyzx mad o0.xyz, r0.xyzx, r0.wwww, r1.xyzx mov o0.w, r1.w ret // Approximately 0 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code]
Any of you wizards wanna help me fix this shader? :)

// ---- Created with 3Dmigoto v1.2.43 on Thu Dec 15 21:41:03 2016
Texture2D<float4> t4 : register(t4);

Texture2D<float4> t3 : register(t3);

Texture2D<float4> t2 : register(t2);

Texture2D<uint4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb5 : register(b5)
{
float4 cb5[3];
}

cbuffer cb4 : register(b4)
{
float4 cb4[11];
}

cbuffer cb3 : register(b3)
{
float4 cb3[5];
}

cbuffer cb2 : register(b2)
{
float4 cb2[2];
}

cbuffer cb1 : register(b1)
{
float4 cb1[1];
}

cbuffer cb0 : register(b0)
{
float4 cb0[52];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
linear centroid float4 v0 : IO0_unClippedPos0,
linear centroid float3 v1 : IO1_edgeuv0,
nointerpolation float v2 : IO2_UI_UserBig0,
nointerpolation float w2 : IO4_UI_UserSmall0,
nointerpolation int w2 : IO6_UI_RenderType0,
linear centroid float4 v3 : IO3_Gfx_ClipPosition0,
linear centroid float2 v4 : IO5_Gfx_UV0,
linear centroid float4 v5 : IO7_Gfx_Color0,
float4 v6 : SV_Position0,
out float4 o0 : SV_Target0)
{
float4 r0,r1,r2,r3,r4;
uint4 bitmask, uiDest;
float4 fDest;

r0.xyz = v0.xyz / v0.www;
r0.w = cmp(0 < asuint(cb3[0].y));
r1.x = dot(cb3[1].xyz, r0.xyz);
r1.x = cb3[1].w + r1.x;
r1.x = cmp(r1.x < 0);
r1.x = r0.w ? r1.x : 0;
if (r1.x != 0) discard;
r1.x = dot(cb3[2].xyz, r0.xyz);
r1.x = cb3[2].w + r1.x;
r1.x = cmp(r1.x < 0);
r1.x = r0.w ? r1.x : 0;
if (r1.x != 0) discard;
r1.x = dot(cb3[3].xyz, r0.xyz);
r1.x = cb3[3].w + r1.x;
r1.x = cmp(r1.x < 0);
r1.x = r0.w ? r1.x : 0;
if (r1.x != 0) discard;
r0.x = dot(cb3[4].xyz, r0.xyz);
r0.x = cb3[4].w + r0.x;
r0.x = cmp(r0.x < 0);
r0.x = r0.x ? r0.w : 0;
if (r0.x != 0) discard;
r0.xy = cb1[0].zw * v6.xy;
r0.xy = (int2)r0.xy;
r0.zw = float2(0,0);
r0.x = t1.Load(r0.xyz).x;
r0.y = (int)r0.x & asint(cb3[0].x);
if (r0.y != 0) discard;
r0.yz = v1.xy / v1.zz;
r1.xy = r0.yz + r0.yz;
r0.yz = r0.yz * float2(2,2) + float2(-1,-1);
r0.yz = float2(1,1) + -abs(r0.yz);
r1.zw = ddx_coarse(r1.xy);
r1.xy = ddy_coarse(r1.xy);
r1.xy = abs(r1.zw) + abs(r1.xy);
r1.xy = float2(9.99999975e-006,9.99999975e-006) + r1.xy;
r0.yz = saturate(r0.yz / r1.xy);
r0.y = r0.y * r0.z;
r1.w = v5.w * r0.y;
t2.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
r0.yz = uiDest.xy;
r0.yz = (uint2)r0.yz;
r2.xy = float2(0.0439999998,0.0370000005) * cb4[10].zz;
r3.xyzw = cb4[10].zzzz * float4(0.100000001,0.100000001,0.100000001,0.100000001) + float4(0.400000006,0.0599999987,2.74000001,1.97000003);
r3.xyzw = float4(0.439999998,1,5.73999977,2) * r3.xyzw;
r3.xyzw = sin(r3.xyzw);
r3.xyzw = r3.xyxy + r3.zwzw;
r3.xyzw = float4(27.2199993,21.0400009,27.2199993,21.0400009) * r3.xyzw;
r3.xyzw = floor(r3.xyzw);
r3.xyzw = float4(6.5,0.0599999987,3.75999999,1.97000003) + r3.xyzw;
r3.xyzw = float4(6.9000001,12.0600004,1.79999995,6.01999998) * r3.xyzw;
r3.xyzw = sin(r3.xyzw);
r2.zw = r3.xy + r3.zw;
r2.xy = floor(r2.xy);
r2.xy = r2.xy + r2.zw;
r2.xy = v4.xy + r2.xy;
r0.w = t4.Sample(s2_s, r2.xy).x;
r2.x = saturate(w2.x * 2 + cb5[0].y);
r0.w = saturate(r0.w);
r2.y = cmp(r2.x >= 1);
r2.z = cmp(0 >= r2.x);
r2.y = (int)r2.z | (int)r2.y;
r0.w = r2.x * 2 + r0.w;
r0.w = saturate(-1 + r0.w);
r0.w = r2.y ? r2.x : r0.w;
r2.xy = float2(1,1) + -r0.yz;
r2.xy = r0.ww * r2.xy + r0.yz;
r2.xy = floor(r2.xy);
r2.zw = v4.xy * r2.xy;
r2.zw = round(r2.zw);
r2.xy = r2.zw / r2.xy;
r0.w = cmp(0.00100000005 >= r0.w);
r0.w = r0.w ? 1.000000 : 0;
r2.zw = v4.xy + -r2.xy;
r2.xy = r0.ww * r2.zw + r2.xy;
r0.w = cmp((int)w2.x == 1);
if (r0.w != 0) {
r2.w = t2.SampleLevel(s1_s, r2.xy, 0).x;
r2.z = 1;
r3.xyzw = r2.zzzw;
}
if (r0.w == 0) {
r0.w = cmp((int)w2.x == 2);
if (r0.w != 0) {
r2.z = asint(cb2[1].z);
r2.zw = r0.yz / r2.zz;
r2.zw = r2.zw * r2.xy;
r4.xy = ddx_coarse(r2.zw);
r2.zw = ddy_coarse(r2.zw);
r2.zw = abs(r4.xy) + abs(r2.zw);
r2.z = max(r2.z, r2.w);
r2.w = cmp(1.39999998 < r2.z);
if (r2.w != 0) {
r4.x = t2.SampleLevel(s1_s, r2.xy, 0).x;
}
if (r2.w == 0) {
r2.w = t2.SampleLevel(s1_s, r2.xy, 0).x;
r2.w = -0.5 + r2.w;
r4.z = 0.5 * r2.z;
r2.z = r2.z * 0.25 + r2.w;
r4.x = saturate(r2.z / r4.z);
}
r4.y = 1;
r3.xyzw = r4.yyyx;
}
if (r0.w == 0) {
r0.w = cmp((int)w2.x == 3);
if (r0.w != 0) {
r0.yz = r2.xy * r0.yz;
r2.zw = ddx_coarse(r0.yz);
r0.yz = ddy_coarse(r0.yz);
r0.yz = abs(r2.zw) + abs(r0.yz);
r0.y = max(r0.y, r0.z);
r0.z = cmp(1.39999998 < r0.y);
if (r0.z != 0) {
r2.z = t2.SampleLevel(s1_s, r2.xy, 0).x;
}
if (r0.z == 0) {
r0.z = t2.SampleLevel(s1_s, r2.xy, 0).x;
r0.z = -0.5 + r0.z;
r4.x = 0.5 * r0.y;
r0.y = r0.y * 0.25 + r0.z;
r2.z = saturate(r0.y / r4.x);
}
r2.w = 1;
r3.xyzw = r2.wwwz;
}
if (r0.w == 0) {
r0.y = t2.CalculateLevelOfDetail(s1_s, r2.xy);
r3.xyzw = t2.SampleLevel(s1_s, r2.xy, r0.y).xyzw;
}
}
}
r1.xyz = v5.xyz;
r1.xyzw = r3.xyzw * r1.xyzw;
r0.yz = cb1[0].xy * v6.xy;
r0.yz = r0.yz * cb0[50].zw + cb0[51].xy;
r0.y = t0.SampleLevel(s0_s, r0.yz, 0).x;
r0.y = v3.w + -r0.y;
r0.z = -cb5[0].z + r0.y;
r0.w = cb5[0].w + -cb5[0].z;
r0.z = saturate(r0.z / r0.w);
r2.xy = cb5[1].yw + -cb5[1].xz;
r0.z = r0.z * r2.x + cb5[1].x;
r0.y = -cb5[1].z + r0.y;
r0.y = saturate(r0.y / r2.y);
r0.w = cb5[2].y + -cb5[2].x;
r0.y = r0.y * r0.w + cb5[2].x;
r0.x = (uint)r0.x;
r0.x = cmp(r0.x == 1.000000);
r0.x = r0.x ? 1.000000 : 0;
r0.y = r0.y + -r0.z;
r0.x = r0.x * r0.y + r0.z;
r0.yz = v6.xy * cb0[50].zw + cb0[51].xy;
r0.y = t3.Sample(s1_s, r0.yz).x;
r0.z = saturate(v2.x);
r0.y = r0.x * r0.y + -r0.x;
r0.x = r0.z * r0.y + r0.x;
r1.w = r1.w * r0.x;
r0.x = 1;
r0.w = cb5[0].x;
r0.xyzw = r1.xyzw * r0.xxxw;
r2.x = 1;
r2.w = 1 + -cb5[0].x;
r1.xyzw = r2.xxxw * r1.xyzw;
r1.xyz = r1.xyz * r1.www;
o0.xyz = r0.xyz * r0.www + r1.xyz;
o0.w = r1.w;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
// using 3Dmigoto v1.2.43 on Thu Dec 15 21:41:03 2016
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// IO0_unClippedPos 0 xyzw 0 NONE float xyzw
// IO1_edgeuv 0 xyz 1 NONE float xyz
// IO2_UI_UserBig 0 x 2 NONE float x
// IO4_UI_UserSmall 0 y 2 NONE float y
// IO6_UI_RenderType 0 z 2 NONE int z
// IO3_Gfx_ClipPosition 0 xyzw 3 NONE float w
// IO5_Gfx_UV 0 xy 4 NONE float xy
// IO7_Gfx_Color 0 xyzw 5 NONE float xyzw
// SV_Position 0 xyzw 6 POS float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[52], immediateIndexed
dcl_constantbuffer cb1[1], immediateIndexed
dcl_constantbuffer cb2[2], immediateIndexed
dcl_constantbuffer cb3[5], immediateIndexed
dcl_constantbuffer cb4[11], immediateIndexed
dcl_constantbuffer cb5[3], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (uint,uint,uint,uint) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_input_ps linear centroid v0.xyzw
dcl_input_ps linear centroid v1.xyz
dcl_input_ps constant v2.x
dcl_input_ps constant v2.y
dcl_input_ps constant v2.z
dcl_input_ps linear centroid v3.w
dcl_input_ps linear centroid v4.xy
dcl_input_ps linear centroid v5.xyzw
dcl_input_ps_siv linear noperspective v6.xy, position
dcl_output o0.xyzw
dcl_temps 5
div r0.xyz, v0.xyzx, v0.wwww
ult r0.w, l(0), cb3[0].y
dp3 r1.x, cb3[1].xyzx, r0.xyzx
add r1.x, r1.x, cb3[1].w
lt r1.x, r1.x, l(0.000000)
and r1.x, r0.w, r1.x
discard_nz r1.x
dp3 r1.x, cb3[2].xyzx, r0.xyzx
add r1.x, r1.x, cb3[2].w
lt r1.x, r1.x, l(0.000000)
and r1.x, r0.w, r1.x
discard_nz r1.x
dp3 r1.x, cb3[3].xyzx, r0.xyzx
add r1.x, r1.x, cb3[3].w
lt r1.x, r1.x, l(0.000000)
and r1.x, r0.w, r1.x
discard_nz r1.x
dp3 r0.x, cb3[4].xyzx, r0.xyzx
add r0.x, r0.x, cb3[4].w
lt r0.x, r0.x, l(0.000000)
and r0.x, r0.x, r0.w
discard_nz r0.x
mul r0.xy, v6.xyxx, cb1[0].zwzz
ftoi r0.xy, r0.xyxx
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(uint,uint,uint,uint) r0.x, r0.xyzw, t1.xyzw
and r0.y, r0.x, cb3[0].x
discard_nz r0.y
div r0.yz, v1.xxyx, v1.zzzz
add r1.xy, r0.yzyy, r0.yzyy
mad r0.yz, r0.yyzy, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
add r0.yz, -|r0.yyzy|, l(0.000000, 1.000000, 1.000000, 0.000000)
deriv_rtx_coarse r1.zw, r1.xxxy
deriv_rty_coarse r1.xy, r1.xyxx
add r1.xy, |r1.xyxx|, |r1.zwzz|
add r1.xy, r1.xyxx, l(0.000010, 0.000010, 0.000000, 0.000000)
div_sat r0.yz, r0.yyzy, r1.xxyx
mul r0.y, r0.z, r0.y
mul r1.w, r0.y, v5.w
resinfo_indexable(texture2d)(float,float,float,float)_uint r0.yz, l(0), t2.zxyw
utof r0.yz, r0.yyzy
mul r2.xy, cb4[10].zzzz, l(0.044000, 0.037000, 0.000000, 0.000000)
mad r3.xyzw, cb4[10].zzzz, l(0.100000, 0.100000, 0.100000, 0.100000), l(0.400000, 0.060000, 2.740000, 1.970000)
mul r3.xyzw, r3.xyzw, l(0.440000, 1.000000, 5.740000, 2.000000)
sincos r3.xyzw, null, r3.xyzw
add r3.xyzw, r3.zwzw, r3.xyxy
mul r3.xyzw, r3.xyzw, l(27.219999, 21.040001, 27.219999, 21.040001)
round_ni r3.xyzw, r3.xyzw
add r3.xyzw, r3.xyzw, l(6.500000, 0.060000, 3.760000, 1.970000)
mul r3.xyzw, r3.xyzw, l(6.900000, 12.060000, 1.800000, 6.020000)
sincos r3.xyzw, null, r3.xyzw
add r2.zw, r3.zzzw, r3.xxxy
round_ni r2.xy, r2.xyxx
add r2.xy, r2.zwzz, r2.xyxx
add r2.xy, r2.xyxx, v4.xyxx
sample_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t4.yzwx, s2
mad_sat r2.x, v2.y, l(2.000000), cb5[0].y
mov_sat r0.w, r0.w
ge r2.y, r2.x, l(1.000000)
ge r2.z, l(0.000000), r2.x
or r2.y, r2.z, r2.y
mad r0.w, r2.x, l(2.000000), r0.w
add_sat r0.w, r0.w, l(-1.000000)
movc r0.w, r2.y, r2.x, r0.w
add r2.xy, -r0.yzyy, l(1.000000, 1.000000, 0.000000, 0.000000)
mad r2.xy, r0.wwww, r2.xyxx, r0.yzyy
round_ni r2.xy, r2.xyxx
mul r2.zw, r2.xxxy, v4.xxxy
round_ne r2.zw, r2.zzzw
div r2.xy, r2.zwzz, r2.xyxx
ge r0.w, l(0.001000), r0.w
and r0.w, r0.w, l(0x3f800000)
add r2.zw, -r2.xxxy, v4.xxxy
mad r2.xy, r0.wwww, r2.zwzz, r2.xyxx
ieq r0.w, v2.z, l(1)
if_nz r0.w
sample_l_indexable(texture2d)(float,float,float,float) r2.w, r2.xyxx, t2.zwyx, s1, l(0.000000)
mov r2.z, l(1.000000)
mov r3.xyzw, r2.zzzw
endif
if_z r0.w
ieq r0.w, v2.z, l(2)
if_nz r0.w
itof r2.z, cb2[1].z
div r2.zw, r0.yyyz, r2.zzzz
mul r2.zw, r2.xxxy, r2.zzzw
deriv_rtx_coarse r4.xy, r2.zwzz
deriv_rty_coarse r2.zw, r2.zzzw
add r2.zw, |r2.zzzw|, |r4.xxxy|
max r2.z, r2.w, r2.z
lt r2.w, l(1.400000), r2.z
if_nz r2.w
sample_l_indexable(texture2d)(float,float,float,float) r4.x, r2.xyxx, t2.xyzw, s1, l(0.000000)
endif
if_z r2.w
sample_l_indexable(texture2d)(float,float,float,float) r2.w, r2.xyxx, t2.yzwx, s1, l(0.000000)
add r2.w, r2.w, l(-0.500000)
mul r4.z, r2.z, l(0.500000)
mad r2.z, r2.z, l(0.250000), r2.w
div_sat r4.x, r2.z, r4.z
endif
mov r4.y, l(1.000000)
mov r3.xyzw, r4.yyyx
endif
if_z r0.w
ieq r0.w, v2.z, l(3)
if_nz r0.w
mul r0.yz, r0.yyzy, r2.xxyx
deriv_rtx_coarse r2.zw, r0.yyyz
deriv_rty_coarse r0.yz, r0.yyzy
add r0.yz, |r0.yyzy|, |r2.zzwz|
max r0.y, r0.z, r0.y
lt r0.z, l(1.400000), r0.y
if_nz r0.z
sample_l_indexable(texture2d)(float,float,float,float) r2.z, r2.xyxx, t2.zwxy, s1, l(0.000000)
endif
if_z r0.z
sample_l_indexable(texture2d)(float,float,float,float) r0.z, r2.xyxx, t2.yzxw, s1, l(0.000000)
add r0.z, r0.z, l(-0.500000)
mul r4.x, r0.y, l(0.500000)
mad r0.y, r0.y, l(0.250000), r0.z
div_sat r2.z, r0.y, r4.x
endif
mov r2.w, l(1.000000)
mov r3.xyzw, r2.wwwz
endif
if_z r0.w
lod r0.y, r2.xyxx, t2.x, s1
sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t2.xyzw, s1, r0.y
endif
endif
endif
mov r1.xyz, v5.xyzx
mul r1.xyzw, r1.xyzw, r3.xyzw
mul r0.yz, v6.xxyx, cb1[0].xxyx
mad r0.yz, r0.yyzy, cb0[50].zzwz, cb0[51].xxyx
sample_l_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t0.yxzw, s0, l(0.000000)
add r0.y, -r0.y, v3.w
add r0.z, r0.y, -cb5[0].z
add r0.w, -cb5[0].z, cb5[0].w
div_sat r0.z, r0.z, r0.w
add r2.xy, -cb5[1].xzxx, cb5[1].ywyy
mad r0.z, r0.z, r2.x, cb5[1].x
add r0.y, r0.y, -cb5[1].z
div_sat r0.y, r0.y, r2.y
add r0.w, -cb5[2].x, cb5[2].y
mad r0.y, r0.y, r0.w, cb5[2].x
utof r0.x, r0.x
eq r0.x, r0.x, l(1.000000)
and r0.x, r0.x, l(0x3f800000)
add r0.y, -r0.z, r0.y
mad r0.x, r0.x, r0.y, r0.z
mad r0.yz, v6.xxyx, cb0[50].zzwz, cb0[51].xxyx
sample_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t3.yxzw, s1
mov_sat r0.z, v2.x
mad r0.y, r0.x, r0.y, -r0.x
mad r0.x, r0.z, r0.y, r0.x
mul r1.w, r0.x, r1.w
mov r0.x, l(1.000000)
mov r0.w, cb5[0].x
mul r0.xyzw, r0.xxxw, r1.xyzw
mov r2.x, l(1.000000)
add r2.w, -cb5[0].x, l(1.000000)
mul r1.xyzw, r1.xyzw, r2.xxxw
mul r1.xyz, r1.wwww, r1.xyzx
mad o0.xyz, r0.xyzx, r0.wwww, r1.xyzx
mov o0.w, r1.w
ret
// Approximately 0 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

1080 Ti - i7 5820k - 16Gb RAM - Win 10 version 1607 - ASUS VG236H (1920x1080@120Hz)

Posted 12/15/2016 08:56 PM   
[quote="Jan-Itor"]Any of you wizards wanna help me fix this shader? :) [/quote] What game? What does the shader do? What's wrong with it? Some screenshots? And you are using an old 3Dmigoto version, by the way (or you dumped the shader long ago).
Jan-Itor said:Any of you wizards wanna help me fix this shader? :)


What game? What does the shader do? What's wrong with it? Some screenshots?

And you are using an old 3Dmigoto version, by the way (or you dumped the shader long ago).

CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: MSI GeForce RTX 2080Ti Gaming X Trio
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com

Posted 12/15/2016 09:27 PM   
[quote="masterotaku"][quote="Jan-Itor"]Any of you wizards wanna help me fix this shader? :) [/quote] What game? What does the shader do? What's wrong with it? Some screenshots? And you are using an old 3Dmigoto version, by the way (or you dumped the shader long ago).[/quote] Oh yeah sorry, it's the HUD in The Division and I want it to toggle on/off. I used version 1.2.43 to export it, but same thing happens with any version, it says "boop" when I export it.
masterotaku said:
Jan-Itor said:Any of you wizards wanna help me fix this shader? :)


What game? What does the shader do? What's wrong with it? Some screenshots?

And you are using an old 3Dmigoto version, by the way (or you dumped the shader long ago).


Oh yeah sorry, it's the HUD in The Division and I want it to toggle on/off. I used version 1.2.43 to export it, but same thing happens with any version, it says "boop" when I export it.

1080 Ti - i7 5820k - 16Gb RAM - Win 10 version 1607 - ASUS VG236H (1920x1080@120Hz)

Posted 12/15/2016 10:12 PM   
Check the "d3d11.log" file and see what errors it gives. Did you try dumping the vertex shader instead of the pixel shader, in case it doesn't give any errors? For an HUD on/off toggle, you need this (if in a pixel shader): [code] float4 iniparams = IniParams.Load(0); if (iniparams.x==1) { discard; } [/code] For example (there are other ways. If it's a pixel shader, you have to make the output "o0" to be 0 in that condition, for example, after its value has been defined by the shader). And you need in this case in "d3dx.ini" the constant "x=0", and then a hotkey in the hotkeys section: [code] [Key1] Key = F2 type = toggle x = 1 [/code] You can take my Skyrim Special Edition fix as an example, although I used a weird formula for the HUD (for the curvature stuff). So look at other toggle hotkeys I made.
Check the "d3d11.log" file and see what errors it gives.

Did you try dumping the vertex shader instead of the pixel shader, in case it doesn't give any errors?

For an HUD on/off toggle, you need this (if in a pixel shader):

float4 iniparams = IniParams.Load(0);
if (iniparams.x==1)
{
discard;
}


For example (there are other ways. If it's a pixel shader, you have to make the output "o0" to be 0 in that condition, for example, after its value has been defined by the shader). And you need in this case in "d3dx.ini" the constant "x=0", and then a hotkey in the hotkeys section:

[Key1]
Key = F2
type = toggle
x = 1



You can take my Skyrim Special Edition fix as an example, although I used a weird formula for the HUD (for the curvature stuff). So look at other toggle hotkeys I made.

CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: MSI GeForce RTX 2080Ti Gaming X Trio
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com

Posted 12/15/2016 10:55 PM   
[quote="lefuneste"]Hello again, Stupid Me...I finally found the way to make the 3Dmogoto lib being called by SteamVR for DCS. I just had to put the mod into DCS\bin dir [u]and also[/u] into Steam\steamapps\common\SteamVR\bin\win64 dir. It allows me to change the brightness and add a zoom effect based on a pixel shader (with the SuperSampling it really makes sense). Maybe this tip will help someone...[/quote] Thanks for letting us know. Did not occur to me that the VR launching mechanism would change the active directory.
lefuneste said:Hello again,
Stupid Me...I finally found the way to make the 3Dmogoto lib being called by SteamVR for DCS. I just had to put the mod into DCS\bin dir and also into Steam\steamapps\common\SteamVR\bin\win64 dir.
It allows me to change the brightness and add a zoom effect based on a pixel shader (with the SuperSampling it really makes sense). Maybe this tip will help someone...

Thanks for letting us know. Did not occur to me that the VR launching mechanism would change the active directory.

Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers

Posted 12/16/2016 05:28 AM   
[quote="masterotaku"]Check the "d3d11.log" file and see what errors it gives. Did you try dumping the vertex shader instead of the pixel shader, in case it doesn't give any errors? For an HUD on/off toggle, you need this (if in a pixel shader): [code] float4 iniparams = IniParams.Load(0); if (iniparams.x==1) { discard; } [/code] For example (there are other ways. If it's a pixel shader, you have to make the output "o0" to be 0 in that condition, for example, after its value has been defined by the shader). And you need in this case in "d3dx.ini" the constant "x=0", and then a hotkey in the hotkeys section: [code] [Key1] Key = F2 type = toggle x = 1 [/code] You can take my Skyrim Special Edition fix as an example, although I used a weird formula for the HUD (for the curvature stuff). So look at other toggle hotkeys I made.[/quote] I know how to make a toggle, but this shader wont toggle so I assume there's something wrong in the code? Not sure what I should be looking for in the d3d11.log, but I found this: [i]Tom Clancy's The Division\ShaderFixes\fc112a500bae3ab7-ps_replace.txt(62,23-24): error X3003: redefinition of 'w2'[/i] Exporting the vertex shader I also get the boop sound, here it is: [code]// ---- Created with 3Dmigoto v1.2.51 on Fri Dec 16 07:22:54 2016 cbuffer cb1 : register(b1) { float4 cb1[1]; } cbuffer cb0 : register(b0) { float4 cb0[2]; } // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float4 v0 : CUSTOM0, float4 v1 : CUSTOM1, float4 v2 : CUSTOM2, float2 v3 : CUSTOM3, float2 v4 : CUSTOM4, float2 v5 : CUSTOM5, float2 v6 : CUSTOM6, out float4 o0 : IO0_unClippedPos0, out float3 o1 : IO1_edgeuv0, out float o2 : IO2_UI_UserBig0, out float p2 : IO4_UI_UserSmall0, out int p2 : IO6_UI_RenderType0, out float4 o3 : IO3_Gfx_ClipPosition0, out float2 o4 : IO5_Gfx_UV0, out float4 o5 : IO7_Gfx_Color0, out float4 o6 : SV_Position0) { // Needs manual fix for instruction: // unknown dcl_: dcl_resource_raw t0 float4 r0,r1,r2,r3; uint4 bitmask, uiDest; float4 fDest; r0.xy = float2(255,255) * v2.zw; r0.xy = (int2)r0.xy; r1.x = (uint)r0.x << 6; // No code for instruction (needs manual fix): ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r1.xyzw, r1.x, t0.xyzw bitmask.x = ((~(-1 << 26)) << 6) & 0xffffffff; r2.x = (((uint)r0.x << 6) & bitmask.x) | ((uint)16 & ~bitmask.x); bitmask.y = ((~(-1 << 26)) << 6) & 0xffffffff; r2.y = (((uint)r0.x << 6) & bitmask.y) | ((uint)32 & ~bitmask.y); bitmask.z = ((~(-1 << 26)) << 6) & 0xffffffff; r2.z = (((uint)r0.x << 6) & bitmask.z) | ((uint)48 & ~bitmask.z); // No code for instruction (needs manual fix): ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r3.xyzw, r2.x, t0.xyzw r3.xyzw = v0.yyyy * r3.xyzw; r1.xyzw = r1.xyzw * v0.xxxx + r3.xyzw; // No code for instruction (needs manual fix): ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r3.xyzw, r2.y, t0.xyzw // No code for instruction (needs manual fix): ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r2.xyzw, r2.z, t0.xyzw r1.xyzw = r3.xyzw * v0.zzzz + r1.xyzw; r1.xyzw = r1.xyzw + r2.xyzw; o0.xyzw = r1.xyzw; r0.x = -1 + r1.w; r0.x = cb1[0].z * r0.x + 1; o1.xy = v6.xy * r0.xx; o1.z = r0.x; r0.z = v0.w; r0.w = v2.y; o2.xyz = r0.zwy; r0.xyzw = cb0[0].xyzw * r1.xyww; r0.xy = r0.xy + r0.zw; r0.zw = cb0[1].xy * cb0[0].xy; r0.xy = r0.zw * r1.ww + r0.xy; r1.xy = float2(1,-1) * r0.xy; o3.xyzw = r1.xyzw; o6.xyzw = r1.xyzw; o4.xy = v3.xy; o5.xyzw = v1.xyzw; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) D3D Shader Disassembler // // using 3Dmigoto v1.2.51 on Fri Dec 16 07:22:54 2016 // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // CUSTOM 0 xyzw 0 NONE float xyzw // CUSTOM 1 xyzw 1 NONE float xyzw // CUSTOM 2 xyzw 2 NONE float yzw // CUSTOM 3 xy 3 NONE float xy // CUSTOM 4 xy 4 NONE float // CUSTOM 5 xy 5 NONE float // CUSTOM 6 xy 6 NONE float xy // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // IO0_unClippedPos 0 xyzw 0 NONE float xyzw // IO1_edgeuv 0 xyz 1 NONE float xyz // IO2_UI_UserBig 0 x 2 NONE float x // IO4_UI_UserSmall 0 y 2 NONE float y // IO6_UI_RenderType 0 z 2 NONE int z // IO3_Gfx_ClipPosition 0 xyzw 3 NONE float xyzw // IO5_Gfx_UV 0 xy 4 NONE float xy // IO7_Gfx_Color 0 xyzw 5 NONE float xyzw // SV_Position 0 xyzw 6 POS float xyzw // vs_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[2], immediateIndexed dcl_constantbuffer cb1[1], immediateIndexed dcl_resource_raw t0 dcl_input v0.xyzw dcl_input v1.xyzw dcl_input v2.yzw dcl_input v3.xy dcl_input v6.xy dcl_output o0.xyzw dcl_output o1.xyz dcl_output o2.x dcl_output o2.y dcl_output o2.z dcl_output o3.xyzw dcl_output o4.xy dcl_output o5.xyzw dcl_output_siv o6.xyzw, position dcl_temps 4 mul r0.xy, v2.zwzz, l(255.000000, 255.000000, 0.000000, 0.000000) ftoi r0.xy, r0.xyxx ishl r1.x, r0.x, l(6) ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r1.xyzw, r1.x, t0.xyzw bfi r2.xyz, l(26, 26, 26, 0), l(6, 6, 6, 0), r0.xxxx, l(16, 32, 48, 0) ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r3.xyzw, r2.x, t0.xyzw mul r3.xyzw, r3.xyzw, v0.yyyy mad r1.xyzw, r1.xyzw, v0.xxxx, r3.xyzw ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r3.xyzw, r2.y, t0.xyzw ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r2.xyzw, r2.z, t0.xyzw mad r1.xyzw, r3.xyzw, v0.zzzz, r1.xyzw add r1.xyzw, r2.xyzw, r1.xyzw mov o0.xyzw, r1.xyzw add r0.x, r1.w, l(-1.000000) mad r0.x, cb1[0].z, r0.x, l(1.000000) mul o1.xy, r0.xxxx, v6.xyxx mov o1.z, r0.x mov r0.z, v0.w mov r0.w, v2.y mov o2.xyz, r0.zwyz mul r0.xyzw, r1.xyww, cb0[0].xyzw add r0.xy, r0.zwzz, r0.xyxx mul r0.zw, cb0[0].xxxy, cb0[1].xxxy mad r0.xy, r0.zwzz, r1.wwww, r0.xyxx mul r1.xy, r0.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000) mov o3.xyzw, r1.xyzw mov o6.xyzw, r1.xyzw mov o4.xy, v3.xyxx mov o5.xyzw, v1.xyzw ret // Approximately 0 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code]
masterotaku said:Check the "d3d11.log" file and see what errors it gives.

Did you try dumping the vertex shader instead of the pixel shader, in case it doesn't give any errors?

For an HUD on/off toggle, you need this (if in a pixel shader):

float4 iniparams = IniParams.Load(0);
if (iniparams.x==1)
{
discard;
}


For example (there are other ways. If it's a pixel shader, you have to make the output "o0" to be 0 in that condition, for example, after its value has been defined by the shader). And you need in this case in "d3dx.ini" the constant "x=0", and then a hotkey in the hotkeys section:

[Key1]
Key = F2
type = toggle
x = 1



You can take my Skyrim Special Edition fix as an example, although I used a weird formula for the HUD (for the curvature stuff). So look at other toggle hotkeys I made.


I know how to make a toggle, but this shader wont toggle so I assume there's something wrong in the code?

Not sure what I should be looking for in the d3d11.log, but I found this:

Tom Clancy's The Division\ShaderFixes\fc112a500bae3ab7-ps_replace.txt(62,23-24): error X3003: redefinition of 'w2'

Exporting the vertex shader I also get the boop sound, here it is:

// ---- Created with 3Dmigoto v1.2.51 on Fri Dec 16 07:22:54 2016
cbuffer cb1 : register(b1)
{
float4 cb1[1];
}

cbuffer cb0 : register(b0)
{
float4 cb0[2];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
float4 v0 : CUSTOM0,
float4 v1 : CUSTOM1,
float4 v2 : CUSTOM2,
float2 v3 : CUSTOM3,
float2 v4 : CUSTOM4,
float2 v5 : CUSTOM5,
float2 v6 : CUSTOM6,
out float4 o0 : IO0_unClippedPos0,
out float3 o1 : IO1_edgeuv0,
out float o2 : IO2_UI_UserBig0,
out float p2 : IO4_UI_UserSmall0,
out int p2 : IO6_UI_RenderType0,
out float4 o3 : IO3_Gfx_ClipPosition0,
out float2 o4 : IO5_Gfx_UV0,
out float4 o5 : IO7_Gfx_Color0,
out float4 o6 : SV_Position0)
{
// Needs manual fix for instruction:
// unknown dcl_: dcl_resource_raw t0
float4 r0,r1,r2,r3;
uint4 bitmask, uiDest;
float4 fDest;

r0.xy = float2(255,255) * v2.zw;
r0.xy = (int2)r0.xy;
r1.x = (uint)r0.x << 6;
// No code for instruction (needs manual fix):
ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r1.xyzw, r1.x, t0.xyzw
bitmask.x = ((~(-1 << 26)) << 6) & 0xffffffff; r2.x = (((uint)r0.x << 6) & bitmask.x) | ((uint)16 & ~bitmask.x);
bitmask.y = ((~(-1 << 26)) << 6) & 0xffffffff; r2.y = (((uint)r0.x << 6) & bitmask.y) | ((uint)32 & ~bitmask.y);
bitmask.z = ((~(-1 << 26)) << 6) & 0xffffffff; r2.z = (((uint)r0.x << 6) & bitmask.z) | ((uint)48 & ~bitmask.z);
// No code for instruction (needs manual fix):
ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r3.xyzw, r2.x, t0.xyzw
r3.xyzw = v0.yyyy * r3.xyzw;
r1.xyzw = r1.xyzw * v0.xxxx + r3.xyzw;
// No code for instruction (needs manual fix):
ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r3.xyzw, r2.y, t0.xyzw
// No code for instruction (needs manual fix):
ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r2.xyzw, r2.z, t0.xyzw
r1.xyzw = r3.xyzw * v0.zzzz + r1.xyzw;
r1.xyzw = r1.xyzw + r2.xyzw;
o0.xyzw = r1.xyzw;
r0.x = -1 + r1.w;
r0.x = cb1[0].z * r0.x + 1;
o1.xy = v6.xy * r0.xx;
o1.z = r0.x;
r0.z = v0.w;
r0.w = v2.y;
o2.xyz = r0.zwy;
r0.xyzw = cb0[0].xyzw * r1.xyww;
r0.xy = r0.xy + r0.zw;
r0.zw = cb0[1].xy * cb0[0].xy;
r0.xy = r0.zw * r1.ww + r0.xy;
r1.xy = float2(1,-1) * r0.xy;
o3.xyzw = r1.xyzw;
o6.xyzw = r1.xyzw;
o4.xy = v3.xy;
o5.xyzw = v1.xyzw;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
// using 3Dmigoto v1.2.51 on Fri Dec 16 07:22:54 2016
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// CUSTOM 0 xyzw 0 NONE float xyzw
// CUSTOM 1 xyzw 1 NONE float xyzw
// CUSTOM 2 xyzw 2 NONE float yzw
// CUSTOM 3 xy 3 NONE float xy
// CUSTOM 4 xy 4 NONE float
// CUSTOM 5 xy 5 NONE float
// CUSTOM 6 xy 6 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// IO0_unClippedPos 0 xyzw 0 NONE float xyzw
// IO1_edgeuv 0 xyz 1 NONE float xyz
// IO2_UI_UserBig 0 x 2 NONE float x
// IO4_UI_UserSmall 0 y 2 NONE float y
// IO6_UI_RenderType 0 z 2 NONE int z
// IO3_Gfx_ClipPosition 0 xyzw 3 NONE float xyzw
// IO5_Gfx_UV 0 xy 4 NONE float xy
// IO7_Gfx_Color 0 xyzw 5 NONE float xyzw
// SV_Position 0 xyzw 6 POS float xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[2], immediateIndexed
dcl_constantbuffer cb1[1], immediateIndexed
dcl_resource_raw t0
dcl_input v0.xyzw
dcl_input v1.xyzw
dcl_input v2.yzw
dcl_input v3.xy
dcl_input v6.xy
dcl_output o0.xyzw
dcl_output o1.xyz
dcl_output o2.x
dcl_output o2.y
dcl_output o2.z
dcl_output o3.xyzw
dcl_output o4.xy
dcl_output o5.xyzw
dcl_output_siv o6.xyzw, position
dcl_temps 4
mul r0.xy, v2.zwzz, l(255.000000, 255.000000, 0.000000, 0.000000)
ftoi r0.xy, r0.xyxx
ishl r1.x, r0.x, l(6)
ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r1.xyzw, r1.x, t0.xyzw
bfi r2.xyz, l(26, 26, 26, 0), l(6, 6, 6, 0), r0.xxxx, l(16, 32, 48, 0)
ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r3.xyzw, r2.x, t0.xyzw
mul r3.xyzw, r3.xyzw, v0.yyyy
mad r1.xyzw, r1.xyzw, v0.xxxx, r3.xyzw
ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r3.xyzw, r2.y, t0.xyzw
ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r2.xyzw, r2.z, t0.xyzw
mad r1.xyzw, r3.xyzw, v0.zzzz, r1.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mov o0.xyzw, r1.xyzw
add r0.x, r1.w, l(-1.000000)
mad r0.x, cb1[0].z, r0.x, l(1.000000)
mul o1.xy, r0.xxxx, v6.xyxx
mov o1.z, r0.x
mov r0.z, v0.w
mov r0.w, v2.y
mov o2.xyz, r0.zwyz
mul r0.xyzw, r1.xyww, cb0[0].xyzw
add r0.xy, r0.zwzz, r0.xyxx
mul r0.zw, cb0[0].xxxy, cb0[1].xxxy
mad r0.xy, r0.zwzz, r1.wwww, r0.xyxx
mul r1.xy, r0.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000)
mov o3.xyzw, r1.xyzw
mov o6.xyzw, r1.xyzw
mov o4.xy, v3.xyxx
mov o5.xyzw, v1.xyzw
ret
// Approximately 0 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

1080 Ti - i7 5820k - 16Gb RAM - Win 10 version 1607 - ASUS VG236H (1920x1080@120Hz)

Posted 12/16/2016 06:36 AM   
[quote="Jan-Itor"]I know how to make a toggle, but this shader wont toggle so I assume there's something wrong in the code? Not sure what I should be looking for in the d3d11.log, but I found this: [i]Tom Clancy's The Division\ShaderFixes\fc112a500bae3ab7-ps_replace.txt(62,23-24): error X3003: redefinition of 'w2'[/i][/quote] For this one, it's what it says, w2 is redefined. In the shader main declaration section: [code]... nointerpolation float w2 : IO4_UI_UserSmall0, nointerpolation int w2 : IO6_UI_RenderType0, [/code] Change the first one to x2, and change where it is used in the shader. (first one is only used once, easier to fix) [code] r2.x = saturate(x2.x * 2 + cb5[0].y); // r2.x = saturate(w2.x * 2 + cb5[0].y); [/code] That will allow it to compile with no errors, and give high beep. If you want to fix the vertex shader, that one is harder, because it needs some hand fixed code. I'm happy to do that, but only want to spend the time if you need to use it.
Jan-Itor said:I know how to make a toggle, but this shader wont toggle so I assume there's something wrong in the code?

Not sure what I should be looking for in the d3d11.log, but I found this:

Tom Clancy's The Division\ShaderFixes\fc112a500bae3ab7-ps_replace.txt(62,23-24): error X3003: redefinition of 'w2'

For this one, it's what it says, w2 is redefined. In the shader main declaration section:

...
nointerpolation float w2 : IO4_UI_UserSmall0,
nointerpolation int w2 : IO6_UI_RenderType0,

Change the first one to x2, and change where it is used in the shader. (first one is only used once, easier to fix)

r2.x = saturate(x2.x * 2 + cb5[0].y);  // r2.x = saturate(w2.x * 2 + cb5[0].y);


That will allow it to compile with no errors, and give high beep.


If you want to fix the vertex shader, that one is harder, because it needs some hand fixed code. I'm happy to do that, but only want to spend the time if you need to use it.

Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers

Posted 12/16/2016 09:13 AM   
[quote="bo3b"] For this one, it's what it says, w2 is redefined. In the shader main declaration section: [code]... nointerpolation float w2 : IO4_UI_UserSmall0, nointerpolation int w2 : IO6_UI_RenderType0, [/code] Change the first one to x2, and change where it is used in the shader. (first one is only used once, easier to fix) [code] r2.x = saturate(x2.x * 2 + cb5[0].y); // r2.x = saturate(w2.x * 2 + cb5[0].y); [/code] That will allow it to compile with no errors, and give high beep. [/quote] This worked, thanks a ton! No need to fix the vertex shader.
bo3b said:
For this one, it's what it says, w2 is redefined. In the shader main declaration section:

...
nointerpolation float w2 : IO4_UI_UserSmall0,
nointerpolation int w2 : IO6_UI_RenderType0,

Change the first one to x2, and change where it is used in the shader. (first one is only used once, easier to fix)

r2.x = saturate(x2.x * 2 + cb5[0].y);  // r2.x = saturate(w2.x * 2 + cb5[0].y);


That will allow it to compile with no errors, and give high beep.


This worked, thanks a ton! No need to fix the vertex shader.

1080 Ti - i7 5820k - 16Gb RAM - Win 10 version 1607 - ASUS VG236H (1920x1080@120Hz)

Posted 12/16/2016 12:59 PM   
  80 / 143    
Scroll To Top