3Dmigoto now open-source...
  115 / 143    
Yeah I actually tried that but discarding a vertex shader doesn't seem to be possible. "cannot map expression to vs_5_0 instruction set" it says.
Yeah I actually tried that but discarding a vertex shader doesn't seem to be possible.

"cannot map expression to vs_5_0 instruction set" it says.

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

Posted 11/14/2017 03:18 PM   
[quote="masterotaku"]Can you discard a vertex shader? I thought it wasn't possible, but it's something that I didn't actually try since 2015 when I was starting learning HLSL.[/quote] I clearly haven't followed the discussion close enough and thought he was trying the disable code in a pixel shader. I should really get around to implementing the conditional logic in the command list so you could do something like this to avoid the decompiler altogether if you don't need to otherwise modify the shader (example only - the syntax is not final): [code] [ShaderOverrideFoo] hash = ... if x == 0 then handling = skip endif [/code] [quote]Unrelated to all if this, one of the strange things I learned while fixing Hitman 1 and 2 was that in Shader Model 4, in ASM, comparisons are done differently (compared to DX9 fixes) if they aren't just checking if something is zero or non zero. Storing comparisons in a register and then checking if they were zero or non zero (true/false) wasn't intuitive at first, but then it allowed a lot of quick and effortless changes in the code. Fun stuff.[/quote] It's done that way because it's easier to implement in hardware. However, beware that if you ever get a NaN value (e.g. infinity) in some calculation those tests can behave really strangely and don't make sense (variations in compiler output that should produce a logically equivalent result don't, because the compiler made an assumption that NaN wouldn't appear there), whereas the DX9 versions still make some logical sense in that case.
masterotaku said:Can you discard a vertex shader? I thought it wasn't possible, but it's something that I didn't actually try since 2015 when I was starting learning HLSL.

I clearly haven't followed the discussion close enough and thought he was trying the disable code in a pixel shader.

I should really get around to implementing the conditional logic in the command list so you could do something like this to avoid the decompiler altogether if you don't need to otherwise modify the shader (example only - the syntax is not final):

[ShaderOverrideFoo]
hash = ...
if x == 0 then
handling = skip
endif


Unrelated to all if this, one of the strange things I learned while fixing Hitman 1 and 2 was that in Shader Model 4, in ASM, comparisons are done differently (compared to DX9 fixes) if they aren't just checking if something is zero or non zero. Storing comparisons in a register and then checking if they were zero or non zero (true/false) wasn't intuitive at first, but then it allowed a lot of quick and effortless changes in the code. Fun stuff.

It's done that way because it's easier to implement in hardware. However, beware that if you ever get a NaN value (e.g. infinity) in some calculation those tests can behave really strangely and don't make sense (variations in compiler output that should produce a logically equivalent result don't, because the compiler made an assumption that NaN wouldn't appear there), whereas the DX9 versions still make some logical sense in that case.

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 11/14/2017 05:01 PM   
[quote="DarkStarSword"]I should really get around to implementing the conditional logic in the command list so you could do something like this to avoid the decompiler altogether if you don't need to otherwise modify the shader (example only - the syntax is not final): [code] [ShaderOverrideFoo] hash = ... if x == 0 then handling = skip endif[/quote][/code] Ah, so you could set up a toggle in the d3dx.ini instead? That would be awesome.
DarkStarSword said:I should really get around to implementing the conditional logic in the command list so you could do something like this to avoid the decompiler altogether if you don't need to otherwise modify the shader (example only - the syntax is not final):

[ShaderOverrideFoo]
hash = ...
if x == 0 then
handling = skip
endif


Ah, so you could set up a toggle in the d3dx.ini instead? That would be awesome.

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

Posted 11/14/2017 05:41 PM   
[quote="DetectiveJohnKimble"][quote="bo3b"]@DetectiveJohnKimble: I'm not sure I understand exactly what you are wanting to do, but for this code, I would recommend not changing the other parameters. To disable, set the o0 to 0, not all of them.[/quote] I'm trying to make the shader toggle on/off. It's the HUD in AC Origins so basically this is meant to be a hotkey for turning the HUD on and off. [quote="bo3b"]The key part is that [i]out float4 o0 : SV_Position0,[/i] which is o0. If you set position to zero, then the pixel shader has nothing to work with. This is explained in fair depth in my ShaderHacker class, so if you haven't looked at that, you need to. Even though the class talks about DX9, the principles are the same. Just: [code] float4 params = IniParams.Load(0); if (params.x == 0) { o0 = 0; return; } else { [/code][/quote] Hmm, this gives me the same result as before. [/quote] If you are getting glitches, look to see if it is an HLSL Decompiler problem. Use F9 to show_original when it's up, and see if it changes. For properly Decompiled shaders, there should be no visual difference for an unmodified HLSL shader. For getting the starting value, the iniParams.x starts at zero by default. If that's not what you want, you need to set it in the earlier part of the d3dx.ini where they are defined, or use the opposite boolean check. Probably for an on/off toggle, you'd want to use the PS instead. It's later in the pipeline, and less likely to damage other visual items when disabled.
DetectiveJohnKimble said:
bo3b said:@DetectiveJohnKimble: I'm not sure I understand exactly what you are wanting to do, but for this code, I would recommend not changing the other parameters. To disable, set the o0 to 0, not all of them.


I'm trying to make the shader toggle on/off. It's the HUD in AC Origins so basically this is meant to be a hotkey for turning the HUD on and off.

bo3b said:The key part is that out float4 o0 : SV_Position0,
which is o0. If you set position to zero, then the pixel shader has nothing to work with. This is explained in fair depth in my ShaderHacker class, so if you haven't looked at that, you need to. Even though the class talks about DX9, the principles are the same.

Just:
float4 params = IniParams.Load(0);
if (params.x == 0)
{
o0 = 0;
return;
} else {


Hmm, this gives me the same result as before.

If you are getting glitches, look to see if it is an HLSL Decompiler problem. Use F9 to show_original when it's up, and see if it changes. For properly Decompiled shaders, there should be no visual difference for an unmodified HLSL shader.

For getting the starting value, the iniParams.x starts at zero by default. If that's not what you want, you need to set it in the earlier part of the d3dx.ini where they are defined, or use the opposite boolean check.


Probably for an on/off toggle, you'd want to use the PS instead. It's later in the pipeline, and less likely to damage other visual items when disabled.

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 11/15/2017 03:42 AM   
[quote="bo3b"] If you are getting glitches, look to see if it is an HLSL Decompiler problem. Use F9 to show_original when it's up, and see if it changes. For properly Decompiled shaders, there should be no visual difference for an unmodified HLSL shader.[/quote] I'm supposed to hold F9 in hunting mode right? If I do that then the shader changes back to it's original form. [quote="bo3b"] Probably for an on/off toggle, you'd want to use the PS instead. It's later in the pipeline, and less likely to damage other visual items when disabled.[/quote] Well you mentioned it being harder to fix, so I understand if it's too much work. Just gonna post it incase you or anyone wants to have a whack at it: [color="orange"]000ea4ff144f3d6d-ps_replace.txt(244,37): error X3000: syntax error: unexpected token '.'[/color] [code]// ---- Created with 3Dmigoto v1.2.67 on Wed Nov 15 20:04:45 2017 cbuffer PassParams_cbuffer : register(b1) { struct { float4 eyePosition; float4 eyePositionPrevFrame; float4 eyeDirection; float4 eyeDirectionPrevFrame; float4x4 viewToWorld; float4x4 viewToWorldPrevFrame; float4x4 worldToView; float4x4 worldToViewPrevFrame; float4x4 projMatrix; float4x4 viewProj; float4x4 viewNoTranslationProj; float4x4 viewProjPrevFrame; float4x4 viewNoTranslationProjPrevFrame; float4 viewTranslation; float4 viewTranslationPrevFrame; float4 vPosToUV; float4 viewportScaleOffset; float4 zFrontBackValue; float4 clipPlane; float4 frustumPlanes[4]; float4 globalLightingScale; float4 viewSpaceLightingBackWS; float4 projectorPosition; float4 prevProjectorPosition; float4 pixelPatchingParams; float gradientAdjustMipBias; float thinGeomAAPixelScale; uint layerIndex; uint globalCubeMapIndex; uint dynamicGBufferCubeMapIndex; uint alphaDitherEnabled; uint TAADitherEnabled; float CameraTAAFadeStartDist; struct { } materialTable; struct { float4x4 ClipXYZToViewPos; float4x4 ClipXYZToWorldPos; float4 ClipZToViewZ; } RevProjParams; struct { } refraction; struct { } deferredcommon; struct { } motionVector; struct { float4 XYScaleBias; float4 ForwardMappingParams; float2 ZProject; float4 BackwardMappingParams; float CloudShadowGIDensity; } combinedCloudShadow; struct { } AmbientLighting; struct { float4 volumeInvTransZ; float4 volumeTexScale; float4 volumeTexBias; float4 sunColor; float4 sunColorByOneOverPi; } fog; struct { float3 InvDepthParams; } underwater; struct { float4 VposToClusterXY; float4 ClipPosToClusterXY; float4 ClusterTransZ; uint HighClusterW; uint HighClusterWH; } clusteredLightsEvaluate; struct { } waterStamperTextures; struct { float3 maxCC; } waterCustomMeshParams; struct { } videoAndScreenshot; struct { } rainRipples; struct { } cookieShadows; struct { } nearShadows; struct { float FarShadowBlendRatio; } farShadows; struct { } commonShadows; struct { float2 WorldToUVOffset; float2 WorldToUVScale; float2 ReferenceWorldXY; float FadeStart; float Radius; } grassForce; } PassParams_constants : packoffset(c0); } cbuffer InstanceParams_cbuffer : register(b3) { struct { float4x4 world; float4x4 worldPrevFrame; float4x4 worldViewProj; float4x4 worldViewProjPrevFrame; float4 dissolveFactor; float LODBlendFactor; float wetnessBias; float alphaTestValue; uint materialTableIndex; uint instanceOffset; uint CameraTAADither; struct { struct { int4 offsets; } instanceBatchSetupConsts; } instancing; } InstanceParams_constants : packoffset(c0); } cbuffer MaterialParams_cbuffer : register(b2) { struct { struct { float4 blendXYAlphaTestTwoSided; } defaults; float4 VertexQuadMin_6; float4 VertexScale_89; float4 VertexOffset_92; float4 VertexQuadMax_16; float4 AlphaClampFallof_2; float4 UseVertexAlpha_4; float4 UseScreenAlpha_5; float4 UseLayer1AlphaGrayScale_7; float4 AlphaClampMin_9; float4 AlphaClampIsLayer01Alpha_10; float4 UseLayer1Alpha_11; float4 Layer0DiffuseUVIsClamp_13; float4 Layer0DiffuseIsBC4_14; float4 Layer1AlphaIsBC4_15; float4 Layer1AlphaUVIsClamp_17; float4 Layer0DiffuseIs9SS_18; float4 OcclusionAlpha_20; float4 OcclusionAlphaStepValue_21; float4 Layer0DiffuseIsScreenSpace_22; float4 Layer0DiffuseIsInvert_23; float4 Layer0ColorIsAdd_24; float4 ScreenAlphaTop_25; float4 ScreenAlphaFallout_26; float4 ScreenAlphaBottom_27; float4 AlphaBoost_28; float4 Mipmap_30; float3x3 Layer0DiffuseUV_8_matrix; float3x3 Layer1AlphaUV_12_matrix; } MaterialParams_constants : packoffset(c0); } SamplerState FrameParams_defaultSamplers_pointClamp_s : register(s0); SamplerState FrameParams_defaultSamplers_standardSampler_s : register(s4); Texture2D<float4> PassParams_lastExposureTexture : register(t20); Texture2D<float4> PassParams_deferredcommon_DepthSurface : register(t28); Texture2D<float4> MaterialParams_srv.Layer0Diffuse_0 : register(t70); Texture2D<float4> MaterialParams_srv.Layer1Alpha_1 : register(t71); Buffer<float4> InstanceParams_instancing_instanceData : register(t81); // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float4 v0 : SV_Position0, linear sample float4 v1 : TEXCOORD0, linear sample float4 v2 : COLOR0, float4 v3 : TEXCOORD1, float4 v4 : TEXCOORD2, float4 v5 : TEXCOORD3, float4 v6 : TEXCOORD4, nointerpolation uint v7 : InstanceID0, uint v8 : SV_IsFrontFace0, out float4 o0 : SV_Target0) { float4 r0,r1,r2,r3,r4; uint4 bitmask, uiDest; float4 fDest; r0.x = cmp(0 != MaterialParams_constants.Layer1AlphaUVIsClamp_17.x); r1.xy = v1.xy; r1.z = 1; r2.x = dot(r1.xyz, MaterialParams_constants.Layer1AlphaUV_12_matrix._m00_m10_m20); r2.y = dot(r1.xyz, MaterialParams_constants.Layer1AlphaUV_12_matrix._m01_m11_m21); r0.yz = saturate(r2.xy); r0.xy = r0.xx ? r0.yz : r2.xy; r0.z = -2.5 + PassParams_constants.gradientAdjustMipBias; r0.xyz = MaterialParams_srv.Layer1Alpha_1.SampleBias(FrameParams_defaultSamplers_standardSampler_s, r0.xy, r0.z).xyw; r0.w = cmp(0 != MaterialParams_constants.Layer1AlphaIsBC4_15.x); r0.xy = r0.ww ? r0.xx : r0.yz; r0.x = r0.x + -r0.y; r0.x = MaterialParams_constants.UseLayer1AlphaGrayScale_7.x * r0.x + r0.y; r0.yz = abs(MaterialParams_constants.VertexQuadMax_16.xz) + abs(MaterialParams_constants.VertexQuadMin_6.xz); r0.yz = float2(3.39498758,3.39498758) * r0.yz; r1.xy = float2(0.25,0.25) / r0.yz; r1.zw = float2(1,1) + -r1.xy; r2.xy = r1.zw + -r1.xy; r2.zw = v0.xy * PassParams_constants.vPosToUV.xy + -v1.xy; r3.xy = MaterialParams_constants.Layer0DiffuseIsScreenSpace_22.xx * r2.zw + v1.xy; r3.z = 1; r4.x = dot(r3.xyz, MaterialParams_constants.Layer0DiffuseUV_8_matrix._m00_m10_m20); r4.y = dot(r3.xyz, MaterialParams_constants.Layer0DiffuseUV_8_matrix._m01_m11_m21); r2.zw = r4.xy + -r1.xy; r1.xy = cmp(r4.xy < r1.xy); r2.xy = r2.zw / r2.xy; r2.xy = r2.xy * float2(0.5,0.5) + float2(0.25,0.25); r2.zw = float2(1,1) + -r4.xy; r2.zw = -r2.zw * r0.yz + float2(1,1); r0.yz = r4.xy * r0.yz; r1.zw = cmp(r1.zw < r4.xy); r1.zw = r1.zw ? r2.zw : r2.xy; r0.yz = r1.xy ? r0.yz : r1.zw; r0.w = cmp(0 < MaterialParams_constants.Layer0DiffuseIs9SS_18.x); r0.yz = r0.ww ? r0.yz : r4.xy; r1.xy = saturate(r0.yz); r0.w = cmp(0 != MaterialParams_constants.Layer0DiffuseUVIsClamp_13.x); r0.yz = r0.ww ? r1.xy : r0.yz; r0.w = MaterialParams_constants.Mipmap_30.x + PassParams_constants.gradientAdjustMipBias; r0.w = -2.5 + r0.w; r1.xyzw = MaterialParams_srv.Layer0Diffuse_0.SampleBias(FrameParams_defaultSamplers_standardSampler_s, r0.yz, r0.w).yzwx; r0.y = cmp(0 != MaterialParams_constants.Layer0DiffuseIsBC4_14.x); r1.xyz = r0.yyy ? r1.www : r1.xyz; r0.y = -r1.z + r0.x; r0.y = MaterialParams_constants.UseLayer1Alpha_11.x * r0.y + r1.z; r0.x = r0.x + -r0.y; r0.x = saturate(MaterialParams_constants.AlphaClampIsLayer01Alpha_10.x * r0.x + r0.y); r0.z = 1 + -r0.x; r0.w = 1 + -MaterialParams_constants.AlphaClampMin_9.x; r0.z = r0.z + -r0.w; r0.w = cmp(0 != MaterialParams_constants.AlphaClampFallof_2.x); r0.w = r0.w ? MaterialParams_constants.AlphaClampFallof_2.x : 9.99999997e-007; r2.x = (uint)v7.x << 3; r2.x = (uint)r2.x >> 2; r2.x = (int)r2.x + (int)InstanceParams_constants.instancing.instanceBatchSetupConsts.offsets.y; r2.x = InstanceParams_instancing_instanceData.Load(r2.x).y; r2.x = (int)r2.x + 3; r2.xyz = InstanceParams_instancing_instanceData.Load(r2.x).xzw; r2.xzw = (int3)r2.yzx & int3(255,255,0); r3.xyz = (uint3)r2.yyy >> int3(24,16,8); r3.xyz = (int3)r3.xyz & int3(255,255,255); r3.xyz = (uint3)r3.xyz; r2.y = f16tof32(r2.w); r2.xz = (uint2)r2.xz; r0.x = -r2.y + r0.x; r0.xz = saturate(r0.xz / r0.ww); r0.x = max(r0.x, r0.z); r0.x = 1 + -r0.x; r0.z = -1 + v2.w; r0.z = MaterialParams_constants.UseVertexAlpha_4.x * r0.z + 1; r0.y = r0.y * r0.z; r0.x = r0.x * r0.y; r0.x = r0.x * r1.z; r0.yz = PassParams_constants.vPosToUV.xy * v0.xy; r0.y = PassParams_deferredcommon_DepthSurface.SampleLevel(FrameParams_defaultSamplers_pointClamp_s, r0.yz, 0).x; r0.yz = r0.yy * PassParams_constants.RevProjParams.ClipZToViewZ.wz + PassParams_constants.RevProjParams.ClipZToViewZ.yx; r0.y = r0.y / r0.z; r0.y = -v0.w + r0.y; r0.y = cmp(r0.y >= MaterialParams_constants.OcclusionAlphaStepValue_21.x); r0.z = r0.y ? 1.000000 : 0; r0.y = r0.y ? 0 : MaterialParams_constants.OcclusionAlpha_20.x; r0.y = r0.z + r0.y; r0.x = r0.x * r0.y; r0.y = v0.y * PassParams_constants.vPosToUV.y + -MaterialParams_constants.ScreenAlphaBottom_27.x; r0.z = cmp(0 != MaterialParams_constants.ScreenAlphaFallout_26.x); r0.z = r0.z ? MaterialParams_constants.ScreenAlphaFallout_26.x : 9.99999997e-007; r0.y = saturate(r0.y / r0.z); r0.y = 1 + -r0.y; r0.w = v0.y * PassParams_constants.vPosToUV.y + -MaterialParams_constants.ScreenAlphaTop_25.x; r0.z = saturate(r0.w / r0.z); r0.y = min(r0.z, r0.y); r0.y = -1 + r0.y; r0.y = MaterialParams_constants.UseScreenAlpha_5.x * r0.y + 1; r0.x = min(r0.x, r0.y); r0.y = 0.00392156886 * r2.x; r0.y = r2.z * r0.y; r0.y = MaterialParams_constants.AlphaBoost_28.x * r0.y; r0.y = 0.00392156886 * r0.y; r0.x = r0.y * r0.x; r2.xyz = float3(1,1,1) + -r1.wxy; r0.y = cmp(0 != MaterialParams_constants.Layer0DiffuseIsInvert_23.x); r0.yzw = r0.yyy ? r2.xyz : r1.wxy; r1.xyz = saturate(r3.xyz * float3(0.00392156886,0.00392156886,0.00392156886) + r0.yzw); r2.xyz = float3(0.00392156886,0.00392156886,0.00392156886) * r3.xyz; r1.xyz = -r0.yzw * r2.xyz + r1.xyz; r0.yzw = r2.xyz * r0.yzw; r0.yzw = MaterialParams_constants.Layer0ColorIsAdd_24.xxx * r1.xyz + r0.yzw; r1.xyz = r3.xyz * float3(0.00392156886,0.00392156886,0.00392156886) + -r0.yzw; r0.yzw = MaterialParams_constants.Layer0DiffuseIsBC4_14.xxx * r1.xyz + r0.yzw; r0.yzw = r0.yzw * r0.xxx; o0.w = r0.x; r0.x = PassParams_lastExposureTexture.SampleLevel(FrameParams_defaultSamplers_pointClamp_s, float2(0,0), 0).x; r0.xyz = r0.yzw / r0.xxx; r0.xyz = max(float3(0,0,0), r0.xyz); r0.xyz = min(float3(100000,100000,100000), r0.xyz); o0.xyz = PassParams_constants.globalLightingScale.xxx * r0.xyz; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) HLSL Shader Compiler 10.1 // // using 3Dmigoto v1.2.67 on Wed Nov 15 20:04:45 2017 // // // Buffer Definitions: // // cbuffer PassParams_cbuffer // { // // struct PassParams_Constants // { // // float4 eyePosition; // Offset: 0 // float4 eyePositionPrevFrame; // Offset: 16 // float4 eyeDirection; // Offset: 32 // float4 eyeDirectionPrevFrame; // Offset: 48 // float4x4 viewToWorld; // Offset: 64 // float4x4 viewToWorldPrevFrame; // Offset: 128 // float4x4 worldToView; // Offset: 192 // float4x4 worldToViewPrevFrame; // Offset: 256 // float4x4 projMatrix; // Offset: 320 // float4x4 viewProj; // Offset: 384 // float4x4 viewNoTranslationProj;// Offset: 448 // float4x4 viewProjPrevFrame; // Offset: 512 // float4x4 viewNoTranslationProjPrevFrame;// Offset: 576 // float4 viewTranslation; // Offset: 640 // float4 viewTranslationPrevFrame;// Offset: 656 // float4 vPosToUV; // Offset: 672 // float4 viewportScaleOffset; // Offset: 688 // float4 zFrontBackValue; // Offset: 704 // float4 clipPlane; // Offset: 720 // float4 frustumPlanes[4]; // Offset: 736 // float4 globalLightingScale; // Offset: 800 // float4 viewSpaceLightingBackWS;// Offset: 816 // float4 projectorPosition; // Offset: 832 // float4 prevProjectorPosition; // Offset: 848 // float4 pixelPatchingParams; // Offset: 864 // float gradientAdjustMipBias; // Offset: 880 // float thinGeomAAPixelScale; // Offset: 884 // uint layerIndex; // Offset: 888 // uint globalCubeMapIndex; // Offset: 892 // uint dynamicGBufferCubeMapIndex;// Offset: 896 // uint alphaDitherEnabled; // Offset: 900 // uint TAADitherEnabled; // Offset: 904 // float CameraTAAFadeStartDist; // Offset: 908 // // struct MaterialTable_Constants // { // // } materialTable; // Offset: 4294967292 // // struct ReverseProjParams_Constants // { // // float4x4 ClipXYZToViewPos; // Offset: 912 // float4x4 ClipXYZToWorldPos;// Offset: 976 // float4 ClipZToViewZ; // Offset: 1040 // // } RevProjParams; // Offset: 912 // // struct RefractionParams_Constants // { // // } refraction; // Offset: 4294967292 // // struct DeferredCommonParams_Constants // { // // } deferredcommon; // Offset: 4294967292 // // struct MotionVectorParams_Constants // { // // } motionVector; // Offset: 4294967292 // // struct CombinedCloudShadow_Constants // { // // float4 XYScaleBias; // Offset: 1056 // float4 ForwardMappingParams;// Offset: 1072 // float2 ZProject; // Offset: 1088 // float4 BackwardMappingParams;// Offset: 1104 // float CloudShadowGIDensity;// Offset: 1120 // // } combinedCloudShadow; // Offset: 1056 // // struct AmbientLightingParams_Constants // { // // } AmbientLighting; // Offset: 4294967292 // // struct VolumetricFogParams_Constants // { // // float4 volumeInvTransZ; // Offset: 1136 // float4 volumeTexScale; // Offset: 1152 // float4 volumeTexBias; // Offset: 1168 // float4 sunColor; // Offset: 1184 // float4 sunColorByOneOverPi;// Offset: 1200 // // } fog; // Offset: 1136 // // struct UnderwaterLightingParams_Constants // { // // float3 InvDepthParams; // Offset: 1216 // // } underwater; // Offset: 1216 // // struct ClusteredLightsEvaluateParams_Constants // { // // float4 VposToClusterXY; // Offset: 1232 // float4 ClipPosToClusterXY; // Offset: 1248 // float4 ClusterTransZ; // Offset: 1264 // uint HighClusterW; // Offset: 1280 // uint HighClusterWH; // Offset: 1284 // // } clusteredLightsEvaluate; // Offset: 1232 // // struct WaterStamperTextureParams_Constants // { // // } waterStamperTextures; // Offset: 4294967292 // // struct WaterCustomMeshParams_Constants // { // // float3 maxCC; // Offset: 1296 // // } waterCustomMeshParams; // Offset: 1296 // // struct VideoAndScreenshotParams_Constants // { // // } videoAndScreenshot; // Offset: 4294967292 // // struct RainRipplesParams_Constants // { // // } rainRipples; // Offset: 4294967292 // // struct CookieShadowParams_Constants // { // // } cookieShadows; // Offset: 4294967292 // // struct NearShadowParams_Constants // { // // } nearShadows; // Offset: 4294967292 // // struct FarShadowParams_Constants // { // // float FarShadowBlendRatio; // Offset: 1312 // // } farShadows; // Offset: 1312 // // struct CommonShadowParams_Constants // { // // } commonShadows; // Offset: 4294967292 // // struct GrassForceSamplingParams_Constants // { // // float2 WorldToUVOffset; // Offset: 1328 // float2 WorldToUVScale; // Offset: 1336 // float2 ReferenceWorldXY; // Offset: 1344 // float FadeStart; // Offset: 1352 // float Radius; // Offset: 1356 // // } grassForce; // Offset: 1328 // // } PassParams_constants; // Offset: 0 Size: 1360 // // } // // cbuffer InstanceParams_cbuffer // { // // struct InstanceParams_Constants // { // // float4x4 world; // Offset: 0 // float4x4 worldPrevFrame; // Offset: 64 // float4x4 worldViewProj; // Offset: 128 // float4x4 worldViewProjPrevFrame;// Offset: 192 // float4 dissolveFactor; // Offset: 256 // float LODBlendFactor; // Offset: 272 // float wetnessBias; // Offset: 276 // float alphaTestValue; // Offset: 280 // uint materialTableIndex; // Offset: 284 // uint instanceOffset; // Offset: 288 // uint CameraTAADither; // Offset: 292 // // struct InstancingParams_Constants // { // // struct InstanceBatchSetupConsts_Constants // { // // int4 offsets; // Offset: 304 // // } instanceBatchSetupConsts;// Offset: 304 // // } instancing; // Offset: 304 // // } InstanceParams_constants; // Offset: 0 Size: 320 // // } // // cbuffer MaterialParams_cbuffer // { // // struct MaterialParams_Constants // { // // struct DefaultMaterialConsts // { // // float4 blendXYAlphaTestTwoSided;// Offset: 0 // // } defaults; // Offset: 0 // float4 VertexQuadMin_6; // Offset: 16 // float4 VertexScale_89; // Offset: 32 // float4 VertexOffset_92; // Offset: 48 // float4 VertexQuadMax_16; // Offset: 64 // float4 AlphaClampFallof_2; // Offset: 80 // float4 UseVertexAlpha_4; // Offset: 96 // float4 UseScreenAlpha_5; // Offset: 112 // float4 UseLayer1AlphaGrayScale_7;// Offset: 128 // float4 AlphaClampMin_9; // Offset: 144 // float4 AlphaClampIsLayer01Alpha_10;// Offset: 160 // float4 UseLayer1Alpha_11; // Offset: 176 // float4 Layer0DiffuseUVIsClamp_13;// Offset: 192 // float4 Layer0DiffuseIsBC4_14; // Offset: 208 // float4 Layer1AlphaIsBC4_15; // Offset: 224 // float4 Layer1AlphaUVIsClamp_17;// Offset: 240 // float4 Layer0DiffuseIs9SS_18; // Offset: 256 // float4 OcclusionAlpha_20; // Offset: 272 // float4 OcclusionAlphaStepValue_21;// Offset: 288 // float4 Layer0DiffuseIsScreenSpace_22;// Offset: 304 // float4 Layer0DiffuseIsInvert_23;// Offset: 320 // float4 Layer0ColorIsAdd_24; // Offset: 336 // float4 ScreenAlphaTop_25; // Offset: 352 // float4 ScreenAlphaFallout_26; // Offset: 368 // float4 ScreenAlphaBottom_27; // Offset: 384 // float4 AlphaBoost_28; // Offset: 400 // float4 Mipmap_30; // Offset: 416 // float3x3 Layer0DiffuseUV_8_matrix;// Offset: 432 // float3x3 Layer1AlphaUV_12_matrix;// Offset: 480 // // } MaterialParams_constants; // Offset: 0 Size: 524 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // FrameParams_defaultSamplers_pointClamp sampler NA NA 0 1 // FrameParams_defaultSamplers_standardSampler sampler NA NA 4 1 // PassParams_lastExposureTexture texture float4 2d 20 1 // PassParams_deferredcommon_DepthSurface texture float4 2d 28 1 // MaterialParams_srv.Layer0Diffuse_0 texture float4 2d 70 1 // MaterialParams_srv.Layer1Alpha_1 texture float4 2d 71 1 // InstanceParams_instancing_instanceData texture float4 buf 81 1 // PassParams_cbuffer cbuffer NA NA 1 1 // MaterialParams_cbuffer cbuffer NA NA 2 1 // InstanceParams_cbuffer cbuffer NA NA 3 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float xy w // TEXCOORD 0 xyzw 1 NONE float xy // COLOR 0 xyzw 2 NONE float w // TEXCOORD 1 xyzw 3 NONE float // TEXCOORD 2 xyzw 4 NONE float // TEXCOORD 3 xyzw 5 NONE float // TEXCOORD 4 xyzw 6 NONE float // InstanceID 0 x 7 NONE uint x // SV_IsFrontFace 0 x 8 FFACE uint // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Target 0 xyzw 0 TARGET float xyzw // // Pixel Shader runs at sample frequency // ps_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb1[66], immediateIndexed dcl_constantbuffer cb3[20], immediateIndexed dcl_constantbuffer cb2[32], immediateIndexed dcl_sampler s0, mode_default dcl_sampler s4, mode_default dcl_resource_texture2d (float,float,float,float) t20 dcl_resource_texture2d (float,float,float,float) t28 dcl_resource_texture2d (float,float,float,float) t70 dcl_resource_texture2d (float,float,float,float) t71 dcl_resource_buffer (float,float,float,float) t81 dcl_input_ps_siv linear noperspective sample v0.xyw, position dcl_input_ps linear sample v1.xy dcl_input_ps linear sample v2.w dcl_input_ps constant v7.x dcl_output o0.xyzw dcl_temps 5 ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[15].x mov r1.xy, v1.xyxx mov r1.z, l(1.000000) dp3 r2.x, r1.xyzx, cb2[30].xyzx dp3 r2.y, r1.xyzx, cb2[31].xyzx mov_sat r0.yz, r2.xxyx movc r0.xy, r0.xxxx, r0.yzyy, r2.xyxx add r0.z, cb1[55].x, l(-2.500000) sample_b_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t71.xywz, s4, r0.z ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[14].x movc r0.xy, r0.wwww, r0.xxxx, r0.yzyy add r0.x, -r0.y, r0.x mad r0.x, cb2[8].x, r0.x, r0.y add r0.yz, |cb2[1].xxzx|, |cb2[4].xxzx| mul r0.yz, r0.yyzy, l(0.000000, 3.39498758, 3.39498758, 0.000000) div r1.xy, l(0.250000, 0.250000, 0.000000, 0.000000), r0.yzyy add r1.zw, -r1.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000) add r2.xy, -r1.xyxx, r1.zwzz mad r2.zw, v0.xxxy, cb1[42].xxxy, -v1.xxxy mad r3.xy, cb2[19].xxxx, r2.zwzz, v1.xyxx mov r3.z, l(1.000000) dp3 r4.x, r3.xyzx, cb2[27].xyzx dp3 r4.y, r3.xyzx, cb2[28].xyzx add r2.zw, -r1.xxxy, r4.xxxy lt r1.xy, r4.xyxx, r1.xyxx div r2.xy, r2.zwzz, r2.xyxx mad r2.xy, r2.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.250000, 0.250000, 0.000000, 0.000000) add r2.zw, -r4.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000) mad r2.zw, -r2.zzzw, r0.yyyz, l(0.000000, 0.000000, 1.000000, 1.000000) mul r0.yz, r0.yyzy, r4.xxyx lt r1.zw, r1.zzzw, r4.xxxy movc r1.zw, r1.zzzw, r2.zzzw, r2.xxxy movc r0.yz, r1.xxyx, r0.yyzy, r1.zzwz lt r0.w, l(0.000000), cb2[16].x movc r0.yz, r0.wwww, r0.yyzy, r4.xxyx mov_sat r1.xy, r0.yzyy ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[12].x movc r0.yz, r0.wwww, r1.xxyx, r0.yyzy add r0.w, cb1[55].x, cb2[26].x add r0.w, r0.w, l(-2.500000) sample_b_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.yzyy, t70.yzwx, s4, r0.w ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[13].x movc r1.xyz, r0.yyyy, r1.wwww, r1.xyzx add r0.y, r0.x, -r1.z mad r0.y, cb2[11].x, r0.y, r1.z add r0.x, -r0.y, r0.x mad_sat r0.x, cb2[10].x, r0.x, r0.y add r0.z, -r0.x, l(1.000000) add r0.w, -cb2[9].x, l(1.000000) add r0.z, -r0.w, r0.z ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[5].x movc r0.w, r0.w, cb2[5].x, l(0.000001) ishl r2.x, v7.x, l(3) ushr r2.x, r2.x, l(2) iadd r2.x, r2.x, cb3[19].y ld_indexable(buffer)(float,float,float,float) r2.x, r2.xxxx, t81.yxzw iadd r2.x, r2.x, l(3) ld_indexable(buffer)(float,float,float,float) r2.xyz, r2.xxxx, t81.xzwy and r2.xzw, r2.yyzx, l(255, 0, 255, 0x0000ffff) ushr r3.xyz, r2.yyyy, l(24, 16, 8, 0) and r3.xyz, r3.xyzx, l(255, 255, 255, 0) utof r3.xyz, r3.xyzx f16tof32 r2.y, r2.w utof r2.xz, r2.xxzx add r0.x, r0.x, -r2.y div_sat r0.xz, r0.xxzx, r0.wwww max r0.x, r0.z, r0.x add r0.x, -r0.x, l(1.000000) add r0.z, v2.w, l(-1.000000) mad r0.z, cb2[6].x, r0.z, l(1.000000) mul r0.y, r0.z, r0.y mul r0.x, r0.y, r0.x mul r0.x, r1.z, r0.x mul r0.yz, v0.xxyx, cb1[42].xxyx sample_l_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t28.yxzw, s0, l(0.000000) mad r0.yz, r0.yyyy, cb1[65].wwzw, cb1[65].yyxy div r0.y, r0.y, r0.z add r0.y, r0.y, -v0.w ge r0.y, r0.y, cb2[18].x and r0.z, r0.y, l(0x3f800000) movc r0.y, r0.y, l(0), cb2[17].x add r0.y, r0.y, r0.z mul r0.x, r0.y, r0.x mad r0.y, v0.y, cb1[42].y, -cb2[24].x ne r0.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[23].x movc r0.z, r0.z, cb2[23].x, l(0.000001) div_sat r0.y, r0.y, r0.z add r0.y, -r0.y, l(1.000000) mad r0.w, v0.y, cb1[42].y, -cb2[22].x div_sat r0.z, r0.w, r0.z min r0.y, r0.y, r0.z add r0.y, r0.y, l(-1.000000) mad r0.y, cb2[7].x, r0.y, l(1.000000) min r0.x, r0.y, r0.x mul r0.y, r2.x, l(0.00392156886) mul r0.y, r0.y, r2.z mul r0.y, r0.y, cb2[25].x mul r0.y, r0.y, l(0.00392156886) mul r0.x, r0.x, r0.y add r2.xyz, -r1.wxyw, l(1.000000, 1.000000, 1.000000, 0.000000) ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[20].x movc r0.yzw, r0.yyyy, r2.xxyz, r1.wwxy mad_sat r1.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000), r0.yzwy mul r2.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000) mad r1.xyz, -r0.yzwy, r2.xyzx, r1.xyzx mul r0.yzw, r0.yyzw, r2.xxyz mad r0.yzw, cb2[21].xxxx, r1.xxyz, r0.yyzw mad r1.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000), -r0.yzwy mad r0.yzw, cb2[13].xxxx, r1.xxyz, r0.yyzw mul r0.yzw, r0.xxxx, r0.yyzw mov o0.w, r0.x sample_l_indexable(texture2d)(float,float,float,float) r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), t20.xyzw, s0, l(0.000000) div r0.xyz, r0.yzwy, r0.xxxx max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000) min r0.xyz, r0.xyzx, l(100000.000000, 100000.000000, 100000.000000, 0.000000) mul o0.xyz, r0.xyzx, cb1[50].xxxx ret // Approximately 117 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code]
bo3b said:
If you are getting glitches, look to see if it is an HLSL Decompiler problem. Use F9 to show_original when it's up, and see if it changes. For properly Decompiled shaders, there should be no visual difference for an unmodified HLSL shader.


I'm supposed to hold F9 in hunting mode right? If I do that then the shader changes back to it's original form.

bo3b said:
Probably for an on/off toggle, you'd want to use the PS instead. It's later in the pipeline, and less likely to damage other visual items when disabled.


Well you mentioned it being harder to fix, so I understand if it's too much work. Just gonna post it incase you or anyone wants to have a whack at it:

000ea4ff144f3d6d-ps_replace.txt(244,37): error X3000: syntax error: unexpected token '.'

// ---- Created with 3Dmigoto v1.2.67 on Wed Nov 15 20:04:45 2017

cbuffer PassParams_cbuffer : register(b1)
{

struct
{
float4 eyePosition;
float4 eyePositionPrevFrame;
float4 eyeDirection;
float4 eyeDirectionPrevFrame;
float4x4 viewToWorld;
float4x4 viewToWorldPrevFrame;
float4x4 worldToView;
float4x4 worldToViewPrevFrame;
float4x4 projMatrix;
float4x4 viewProj;
float4x4 viewNoTranslationProj;
float4x4 viewProjPrevFrame;
float4x4 viewNoTranslationProjPrevFrame;
float4 viewTranslation;
float4 viewTranslationPrevFrame;
float4 vPosToUV;
float4 viewportScaleOffset;
float4 zFrontBackValue;
float4 clipPlane;
float4 frustumPlanes[4];
float4 globalLightingScale;
float4 viewSpaceLightingBackWS;
float4 projectorPosition;
float4 prevProjectorPosition;
float4 pixelPatchingParams;
float gradientAdjustMipBias;
float thinGeomAAPixelScale;
uint layerIndex;
uint globalCubeMapIndex;
uint dynamicGBufferCubeMapIndex;
uint alphaDitherEnabled;
uint TAADitherEnabled;
float CameraTAAFadeStartDist;

struct
{
} materialTable;


struct
{
float4x4 ClipXYZToViewPos;
float4x4 ClipXYZToWorldPos;
float4 ClipZToViewZ;
} RevProjParams;


struct
{
} refraction;


struct
{
} deferredcommon;


struct
{
} motionVector;


struct
{
float4 XYScaleBias;
float4 ForwardMappingParams;
float2 ZProject;
float4 BackwardMappingParams;
float CloudShadowGIDensity;
} combinedCloudShadow;


struct
{
} AmbientLighting;


struct
{
float4 volumeInvTransZ;
float4 volumeTexScale;
float4 volumeTexBias;
float4 sunColor;
float4 sunColorByOneOverPi;
} fog;


struct
{
float3 InvDepthParams;
} underwater;


struct
{
float4 VposToClusterXY;
float4 ClipPosToClusterXY;
float4 ClusterTransZ;
uint HighClusterW;
uint HighClusterWH;
} clusteredLightsEvaluate;


struct
{
} waterStamperTextures;


struct
{
float3 maxCC;
} waterCustomMeshParams;


struct
{
} videoAndScreenshot;


struct
{
} rainRipples;


struct
{
} cookieShadows;


struct
{
} nearShadows;


struct
{
float FarShadowBlendRatio;
} farShadows;


struct
{
} commonShadows;


struct
{
float2 WorldToUVOffset;
float2 WorldToUVScale;
float2 ReferenceWorldXY;
float FadeStart;
float Radius;
} grassForce;

} PassParams_constants : packoffset(c0);

}

cbuffer InstanceParams_cbuffer : register(b3)
{

struct
{
float4x4 world;
float4x4 worldPrevFrame;
float4x4 worldViewProj;
float4x4 worldViewProjPrevFrame;
float4 dissolveFactor;
float LODBlendFactor;
float wetnessBias;
float alphaTestValue;
uint materialTableIndex;
uint instanceOffset;
uint CameraTAADither;

struct
{

struct
{
int4 offsets;
} instanceBatchSetupConsts;

} instancing;

} InstanceParams_constants : packoffset(c0);

}

cbuffer MaterialParams_cbuffer : register(b2)
{

struct
{

struct
{
float4 blendXYAlphaTestTwoSided;
} defaults;

float4 VertexQuadMin_6;
float4 VertexScale_89;
float4 VertexOffset_92;
float4 VertexQuadMax_16;
float4 AlphaClampFallof_2;
float4 UseVertexAlpha_4;
float4 UseScreenAlpha_5;
float4 UseLayer1AlphaGrayScale_7;
float4 AlphaClampMin_9;
float4 AlphaClampIsLayer01Alpha_10;
float4 UseLayer1Alpha_11;
float4 Layer0DiffuseUVIsClamp_13;
float4 Layer0DiffuseIsBC4_14;
float4 Layer1AlphaIsBC4_15;
float4 Layer1AlphaUVIsClamp_17;
float4 Layer0DiffuseIs9SS_18;
float4 OcclusionAlpha_20;
float4 OcclusionAlphaStepValue_21;
float4 Layer0DiffuseIsScreenSpace_22;
float4 Layer0DiffuseIsInvert_23;
float4 Layer0ColorIsAdd_24;
float4 ScreenAlphaTop_25;
float4 ScreenAlphaFallout_26;
float4 ScreenAlphaBottom_27;
float4 AlphaBoost_28;
float4 Mipmap_30;
float3x3 Layer0DiffuseUV_8_matrix;
float3x3 Layer1AlphaUV_12_matrix;
} MaterialParams_constants : packoffset(c0);

}

SamplerState FrameParams_defaultSamplers_pointClamp_s : register(s0);
SamplerState FrameParams_defaultSamplers_standardSampler_s : register(s4);
Texture2D<float4> PassParams_lastExposureTexture : register(t20);
Texture2D<float4> PassParams_deferredcommon_DepthSurface : register(t28);
Texture2D<float4> MaterialParams_srv.Layer0Diffuse_0 : register(t70);
Texture2D<float4> MaterialParams_srv.Layer1Alpha_1 : register(t71);
Buffer<float4> InstanceParams_instancing_instanceData : register(t81);


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


void main(
float4 v0 : SV_Position0,
linear sample float4 v1 : TEXCOORD0,
linear sample float4 v2 : COLOR0,
float4 v3 : TEXCOORD1,
float4 v4 : TEXCOORD2,
float4 v5 : TEXCOORD3,
float4 v6 : TEXCOORD4,
nointerpolation uint v7 : InstanceID0,
uint v8 : SV_IsFrontFace0,
out float4 o0 : SV_Target0)
{
float4 r0,r1,r2,r3,r4;
uint4 bitmask, uiDest;
float4 fDest;

r0.x = cmp(0 != MaterialParams_constants.Layer1AlphaUVIsClamp_17.x);
r1.xy = v1.xy;
r1.z = 1;
r2.x = dot(r1.xyz, MaterialParams_constants.Layer1AlphaUV_12_matrix._m00_m10_m20);
r2.y = dot(r1.xyz, MaterialParams_constants.Layer1AlphaUV_12_matrix._m01_m11_m21);
r0.yz = saturate(r2.xy);
r0.xy = r0.xx ? r0.yz : r2.xy;
r0.z = -2.5 + PassParams_constants.gradientAdjustMipBias;
r0.xyz = MaterialParams_srv.Layer1Alpha_1.SampleBias(FrameParams_defaultSamplers_standardSampler_s, r0.xy, r0.z).xyw;
r0.w = cmp(0 != MaterialParams_constants.Layer1AlphaIsBC4_15.x);
r0.xy = r0.ww ? r0.xx : r0.yz;
r0.x = r0.x + -r0.y;
r0.x = MaterialParams_constants.UseLayer1AlphaGrayScale_7.x * r0.x + r0.y;
r0.yz = abs(MaterialParams_constants.VertexQuadMax_16.xz) + abs(MaterialParams_constants.VertexQuadMin_6.xz);
r0.yz = float2(3.39498758,3.39498758) * r0.yz;
r1.xy = float2(0.25,0.25) / r0.yz;
r1.zw = float2(1,1) + -r1.xy;
r2.xy = r1.zw + -r1.xy;
r2.zw = v0.xy * PassParams_constants.vPosToUV.xy + -v1.xy;
r3.xy = MaterialParams_constants.Layer0DiffuseIsScreenSpace_22.xx * r2.zw + v1.xy;
r3.z = 1;
r4.x = dot(r3.xyz, MaterialParams_constants.Layer0DiffuseUV_8_matrix._m00_m10_m20);
r4.y = dot(r3.xyz, MaterialParams_constants.Layer0DiffuseUV_8_matrix._m01_m11_m21);
r2.zw = r4.xy + -r1.xy;
r1.xy = cmp(r4.xy < r1.xy);
r2.xy = r2.zw / r2.xy;
r2.xy = r2.xy * float2(0.5,0.5) + float2(0.25,0.25);
r2.zw = float2(1,1) + -r4.xy;
r2.zw = -r2.zw * r0.yz + float2(1,1);
r0.yz = r4.xy * r0.yz;
r1.zw = cmp(r1.zw < r4.xy);
r1.zw = r1.zw ? r2.zw : r2.xy;
r0.yz = r1.xy ? r0.yz : r1.zw;
r0.w = cmp(0 < MaterialParams_constants.Layer0DiffuseIs9SS_18.x);
r0.yz = r0.ww ? r0.yz : r4.xy;
r1.xy = saturate(r0.yz);
r0.w = cmp(0 != MaterialParams_constants.Layer0DiffuseUVIsClamp_13.x);
r0.yz = r0.ww ? r1.xy : r0.yz;
r0.w = MaterialParams_constants.Mipmap_30.x + PassParams_constants.gradientAdjustMipBias;
r0.w = -2.5 + r0.w;
r1.xyzw = MaterialParams_srv.Layer0Diffuse_0.SampleBias(FrameParams_defaultSamplers_standardSampler_s, r0.yz, r0.w).yzwx;
r0.y = cmp(0 != MaterialParams_constants.Layer0DiffuseIsBC4_14.x);
r1.xyz = r0.yyy ? r1.www : r1.xyz;
r0.y = -r1.z + r0.x;
r0.y = MaterialParams_constants.UseLayer1Alpha_11.x * r0.y + r1.z;
r0.x = r0.x + -r0.y;
r0.x = saturate(MaterialParams_constants.AlphaClampIsLayer01Alpha_10.x * r0.x + r0.y);
r0.z = 1 + -r0.x;
r0.w = 1 + -MaterialParams_constants.AlphaClampMin_9.x;
r0.z = r0.z + -r0.w;
r0.w = cmp(0 != MaterialParams_constants.AlphaClampFallof_2.x);
r0.w = r0.w ? MaterialParams_constants.AlphaClampFallof_2.x : 9.99999997e-007;
r2.x = (uint)v7.x << 3;
r2.x = (uint)r2.x >> 2;
r2.x = (int)r2.x + (int)InstanceParams_constants.instancing.instanceBatchSetupConsts.offsets.y;
r2.x = InstanceParams_instancing_instanceData.Load(r2.x).y;
r2.x = (int)r2.x + 3;
r2.xyz = InstanceParams_instancing_instanceData.Load(r2.x).xzw;
r2.xzw = (int3)r2.yzx & int3(255,255,0);
r3.xyz = (uint3)r2.yyy >> int3(24,16,8);
r3.xyz = (int3)r3.xyz & int3(255,255,255);
r3.xyz = (uint3)r3.xyz;
r2.y = f16tof32(r2.w);
r2.xz = (uint2)r2.xz;
r0.x = -r2.y + r0.x;
r0.xz = saturate(r0.xz / r0.ww);
r0.x = max(r0.x, r0.z);
r0.x = 1 + -r0.x;
r0.z = -1 + v2.w;
r0.z = MaterialParams_constants.UseVertexAlpha_4.x * r0.z + 1;
r0.y = r0.y * r0.z;
r0.x = r0.x * r0.y;
r0.x = r0.x * r1.z;
r0.yz = PassParams_constants.vPosToUV.xy * v0.xy;
r0.y = PassParams_deferredcommon_DepthSurface.SampleLevel(FrameParams_defaultSamplers_pointClamp_s, r0.yz, 0).x;
r0.yz = r0.yy * PassParams_constants.RevProjParams.ClipZToViewZ.wz + PassParams_constants.RevProjParams.ClipZToViewZ.yx;
r0.y = r0.y / r0.z;
r0.y = -v0.w + r0.y;
r0.y = cmp(r0.y >= MaterialParams_constants.OcclusionAlphaStepValue_21.x);
r0.z = r0.y ? 1.000000 : 0;
r0.y = r0.y ? 0 : MaterialParams_constants.OcclusionAlpha_20.x;
r0.y = r0.z + r0.y;
r0.x = r0.x * r0.y;
r0.y = v0.y * PassParams_constants.vPosToUV.y + -MaterialParams_constants.ScreenAlphaBottom_27.x;
r0.z = cmp(0 != MaterialParams_constants.ScreenAlphaFallout_26.x);
r0.z = r0.z ? MaterialParams_constants.ScreenAlphaFallout_26.x : 9.99999997e-007;
r0.y = saturate(r0.y / r0.z);
r0.y = 1 + -r0.y;
r0.w = v0.y * PassParams_constants.vPosToUV.y + -MaterialParams_constants.ScreenAlphaTop_25.x;
r0.z = saturate(r0.w / r0.z);
r0.y = min(r0.z, r0.y);
r0.y = -1 + r0.y;
r0.y = MaterialParams_constants.UseScreenAlpha_5.x * r0.y + 1;
r0.x = min(r0.x, r0.y);
r0.y = 0.00392156886 * r2.x;
r0.y = r2.z * r0.y;
r0.y = MaterialParams_constants.AlphaBoost_28.x * r0.y;
r0.y = 0.00392156886 * r0.y;
r0.x = r0.y * r0.x;
r2.xyz = float3(1,1,1) + -r1.wxy;
r0.y = cmp(0 != MaterialParams_constants.Layer0DiffuseIsInvert_23.x);
r0.yzw = r0.yyy ? r2.xyz : r1.wxy;
r1.xyz = saturate(r3.xyz * float3(0.00392156886,0.00392156886,0.00392156886) + r0.yzw);
r2.xyz = float3(0.00392156886,0.00392156886,0.00392156886) * r3.xyz;
r1.xyz = -r0.yzw * r2.xyz + r1.xyz;
r0.yzw = r2.xyz * r0.yzw;
r0.yzw = MaterialParams_constants.Layer0ColorIsAdd_24.xxx * r1.xyz + r0.yzw;
r1.xyz = r3.xyz * float3(0.00392156886,0.00392156886,0.00392156886) + -r0.yzw;
r0.yzw = MaterialParams_constants.Layer0DiffuseIsBC4_14.xxx * r1.xyz + r0.yzw;
r0.yzw = r0.yzw * r0.xxx;
o0.w = r0.x;
r0.x = PassParams_lastExposureTexture.SampleLevel(FrameParams_defaultSamplers_pointClamp_s, float2(0,0), 0).x;
r0.xyz = r0.yzw / r0.xxx;
r0.xyz = max(float3(0,0,0), r0.xyz);
r0.xyz = min(float3(100000,100000,100000), r0.xyz);
o0.xyz = PassParams_constants.globalLightingScale.xxx * r0.xyz;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
// using 3Dmigoto v1.2.67 on Wed Nov 15 20:04:45 2017
//
//
// Buffer Definitions:
//
// cbuffer PassParams_cbuffer
// {
//
// struct PassParams_Constants
// {
//
// float4 eyePosition; // Offset: 0
// float4 eyePositionPrevFrame; // Offset: 16
// float4 eyeDirection; // Offset: 32
// float4 eyeDirectionPrevFrame; // Offset: 48
// float4x4 viewToWorld; // Offset: 64
// float4x4 viewToWorldPrevFrame; // Offset: 128
// float4x4 worldToView; // Offset: 192
// float4x4 worldToViewPrevFrame; // Offset: 256
// float4x4 projMatrix; // Offset: 320
// float4x4 viewProj; // Offset: 384
// float4x4 viewNoTranslationProj;// Offset: 448
// float4x4 viewProjPrevFrame; // Offset: 512
// float4x4 viewNoTranslationProjPrevFrame;// Offset: 576
// float4 viewTranslation; // Offset: 640
// float4 viewTranslationPrevFrame;// Offset: 656
// float4 vPosToUV; // Offset: 672
// float4 viewportScaleOffset; // Offset: 688
// float4 zFrontBackValue; // Offset: 704
// float4 clipPlane; // Offset: 720
// float4 frustumPlanes[4]; // Offset: 736
// float4 globalLightingScale; // Offset: 800
// float4 viewSpaceLightingBackWS;// Offset: 816
// float4 projectorPosition; // Offset: 832
// float4 prevProjectorPosition; // Offset: 848
// float4 pixelPatchingParams; // Offset: 864
// float gradientAdjustMipBias; // Offset: 880
// float thinGeomAAPixelScale; // Offset: 884
// uint layerIndex; // Offset: 888
// uint globalCubeMapIndex; // Offset: 892
// uint dynamicGBufferCubeMapIndex;// Offset: 896
// uint alphaDitherEnabled; // Offset: 900
// uint TAADitherEnabled; // Offset: 904
// float CameraTAAFadeStartDist; // Offset: 908
//
// struct MaterialTable_Constants
// {
//
// } materialTable; // Offset: 4294967292
//
// struct ReverseProjParams_Constants
// {
//
// float4x4 ClipXYZToViewPos; // Offset: 912
// float4x4 ClipXYZToWorldPos;// Offset: 976
// float4 ClipZToViewZ; // Offset: 1040
//
// } RevProjParams; // Offset: 912
//
// struct RefractionParams_Constants
// {
//
// } refraction; // Offset: 4294967292
//
// struct DeferredCommonParams_Constants
// {
//
// } deferredcommon; // Offset: 4294967292
//
// struct MotionVectorParams_Constants
// {
//
// } motionVector; // Offset: 4294967292
//
// struct CombinedCloudShadow_Constants
// {
//
// float4 XYScaleBias; // Offset: 1056
// float4 ForwardMappingParams;// Offset: 1072
// float2 ZProject; // Offset: 1088
// float4 BackwardMappingParams;// Offset: 1104
// float CloudShadowGIDensity;// Offset: 1120
//
// } combinedCloudShadow; // Offset: 1056
//
// struct AmbientLightingParams_Constants
// {
//
// } AmbientLighting; // Offset: 4294967292
//
// struct VolumetricFogParams_Constants
// {
//
// float4 volumeInvTransZ; // Offset: 1136
// float4 volumeTexScale; // Offset: 1152
// float4 volumeTexBias; // Offset: 1168
// float4 sunColor; // Offset: 1184
// float4 sunColorByOneOverPi;// Offset: 1200
//
// } fog; // Offset: 1136
//
// struct UnderwaterLightingParams_Constants
// {
//
// float3 InvDepthParams; // Offset: 1216
//
// } underwater; // Offset: 1216
//
// struct ClusteredLightsEvaluateParams_Constants
// {
//
// float4 VposToClusterXY; // Offset: 1232
// float4 ClipPosToClusterXY; // Offset: 1248
// float4 ClusterTransZ; // Offset: 1264
// uint HighClusterW; // Offset: 1280
// uint HighClusterWH; // Offset: 1284
//
// } clusteredLightsEvaluate; // Offset: 1232
//
// struct WaterStamperTextureParams_Constants
// {
//
// } waterStamperTextures; // Offset: 4294967292
//
// struct WaterCustomMeshParams_Constants
// {
//
// float3 maxCC; // Offset: 1296
//
// } waterCustomMeshParams; // Offset: 1296
//
// struct VideoAndScreenshotParams_Constants
// {
//
// } videoAndScreenshot; // Offset: 4294967292
//
// struct RainRipplesParams_Constants
// {
//
// } rainRipples; // Offset: 4294967292
//
// struct CookieShadowParams_Constants
// {
//
// } cookieShadows; // Offset: 4294967292
//
// struct NearShadowParams_Constants
// {
//
// } nearShadows; // Offset: 4294967292
//
// struct FarShadowParams_Constants
// {
//
// float FarShadowBlendRatio; // Offset: 1312
//
// } farShadows; // Offset: 1312
//
// struct CommonShadowParams_Constants
// {
//
// } commonShadows; // Offset: 4294967292
//
// struct GrassForceSamplingParams_Constants
// {
//
// float2 WorldToUVOffset; // Offset: 1328
// float2 WorldToUVScale; // Offset: 1336
// float2 ReferenceWorldXY; // Offset: 1344
// float FadeStart; // Offset: 1352
// float Radius; // Offset: 1356
//
// } grassForce; // Offset: 1328
//
// } PassParams_constants; // Offset: 0 Size: 1360
//
// }
//
// cbuffer InstanceParams_cbuffer
// {
//
// struct InstanceParams_Constants
// {
//
// float4x4 world; // Offset: 0
// float4x4 worldPrevFrame; // Offset: 64
// float4x4 worldViewProj; // Offset: 128
// float4x4 worldViewProjPrevFrame;// Offset: 192
// float4 dissolveFactor; // Offset: 256
// float LODBlendFactor; // Offset: 272
// float wetnessBias; // Offset: 276
// float alphaTestValue; // Offset: 280
// uint materialTableIndex; // Offset: 284
// uint instanceOffset; // Offset: 288
// uint CameraTAADither; // Offset: 292
//
// struct InstancingParams_Constants
// {
//
// struct InstanceBatchSetupConsts_Constants
// {
//
// int4 offsets; // Offset: 304
//
// } instanceBatchSetupConsts;// Offset: 304
//
// } instancing; // Offset: 304
//
// } InstanceParams_constants; // Offset: 0 Size: 320
//
// }
//
// cbuffer MaterialParams_cbuffer
// {
//
// struct MaterialParams_Constants
// {
//
// struct DefaultMaterialConsts
// {
//
// float4 blendXYAlphaTestTwoSided;// Offset: 0
//
// } defaults; // Offset: 0
// float4 VertexQuadMin_6; // Offset: 16
// float4 VertexScale_89; // Offset: 32
// float4 VertexOffset_92; // Offset: 48
// float4 VertexQuadMax_16; // Offset: 64
// float4 AlphaClampFallof_2; // Offset: 80
// float4 UseVertexAlpha_4; // Offset: 96
// float4 UseScreenAlpha_5; // Offset: 112
// float4 UseLayer1AlphaGrayScale_7;// Offset: 128
// float4 AlphaClampMin_9; // Offset: 144
// float4 AlphaClampIsLayer01Alpha_10;// Offset: 160
// float4 UseLayer1Alpha_11; // Offset: 176
// float4 Layer0DiffuseUVIsClamp_13;// Offset: 192
// float4 Layer0DiffuseIsBC4_14; // Offset: 208
// float4 Layer1AlphaIsBC4_15; // Offset: 224
// float4 Layer1AlphaUVIsClamp_17;// Offset: 240
// float4 Layer0DiffuseIs9SS_18; // Offset: 256
// float4 OcclusionAlpha_20; // Offset: 272
// float4 OcclusionAlphaStepValue_21;// Offset: 288
// float4 Layer0DiffuseIsScreenSpace_22;// Offset: 304
// float4 Layer0DiffuseIsInvert_23;// Offset: 320
// float4 Layer0ColorIsAdd_24; // Offset: 336
// float4 ScreenAlphaTop_25; // Offset: 352
// float4 ScreenAlphaFallout_26; // Offset: 368
// float4 ScreenAlphaBottom_27; // Offset: 384
// float4 AlphaBoost_28; // Offset: 400
// float4 Mipmap_30; // Offset: 416
// float3x3 Layer0DiffuseUV_8_matrix;// Offset: 432
// float3x3 Layer1AlphaUV_12_matrix;// Offset: 480
//
// } MaterialParams_constants; // Offset: 0 Size: 524
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// FrameParams_defaultSamplers_pointClamp sampler NA NA 0 1
// FrameParams_defaultSamplers_standardSampler sampler NA NA 4 1
// PassParams_lastExposureTexture texture float4 2d 20 1
// PassParams_deferredcommon_DepthSurface texture float4 2d 28 1
// MaterialParams_srv.Layer0Diffuse_0 texture float4 2d 70 1
// MaterialParams_srv.Layer1Alpha_1 texture float4 2d 71 1
// InstanceParams_instancing_instanceData texture float4 buf 81 1
// PassParams_cbuffer cbuffer NA NA 1 1
// MaterialParams_cbuffer cbuffer NA NA 2 1
// InstanceParams_cbuffer cbuffer NA NA 3 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float xy w
// TEXCOORD 0 xyzw 1 NONE float xy
// COLOR 0 xyzw 2 NONE float w
// TEXCOORD 1 xyzw 3 NONE float
// TEXCOORD 2 xyzw 4 NONE float
// TEXCOORD 3 xyzw 5 NONE float
// TEXCOORD 4 xyzw 6 NONE float
// InstanceID 0 x 7 NONE uint x
// SV_IsFrontFace 0 x 8 FFACE uint
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
// Pixel Shader runs at sample frequency
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[66], immediateIndexed
dcl_constantbuffer cb3[20], immediateIndexed
dcl_constantbuffer cb2[32], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s4, mode_default
dcl_resource_texture2d (float,float,float,float) t20
dcl_resource_texture2d (float,float,float,float) t28
dcl_resource_texture2d (float,float,float,float) t70
dcl_resource_texture2d (float,float,float,float) t71
dcl_resource_buffer (float,float,float,float) t81
dcl_input_ps_siv linear noperspective sample v0.xyw, position
dcl_input_ps linear sample v1.xy
dcl_input_ps linear sample v2.w
dcl_input_ps constant v7.x
dcl_output o0.xyzw
dcl_temps 5
ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[15].x
mov r1.xy, v1.xyxx
mov r1.z, l(1.000000)
dp3 r2.x, r1.xyzx, cb2[30].xyzx
dp3 r2.y, r1.xyzx, cb2[31].xyzx
mov_sat r0.yz, r2.xxyx
movc r0.xy, r0.xxxx, r0.yzyy, r2.xyxx
add r0.z, cb1[55].x, l(-2.500000)
sample_b_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t71.xywz, s4, r0.z
ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[14].x
movc r0.xy, r0.wwww, r0.xxxx, r0.yzyy
add r0.x, -r0.y, r0.x
mad r0.x, cb2[8].x, r0.x, r0.y
add r0.yz, |cb2[1].xxzx|, |cb2[4].xxzx|
mul r0.yz, r0.yyzy, l(0.000000, 3.39498758, 3.39498758, 0.000000)
div r1.xy, l(0.250000, 0.250000, 0.000000, 0.000000), r0.yzyy
add r1.zw, -r1.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000)
add r2.xy, -r1.xyxx, r1.zwzz
mad r2.zw, v0.xxxy, cb1[42].xxxy, -v1.xxxy
mad r3.xy, cb2[19].xxxx, r2.zwzz, v1.xyxx
mov r3.z, l(1.000000)
dp3 r4.x, r3.xyzx, cb2[27].xyzx
dp3 r4.y, r3.xyzx, cb2[28].xyzx
add r2.zw, -r1.xxxy, r4.xxxy
lt r1.xy, r4.xyxx, r1.xyxx
div r2.xy, r2.zwzz, r2.xyxx
mad r2.xy, r2.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.250000, 0.250000, 0.000000, 0.000000)
add r2.zw, -r4.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000)
mad r2.zw, -r2.zzzw, r0.yyyz, l(0.000000, 0.000000, 1.000000, 1.000000)
mul r0.yz, r0.yyzy, r4.xxyx
lt r1.zw, r1.zzzw, r4.xxxy
movc r1.zw, r1.zzzw, r2.zzzw, r2.xxxy
movc r0.yz, r1.xxyx, r0.yyzy, r1.zzwz
lt r0.w, l(0.000000), cb2[16].x
movc r0.yz, r0.wwww, r0.yyzy, r4.xxyx
mov_sat r1.xy, r0.yzyy
ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[12].x
movc r0.yz, r0.wwww, r1.xxyx, r0.yyzy
add r0.w, cb1[55].x, cb2[26].x
add r0.w, r0.w, l(-2.500000)
sample_b_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.yzyy, t70.yzwx, s4, r0.w
ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[13].x
movc r1.xyz, r0.yyyy, r1.wwww, r1.xyzx
add r0.y, r0.x, -r1.z
mad r0.y, cb2[11].x, r0.y, r1.z
add r0.x, -r0.y, r0.x
mad_sat r0.x, cb2[10].x, r0.x, r0.y
add r0.z, -r0.x, l(1.000000)
add r0.w, -cb2[9].x, l(1.000000)
add r0.z, -r0.w, r0.z
ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[5].x
movc r0.w, r0.w, cb2[5].x, l(0.000001)
ishl r2.x, v7.x, l(3)
ushr r2.x, r2.x, l(2)
iadd r2.x, r2.x, cb3[19].y
ld_indexable(buffer)(float,float,float,float) r2.x, r2.xxxx, t81.yxzw
iadd r2.x, r2.x, l(3)
ld_indexable(buffer)(float,float,float,float) r2.xyz, r2.xxxx, t81.xzwy
and r2.xzw, r2.yyzx, l(255, 0, 255, 0x0000ffff)
ushr r3.xyz, r2.yyyy, l(24, 16, 8, 0)
and r3.xyz, r3.xyzx, l(255, 255, 255, 0)
utof r3.xyz, r3.xyzx
f16tof32 r2.y, r2.w
utof r2.xz, r2.xxzx
add r0.x, r0.x, -r2.y
div_sat r0.xz, r0.xxzx, r0.wwww
max r0.x, r0.z, r0.x
add r0.x, -r0.x, l(1.000000)
add r0.z, v2.w, l(-1.000000)
mad r0.z, cb2[6].x, r0.z, l(1.000000)
mul r0.y, r0.z, r0.y
mul r0.x, r0.y, r0.x
mul r0.x, r1.z, r0.x
mul r0.yz, v0.xxyx, cb1[42].xxyx
sample_l_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t28.yxzw, s0, l(0.000000)
mad r0.yz, r0.yyyy, cb1[65].wwzw, cb1[65].yyxy
div r0.y, r0.y, r0.z
add r0.y, r0.y, -v0.w
ge r0.y, r0.y, cb2[18].x
and r0.z, r0.y, l(0x3f800000)
movc r0.y, r0.y, l(0), cb2[17].x
add r0.y, r0.y, r0.z
mul r0.x, r0.y, r0.x
mad r0.y, v0.y, cb1[42].y, -cb2[24].x
ne r0.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[23].x
movc r0.z, r0.z, cb2[23].x, l(0.000001)
div_sat r0.y, r0.y, r0.z
add r0.y, -r0.y, l(1.000000)
mad r0.w, v0.y, cb1[42].y, -cb2[22].x
div_sat r0.z, r0.w, r0.z
min r0.y, r0.y, r0.z
add r0.y, r0.y, l(-1.000000)
mad r0.y, cb2[7].x, r0.y, l(1.000000)
min r0.x, r0.y, r0.x
mul r0.y, r2.x, l(0.00392156886)
mul r0.y, r0.y, r2.z
mul r0.y, r0.y, cb2[25].x
mul r0.y, r0.y, l(0.00392156886)
mul r0.x, r0.x, r0.y
add r2.xyz, -r1.wxyw, l(1.000000, 1.000000, 1.000000, 0.000000)
ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[20].x
movc r0.yzw, r0.yyyy, r2.xxyz, r1.wwxy
mad_sat r1.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000), r0.yzwy
mul r2.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000)
mad r1.xyz, -r0.yzwy, r2.xyzx, r1.xyzx
mul r0.yzw, r0.yyzw, r2.xxyz
mad r0.yzw, cb2[21].xxxx, r1.xxyz, r0.yyzw
mad r1.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000), -r0.yzwy
mad r0.yzw, cb2[13].xxxx, r1.xxyz, r0.yyzw
mul r0.yzw, r0.xxxx, r0.yyzw
mov o0.w, r0.x
sample_l_indexable(texture2d)(float,float,float,float) r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), t20.xyzw, s0, l(0.000000)
div r0.xyz, r0.yzwy, r0.xxxx
max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
min r0.xyz, r0.xyzx, l(100000.000000, 100000.000000, 100000.000000, 0.000000)
mul o0.xyz, r0.xyzx, cb1[50].xxxx
ret
// Approximately 117 instruction slots used

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

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

Posted 11/15/2017 07:36 PM   
File name: 000ea4ff144f3d6d-ps.txt [code] // ---- Created with 3Dmigoto v1.2.67 on Wed Nov 15 20:04:45 2017 // // Generated by Microsoft (R) HLSL Shader Compiler 10.1 // // using 3Dmigoto v1.2.67 on Wed Nov 15 20:04:45 2017 // // // Buffer Definitions: // // cbuffer PassParams_cbuffer // { // // struct PassParams_Constants // { // // float4 eyePosition; // Offset: 0 // float4 eyePositionPrevFrame; // Offset: 16 // float4 eyeDirection; // Offset: 32 // float4 eyeDirectionPrevFrame; // Offset: 48 // float4x4 viewToWorld; // Offset: 64 // float4x4 viewToWorldPrevFrame; // Offset: 128 // float4x4 worldToView; // Offset: 192 // float4x4 worldToViewPrevFrame; // Offset: 256 // float4x4 projMatrix; // Offset: 320 // float4x4 viewProj; // Offset: 384 // float4x4 viewNoTranslationProj;// Offset: 448 // float4x4 viewProjPrevFrame; // Offset: 512 // float4x4 viewNoTranslationProjPrevFrame;// Offset: 576 // float4 viewTranslation; // Offset: 640 // float4 viewTranslationPrevFrame;// Offset: 656 // float4 vPosToUV; // Offset: 672 // float4 viewportScaleOffset; // Offset: 688 // float4 zFrontBackValue; // Offset: 704 // float4 clipPlane; // Offset: 720 // float4 frustumPlanes[4]; // Offset: 736 // float4 globalLightingScale; // Offset: 800 // float4 viewSpaceLightingBackWS;// Offset: 816 // float4 projectorPosition; // Offset: 832 // float4 prevProjectorPosition; // Offset: 848 // float4 pixelPatchingParams; // Offset: 864 // float gradientAdjustMipBias; // Offset: 880 // float thinGeomAAPixelScale; // Offset: 884 // uint layerIndex; // Offset: 888 // uint globalCubeMapIndex; // Offset: 892 // uint dynamicGBufferCubeMapIndex;// Offset: 896 // uint alphaDitherEnabled; // Offset: 900 // uint TAADitherEnabled; // Offset: 904 // float CameraTAAFadeStartDist; // Offset: 908 // // struct MaterialTable_Constants // { // // } materialTable; // Offset: 4294967292 // // struct ReverseProjParams_Constants // { // // float4x4 ClipXYZToViewPos; // Offset: 912 // float4x4 ClipXYZToWorldPos;// Offset: 976 // float4 ClipZToViewZ; // Offset: 1040 // // } RevProjParams; // Offset: 912 // // struct RefractionParams_Constants // { // // } refraction; // Offset: 4294967292 // // struct DeferredCommonParams_Constants // { // // } deferredcommon; // Offset: 4294967292 // // struct MotionVectorParams_Constants // { // // } motionVector; // Offset: 4294967292 // // struct CombinedCloudShadow_Constants // { // // float4 XYScaleBias; // Offset: 1056 // float4 ForwardMappingParams;// Offset: 1072 // float2 ZProject; // Offset: 1088 // float4 BackwardMappingParams;// Offset: 1104 // float CloudShadowGIDensity;// Offset: 1120 // // } combinedCloudShadow; // Offset: 1056 // // struct AmbientLightingParams_Constants // { // // } AmbientLighting; // Offset: 4294967292 // // struct VolumetricFogParams_Constants // { // // float4 volumeInvTransZ; // Offset: 1136 // float4 volumeTexScale; // Offset: 1152 // float4 volumeTexBias; // Offset: 1168 // float4 sunColor; // Offset: 1184 // float4 sunColorByOneOverPi;// Offset: 1200 // // } fog; // Offset: 1136 // // struct UnderwaterLightingParams_Constants // { // // float3 InvDepthParams; // Offset: 1216 // // } underwater; // Offset: 1216 // // struct ClusteredLightsEvaluateParams_Constants // { // // float4 VposToClusterXY; // Offset: 1232 // float4 ClipPosToClusterXY; // Offset: 1248 // float4 ClusterTransZ; // Offset: 1264 // uint HighClusterW; // Offset: 1280 // uint HighClusterWH; // Offset: 1284 // // } clusteredLightsEvaluate; // Offset: 1232 // // struct WaterStamperTextureParams_Constants // { // // } waterStamperTextures; // Offset: 4294967292 // // struct WaterCustomMeshParams_Constants // { // // float3 maxCC; // Offset: 1296 // // } waterCustomMeshParams; // Offset: 1296 // // struct VideoAndScreenshotParams_Constants // { // // } videoAndScreenshot; // Offset: 4294967292 // // struct RainRipplesParams_Constants // { // // } rainRipples; // Offset: 4294967292 // // struct CookieShadowParams_Constants // { // // } cookieShadows; // Offset: 4294967292 // // struct NearShadowParams_Constants // { // // } nearShadows; // Offset: 4294967292 // // struct FarShadowParams_Constants // { // // float FarShadowBlendRatio; // Offset: 1312 // // } farShadows; // Offset: 1312 // // struct CommonShadowParams_Constants // { // // } commonShadows; // Offset: 4294967292 // // struct GrassForceSamplingParams_Constants // { // // float2 WorldToUVOffset; // Offset: 1328 // float2 WorldToUVScale; // Offset: 1336 // float2 ReferenceWorldXY; // Offset: 1344 // float FadeStart; // Offset: 1352 // float Radius; // Offset: 1356 // // } grassForce; // Offset: 1328 // // } PassParams_constants; // Offset: 0 Size: 1360 // // } // // cbuffer InstanceParams_cbuffer // { // // struct InstanceParams_Constants // { // // float4x4 world; // Offset: 0 // float4x4 worldPrevFrame; // Offset: 64 // float4x4 worldViewProj; // Offset: 128 // float4x4 worldViewProjPrevFrame;// Offset: 192 // float4 dissolveFactor; // Offset: 256 // float LODBlendFactor; // Offset: 272 // float wetnessBias; // Offset: 276 // float alphaTestValue; // Offset: 280 // uint materialTableIndex; // Offset: 284 // uint instanceOffset; // Offset: 288 // uint CameraTAADither; // Offset: 292 // // struct InstancingParams_Constants // { // // struct InstanceBatchSetupConsts_Constants // { // // int4 offsets; // Offset: 304 // // } instanceBatchSetupConsts;// Offset: 304 // // } instancing; // Offset: 304 // // } InstanceParams_constants; // Offset: 0 Size: 320 // // } // // cbuffer MaterialParams_cbuffer // { // // struct MaterialParams_Constants // { // // struct DefaultMaterialConsts // { // // float4 blendXYAlphaTestTwoSided;// Offset: 0 // // } defaults; // Offset: 0 // float4 VertexQuadMin_6; // Offset: 16 // float4 VertexScale_89; // Offset: 32 // float4 VertexOffset_92; // Offset: 48 // float4 VertexQuadMax_16; // Offset: 64 // float4 AlphaClampFallof_2; // Offset: 80 // float4 UseVertexAlpha_4; // Offset: 96 // float4 UseScreenAlpha_5; // Offset: 112 // float4 UseLayer1AlphaGrayScale_7;// Offset: 128 // float4 AlphaClampMin_9; // Offset: 144 // float4 AlphaClampIsLayer01Alpha_10;// Offset: 160 // float4 UseLayer1Alpha_11; // Offset: 176 // float4 Layer0DiffuseUVIsClamp_13;// Offset: 192 // float4 Layer0DiffuseIsBC4_14; // Offset: 208 // float4 Layer1AlphaIsBC4_15; // Offset: 224 // float4 Layer1AlphaUVIsClamp_17;// Offset: 240 // float4 Layer0DiffuseIs9SS_18; // Offset: 256 // float4 OcclusionAlpha_20; // Offset: 272 // float4 OcclusionAlphaStepValue_21;// Offset: 288 // float4 Layer0DiffuseIsScreenSpace_22;// Offset: 304 // float4 Layer0DiffuseIsInvert_23;// Offset: 320 // float4 Layer0ColorIsAdd_24; // Offset: 336 // float4 ScreenAlphaTop_25; // Offset: 352 // float4 ScreenAlphaFallout_26; // Offset: 368 // float4 ScreenAlphaBottom_27; // Offset: 384 // float4 AlphaBoost_28; // Offset: 400 // float4 Mipmap_30; // Offset: 416 // float3x3 Layer0DiffuseUV_8_matrix;// Offset: 432 // float3x3 Layer1AlphaUV_12_matrix;// Offset: 480 // // } MaterialParams_constants; // Offset: 0 Size: 524 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // FrameParams_defaultSamplers_pointClamp sampler NA NA 0 1 // FrameParams_defaultSamplers_standardSampler sampler NA NA 4 1 // PassParams_lastExposureTexture texture float4 2d 20 1 // PassParams_deferredcommon_DepthSurface texture float4 2d 28 1 // MaterialParams_srv.Layer0Diffuse_0 texture float4 2d 70 1 // MaterialParams_srv.Layer1Alpha_1 texture float4 2d 71 1 // InstanceParams_instancing_instanceData texture float4 buf 81 1 // PassParams_cbuffer cbuffer NA NA 1 1 // MaterialParams_cbuffer cbuffer NA NA 2 1 // InstanceParams_cbuffer cbuffer NA NA 3 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float xy w // TEXCOORD 0 xyzw 1 NONE float xy // COLOR 0 xyzw 2 NONE float w // TEXCOORD 1 xyzw 3 NONE float // TEXCOORD 2 xyzw 4 NONE float // TEXCOORD 3 xyzw 5 NONE float // TEXCOORD 4 xyzw 6 NONE float // InstanceID 0 x 7 NONE uint x // SV_IsFrontFace 0 x 8 FFACE uint // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Target 0 xyzw 0 TARGET float xyzw // // Pixel Shader runs at sample frequency // ps_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb1[66], immediateIndexed dcl_constantbuffer cb3[20], immediateIndexed dcl_constantbuffer cb2[32], immediateIndexed dcl_sampler s0, mode_default dcl_sampler s4, mode_default dcl_resource_texture2d (float,float,float,float) t20 dcl_resource_texture2d (float,float,float,float) t28 dcl_resource_texture2d (float,float,float,float) t70 dcl_resource_texture2d (float,float,float,float) t71 dcl_resource_buffer (float,float,float,float) t81 dcl_input_ps_siv linear noperspective sample v0.xyw, position dcl_input_ps linear sample v1.xy dcl_input_ps linear sample v2.w dcl_input_ps constant v7.x dcl_output o0.xyzw dcl_temps 5 //IniParams: dcl_resource_texture1d (float,float,float,float) t120 ld_indexable(texture1d)(float,float,float,float) r28.xyzw, l(0, 0, 0, 0), t120.xyzw if_z r28.x mov o0.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000) endif ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[15].x mov r1.xy, v1.xyxx mov r1.z, l(1.000000) dp3 r2.x, r1.xyzx, cb2[30].xyzx dp3 r2.y, r1.xyzx, cb2[31].xyzx mov_sat r0.yz, r2.xxyx movc r0.xy, r0.xxxx, r0.yzyy, r2.xyxx add r0.z, cb1[55].x, l(-2.500000) sample_b_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t71.xywz, s4, r0.z ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[14].x movc r0.xy, r0.wwww, r0.xxxx, r0.yzyy add r0.x, -r0.y, r0.x mad r0.x, cb2[8].x, r0.x, r0.y add r0.yz, |cb2[1].xxzx|, |cb2[4].xxzx| mul r0.yz, r0.yyzy, l(0.000000, 3.39498758, 3.39498758, 0.000000) div r1.xy, l(0.250000, 0.250000, 0.000000, 0.000000), r0.yzyy add r1.zw, -r1.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000) add r2.xy, -r1.xyxx, r1.zwzz mad r2.zw, v0.xxxy, cb1[42].xxxy, -v1.xxxy mad r3.xy, cb2[19].xxxx, r2.zwzz, v1.xyxx mov r3.z, l(1.000000) dp3 r4.x, r3.xyzx, cb2[27].xyzx dp3 r4.y, r3.xyzx, cb2[28].xyzx add r2.zw, -r1.xxxy, r4.xxxy lt r1.xy, r4.xyxx, r1.xyxx div r2.xy, r2.zwzz, r2.xyxx mad r2.xy, r2.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.250000, 0.250000, 0.000000, 0.000000) add r2.zw, -r4.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000) mad r2.zw, -r2.zzzw, r0.yyyz, l(0.000000, 0.000000, 1.000000, 1.000000) mul r0.yz, r0.yyzy, r4.xxyx lt r1.zw, r1.zzzw, r4.xxxy movc r1.zw, r1.zzzw, r2.zzzw, r2.xxxy movc r0.yz, r1.xxyx, r0.yyzy, r1.zzwz lt r0.w, l(0.000000), cb2[16].x movc r0.yz, r0.wwww, r0.yyzy, r4.xxyx mov_sat r1.xy, r0.yzyy ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[12].x movc r0.yz, r0.wwww, r1.xxyx, r0.yyzy add r0.w, cb1[55].x, cb2[26].x add r0.w, r0.w, l(-2.500000) sample_b_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.yzyy, t70.yzwx, s4, r0.w ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[13].x movc r1.xyz, r0.yyyy, r1.wwww, r1.xyzx add r0.y, r0.x, -r1.z mad r0.y, cb2[11].x, r0.y, r1.z add r0.x, -r0.y, r0.x mad_sat r0.x, cb2[10].x, r0.x, r0.y add r0.z, -r0.x, l(1.000000) add r0.w, -cb2[9].x, l(1.000000) add r0.z, -r0.w, r0.z ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[5].x movc r0.w, r0.w, cb2[5].x, l(0.000001) ishl r2.x, v7.x, l(3) ushr r2.x, r2.x, l(2) iadd r2.x, r2.x, cb3[19].y ld_indexable(buffer)(float,float,float,float) r2.x, r2.xxxx, t81.yxzw iadd r2.x, r2.x, l(3) ld_indexable(buffer)(float,float,float,float) r2.xyz, r2.xxxx, t81.xzwy and r2.xzw, r2.yyzx, l(255, 0, 255, 0x0000ffff) ushr r3.xyz, r2.yyyy, l(24, 16, 8, 0) and r3.xyz, r3.xyzx, l(255, 255, 255, 0) utof r3.xyz, r3.xyzx f16tof32 r2.y, r2.w utof r2.xz, r2.xxzx add r0.x, r0.x, -r2.y div_sat r0.xz, r0.xxzx, r0.wwww max r0.x, r0.z, r0.x add r0.x, -r0.x, l(1.000000) add r0.z, v2.w, l(-1.000000) mad r0.z, cb2[6].x, r0.z, l(1.000000) mul r0.y, r0.z, r0.y mul r0.x, r0.y, r0.x mul r0.x, r1.z, r0.x mul r0.yz, v0.xxyx, cb1[42].xxyx sample_l_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t28.yxzw, s0, l(0.000000) mad r0.yz, r0.yyyy, cb1[65].wwzw, cb1[65].yyxy div r0.y, r0.y, r0.z add r0.y, r0.y, -v0.w ge r0.y, r0.y, cb2[18].x and r0.z, r0.y, l(0x3f800000) movc r0.y, r0.y, l(0), cb2[17].x add r0.y, r0.y, r0.z mul r0.x, r0.y, r0.x mad r0.y, v0.y, cb1[42].y, -cb2[24].x ne r0.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[23].x movc r0.z, r0.z, cb2[23].x, l(0.000001) div_sat r0.y, r0.y, r0.z add r0.y, -r0.y, l(1.000000) mad r0.w, v0.y, cb1[42].y, -cb2[22].x div_sat r0.z, r0.w, r0.z min r0.y, r0.y, r0.z add r0.y, r0.y, l(-1.000000) mad r0.y, cb2[7].x, r0.y, l(1.000000) min r0.x, r0.y, r0.x mul r0.y, r2.x, l(0.00392156886) mul r0.y, r0.y, r2.z mul r0.y, r0.y, cb2[25].x mul r0.y, r0.y, l(0.00392156886) mul r0.x, r0.x, r0.y add r2.xyz, -r1.wxyw, l(1.000000, 1.000000, 1.000000, 0.000000) ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[20].x movc r0.yzw, r0.yyyy, r2.xxyz, r1.wwxy mad_sat r1.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000), r0.yzwy mul r2.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000) mad r1.xyz, -r0.yzwy, r2.xyzx, r1.xyzx mul r0.yzw, r0.yyzw, r2.xxyz mad r0.yzw, cb2[21].xxxx, r1.xxyz, r0.yyzw mad r1.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000), -r0.yzwy mad r0.yzw, cb2[13].xxxx, r1.xxyz, r0.yyzw mul r0.yzw, r0.xxxx, r0.yyzw mov o0.w, r0.x sample_l_indexable(texture2d)(float,float,float,float) r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), t20.xyzw, s0, l(0.000000) div r0.xyz, r0.yzwy, r0.xxxx max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000) min r0.xyz, r0.xyzx, l(100000.000000, 100000.000000, 100000.000000, 0.000000) mul o0.xyz, r0.xyzx, cb1[50].xxxx ret // Approximately 117 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code] I did it the way you had it. If x==0, it disables the HUD.
File name: 000ea4ff144f3d6d-ps.txt

// ---- Created with 3Dmigoto v1.2.67 on Wed Nov 15 20:04:45 2017
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
// using 3Dmigoto v1.2.67 on Wed Nov 15 20:04:45 2017
//
//
// Buffer Definitions:
//
// cbuffer PassParams_cbuffer
// {
//
// struct PassParams_Constants
// {
//
// float4 eyePosition; // Offset: 0
// float4 eyePositionPrevFrame; // Offset: 16
// float4 eyeDirection; // Offset: 32
// float4 eyeDirectionPrevFrame; // Offset: 48
// float4x4 viewToWorld; // Offset: 64
// float4x4 viewToWorldPrevFrame; // Offset: 128
// float4x4 worldToView; // Offset: 192
// float4x4 worldToViewPrevFrame; // Offset: 256
// float4x4 projMatrix; // Offset: 320
// float4x4 viewProj; // Offset: 384
// float4x4 viewNoTranslationProj;// Offset: 448
// float4x4 viewProjPrevFrame; // Offset: 512
// float4x4 viewNoTranslationProjPrevFrame;// Offset: 576
// float4 viewTranslation; // Offset: 640
// float4 viewTranslationPrevFrame;// Offset: 656
// float4 vPosToUV; // Offset: 672
// float4 viewportScaleOffset; // Offset: 688
// float4 zFrontBackValue; // Offset: 704
// float4 clipPlane; // Offset: 720
// float4 frustumPlanes[4]; // Offset: 736
// float4 globalLightingScale; // Offset: 800
// float4 viewSpaceLightingBackWS;// Offset: 816
// float4 projectorPosition; // Offset: 832
// float4 prevProjectorPosition; // Offset: 848
// float4 pixelPatchingParams; // Offset: 864
// float gradientAdjustMipBias; // Offset: 880
// float thinGeomAAPixelScale; // Offset: 884
// uint layerIndex; // Offset: 888
// uint globalCubeMapIndex; // Offset: 892
// uint dynamicGBufferCubeMapIndex;// Offset: 896
// uint alphaDitherEnabled; // Offset: 900
// uint TAADitherEnabled; // Offset: 904
// float CameraTAAFadeStartDist; // Offset: 908
//
// struct MaterialTable_Constants
// {
//
// } materialTable; // Offset: 4294967292
//
// struct ReverseProjParams_Constants
// {
//
// float4x4 ClipXYZToViewPos; // Offset: 912
// float4x4 ClipXYZToWorldPos;// Offset: 976
// float4 ClipZToViewZ; // Offset: 1040
//
// } RevProjParams; // Offset: 912
//
// struct RefractionParams_Constants
// {
//
// } refraction; // Offset: 4294967292
//
// struct DeferredCommonParams_Constants
// {
//
// } deferredcommon; // Offset: 4294967292
//
// struct MotionVectorParams_Constants
// {
//
// } motionVector; // Offset: 4294967292
//
// struct CombinedCloudShadow_Constants
// {
//
// float4 XYScaleBias; // Offset: 1056
// float4 ForwardMappingParams;// Offset: 1072
// float2 ZProject; // Offset: 1088
// float4 BackwardMappingParams;// Offset: 1104
// float CloudShadowGIDensity;// Offset: 1120
//
// } combinedCloudShadow; // Offset: 1056
//
// struct AmbientLightingParams_Constants
// {
//
// } AmbientLighting; // Offset: 4294967292
//
// struct VolumetricFogParams_Constants
// {
//
// float4 volumeInvTransZ; // Offset: 1136
// float4 volumeTexScale; // Offset: 1152
// float4 volumeTexBias; // Offset: 1168
// float4 sunColor; // Offset: 1184
// float4 sunColorByOneOverPi;// Offset: 1200
//
// } fog; // Offset: 1136
//
// struct UnderwaterLightingParams_Constants
// {
//
// float3 InvDepthParams; // Offset: 1216
//
// } underwater; // Offset: 1216
//
// struct ClusteredLightsEvaluateParams_Constants
// {
//
// float4 VposToClusterXY; // Offset: 1232
// float4 ClipPosToClusterXY; // Offset: 1248
// float4 ClusterTransZ; // Offset: 1264
// uint HighClusterW; // Offset: 1280
// uint HighClusterWH; // Offset: 1284
//
// } clusteredLightsEvaluate; // Offset: 1232
//
// struct WaterStamperTextureParams_Constants
// {
//
// } waterStamperTextures; // Offset: 4294967292
//
// struct WaterCustomMeshParams_Constants
// {
//
// float3 maxCC; // Offset: 1296
//
// } waterCustomMeshParams; // Offset: 1296
//
// struct VideoAndScreenshotParams_Constants
// {
//
// } videoAndScreenshot; // Offset: 4294967292
//
// struct RainRipplesParams_Constants
// {
//
// } rainRipples; // Offset: 4294967292
//
// struct CookieShadowParams_Constants
// {
//
// } cookieShadows; // Offset: 4294967292
//
// struct NearShadowParams_Constants
// {
//
// } nearShadows; // Offset: 4294967292
//
// struct FarShadowParams_Constants
// {
//
// float FarShadowBlendRatio; // Offset: 1312
//
// } farShadows; // Offset: 1312
//
// struct CommonShadowParams_Constants
// {
//
// } commonShadows; // Offset: 4294967292
//
// struct GrassForceSamplingParams_Constants
// {
//
// float2 WorldToUVOffset; // Offset: 1328
// float2 WorldToUVScale; // Offset: 1336
// float2 ReferenceWorldXY; // Offset: 1344
// float FadeStart; // Offset: 1352
// float Radius; // Offset: 1356
//
// } grassForce; // Offset: 1328
//
// } PassParams_constants; // Offset: 0 Size: 1360
//
// }
//
// cbuffer InstanceParams_cbuffer
// {
//
// struct InstanceParams_Constants
// {
//
// float4x4 world; // Offset: 0
// float4x4 worldPrevFrame; // Offset: 64
// float4x4 worldViewProj; // Offset: 128
// float4x4 worldViewProjPrevFrame;// Offset: 192
// float4 dissolveFactor; // Offset: 256
// float LODBlendFactor; // Offset: 272
// float wetnessBias; // Offset: 276
// float alphaTestValue; // Offset: 280
// uint materialTableIndex; // Offset: 284
// uint instanceOffset; // Offset: 288
// uint CameraTAADither; // Offset: 292
//
// struct InstancingParams_Constants
// {
//
// struct InstanceBatchSetupConsts_Constants
// {
//
// int4 offsets; // Offset: 304
//
// } instanceBatchSetupConsts;// Offset: 304
//
// } instancing; // Offset: 304
//
// } InstanceParams_constants; // Offset: 0 Size: 320
//
// }
//
// cbuffer MaterialParams_cbuffer
// {
//
// struct MaterialParams_Constants
// {
//
// struct DefaultMaterialConsts
// {
//
// float4 blendXYAlphaTestTwoSided;// Offset: 0
//
// } defaults; // Offset: 0
// float4 VertexQuadMin_6; // Offset: 16
// float4 VertexScale_89; // Offset: 32
// float4 VertexOffset_92; // Offset: 48
// float4 VertexQuadMax_16; // Offset: 64
// float4 AlphaClampFallof_2; // Offset: 80
// float4 UseVertexAlpha_4; // Offset: 96
// float4 UseScreenAlpha_5; // Offset: 112
// float4 UseLayer1AlphaGrayScale_7;// Offset: 128
// float4 AlphaClampMin_9; // Offset: 144
// float4 AlphaClampIsLayer01Alpha_10;// Offset: 160
// float4 UseLayer1Alpha_11; // Offset: 176
// float4 Layer0DiffuseUVIsClamp_13;// Offset: 192
// float4 Layer0DiffuseIsBC4_14; // Offset: 208
// float4 Layer1AlphaIsBC4_15; // Offset: 224
// float4 Layer1AlphaUVIsClamp_17;// Offset: 240
// float4 Layer0DiffuseIs9SS_18; // Offset: 256
// float4 OcclusionAlpha_20; // Offset: 272
// float4 OcclusionAlphaStepValue_21;// Offset: 288
// float4 Layer0DiffuseIsScreenSpace_22;// Offset: 304
// float4 Layer0DiffuseIsInvert_23;// Offset: 320
// float4 Layer0ColorIsAdd_24; // Offset: 336
// float4 ScreenAlphaTop_25; // Offset: 352
// float4 ScreenAlphaFallout_26; // Offset: 368
// float4 ScreenAlphaBottom_27; // Offset: 384
// float4 AlphaBoost_28; // Offset: 400
// float4 Mipmap_30; // Offset: 416
// float3x3 Layer0DiffuseUV_8_matrix;// Offset: 432
// float3x3 Layer1AlphaUV_12_matrix;// Offset: 480
//
// } MaterialParams_constants; // Offset: 0 Size: 524
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// FrameParams_defaultSamplers_pointClamp sampler NA NA 0 1
// FrameParams_defaultSamplers_standardSampler sampler NA NA 4 1
// PassParams_lastExposureTexture texture float4 2d 20 1
// PassParams_deferredcommon_DepthSurface texture float4 2d 28 1
// MaterialParams_srv.Layer0Diffuse_0 texture float4 2d 70 1
// MaterialParams_srv.Layer1Alpha_1 texture float4 2d 71 1
// InstanceParams_instancing_instanceData texture float4 buf 81 1
// PassParams_cbuffer cbuffer NA NA 1 1
// MaterialParams_cbuffer cbuffer NA NA 2 1
// InstanceParams_cbuffer cbuffer NA NA 3 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float xy w
// TEXCOORD 0 xyzw 1 NONE float xy
// COLOR 0 xyzw 2 NONE float w
// TEXCOORD 1 xyzw 3 NONE float
// TEXCOORD 2 xyzw 4 NONE float
// TEXCOORD 3 xyzw 5 NONE float
// TEXCOORD 4 xyzw 6 NONE float
// InstanceID 0 x 7 NONE uint x
// SV_IsFrontFace 0 x 8 FFACE uint
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
// Pixel Shader runs at sample frequency
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[66], immediateIndexed
dcl_constantbuffer cb3[20], immediateIndexed
dcl_constantbuffer cb2[32], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s4, mode_default
dcl_resource_texture2d (float,float,float,float) t20
dcl_resource_texture2d (float,float,float,float) t28
dcl_resource_texture2d (float,float,float,float) t70
dcl_resource_texture2d (float,float,float,float) t71
dcl_resource_buffer (float,float,float,float) t81
dcl_input_ps_siv linear noperspective sample v0.xyw, position
dcl_input_ps linear sample v1.xy
dcl_input_ps linear sample v2.w
dcl_input_ps constant v7.x
dcl_output o0.xyzw
dcl_temps 5

//IniParams:
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r28.xyzw, l(0, 0, 0, 0), t120.xyzw

if_z r28.x
mov o0.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
endif

ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[15].x
mov r1.xy, v1.xyxx
mov r1.z, l(1.000000)
dp3 r2.x, r1.xyzx, cb2[30].xyzx
dp3 r2.y, r1.xyzx, cb2[31].xyzx
mov_sat r0.yz, r2.xxyx
movc r0.xy, r0.xxxx, r0.yzyy, r2.xyxx
add r0.z, cb1[55].x, l(-2.500000)
sample_b_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t71.xywz, s4, r0.z
ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[14].x
movc r0.xy, r0.wwww, r0.xxxx, r0.yzyy
add r0.x, -r0.y, r0.x
mad r0.x, cb2[8].x, r0.x, r0.y
add r0.yz, |cb2[1].xxzx|, |cb2[4].xxzx|
mul r0.yz, r0.yyzy, l(0.000000, 3.39498758, 3.39498758, 0.000000)
div r1.xy, l(0.250000, 0.250000, 0.000000, 0.000000), r0.yzyy
add r1.zw, -r1.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000)
add r2.xy, -r1.xyxx, r1.zwzz
mad r2.zw, v0.xxxy, cb1[42].xxxy, -v1.xxxy
mad r3.xy, cb2[19].xxxx, r2.zwzz, v1.xyxx
mov r3.z, l(1.000000)
dp3 r4.x, r3.xyzx, cb2[27].xyzx
dp3 r4.y, r3.xyzx, cb2[28].xyzx
add r2.zw, -r1.xxxy, r4.xxxy
lt r1.xy, r4.xyxx, r1.xyxx
div r2.xy, r2.zwzz, r2.xyxx
mad r2.xy, r2.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.250000, 0.250000, 0.000000, 0.000000)
add r2.zw, -r4.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000)
mad r2.zw, -r2.zzzw, r0.yyyz, l(0.000000, 0.000000, 1.000000, 1.000000)
mul r0.yz, r0.yyzy, r4.xxyx
lt r1.zw, r1.zzzw, r4.xxxy
movc r1.zw, r1.zzzw, r2.zzzw, r2.xxxy
movc r0.yz, r1.xxyx, r0.yyzy, r1.zzwz
lt r0.w, l(0.000000), cb2[16].x
movc r0.yz, r0.wwww, r0.yyzy, r4.xxyx
mov_sat r1.xy, r0.yzyy
ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[12].x
movc r0.yz, r0.wwww, r1.xxyx, r0.yyzy
add r0.w, cb1[55].x, cb2[26].x
add r0.w, r0.w, l(-2.500000)
sample_b_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.yzyy, t70.yzwx, s4, r0.w
ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[13].x
movc r1.xyz, r0.yyyy, r1.wwww, r1.xyzx
add r0.y, r0.x, -r1.z
mad r0.y, cb2[11].x, r0.y, r1.z
add r0.x, -r0.y, r0.x
mad_sat r0.x, cb2[10].x, r0.x, r0.y
add r0.z, -r0.x, l(1.000000)
add r0.w, -cb2[9].x, l(1.000000)
add r0.z, -r0.w, r0.z
ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[5].x
movc r0.w, r0.w, cb2[5].x, l(0.000001)
ishl r2.x, v7.x, l(3)
ushr r2.x, r2.x, l(2)
iadd r2.x, r2.x, cb3[19].y
ld_indexable(buffer)(float,float,float,float) r2.x, r2.xxxx, t81.yxzw
iadd r2.x, r2.x, l(3)
ld_indexable(buffer)(float,float,float,float) r2.xyz, r2.xxxx, t81.xzwy
and r2.xzw, r2.yyzx, l(255, 0, 255, 0x0000ffff)
ushr r3.xyz, r2.yyyy, l(24, 16, 8, 0)
and r3.xyz, r3.xyzx, l(255, 255, 255, 0)
utof r3.xyz, r3.xyzx
f16tof32 r2.y, r2.w
utof r2.xz, r2.xxzx
add r0.x, r0.x, -r2.y
div_sat r0.xz, r0.xxzx, r0.wwww
max r0.x, r0.z, r0.x
add r0.x, -r0.x, l(1.000000)
add r0.z, v2.w, l(-1.000000)
mad r0.z, cb2[6].x, r0.z, l(1.000000)
mul r0.y, r0.z, r0.y
mul r0.x, r0.y, r0.x
mul r0.x, r1.z, r0.x
mul r0.yz, v0.xxyx, cb1[42].xxyx
sample_l_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t28.yxzw, s0, l(0.000000)
mad r0.yz, r0.yyyy, cb1[65].wwzw, cb1[65].yyxy
div r0.y, r0.y, r0.z
add r0.y, r0.y, -v0.w
ge r0.y, r0.y, cb2[18].x
and r0.z, r0.y, l(0x3f800000)
movc r0.y, r0.y, l(0), cb2[17].x
add r0.y, r0.y, r0.z
mul r0.x, r0.y, r0.x
mad r0.y, v0.y, cb1[42].y, -cb2[24].x
ne r0.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[23].x
movc r0.z, r0.z, cb2[23].x, l(0.000001)
div_sat r0.y, r0.y, r0.z
add r0.y, -r0.y, l(1.000000)
mad r0.w, v0.y, cb1[42].y, -cb2[22].x
div_sat r0.z, r0.w, r0.z
min r0.y, r0.y, r0.z
add r0.y, r0.y, l(-1.000000)
mad r0.y, cb2[7].x, r0.y, l(1.000000)
min r0.x, r0.y, r0.x
mul r0.y, r2.x, l(0.00392156886)
mul r0.y, r0.y, r2.z
mul r0.y, r0.y, cb2[25].x
mul r0.y, r0.y, l(0.00392156886)
mul r0.x, r0.x, r0.y
add r2.xyz, -r1.wxyw, l(1.000000, 1.000000, 1.000000, 0.000000)
ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[20].x
movc r0.yzw, r0.yyyy, r2.xxyz, r1.wwxy
mad_sat r1.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000), r0.yzwy
mul r2.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000)
mad r1.xyz, -r0.yzwy, r2.xyzx, r1.xyzx
mul r0.yzw, r0.yyzw, r2.xxyz
mad r0.yzw, cb2[21].xxxx, r1.xxyz, r0.yyzw
mad r1.xyz, r3.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000), -r0.yzwy
mad r0.yzw, cb2[13].xxxx, r1.xxyz, r0.yyzw
mul r0.yzw, r0.xxxx, r0.yyzw
mov o0.w, r0.x
sample_l_indexable(texture2d)(float,float,float,float) r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), t20.xyzw, s0, l(0.000000)
div r0.xyz, r0.yzwy, r0.xxxx
max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
min r0.xyz, r0.xyzx, l(100000.000000, 100000.000000, 100000.000000, 0.000000)
mul o0.xyz, r0.xyzx, cb1[50].xxxx
ret
// Approximately 117 instruction slots used

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


I did it the way you had it. If x==0, it disables the HUD.

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 11/15/2017 10:46 PM   
[quote="masterotaku"]File name: 000ea4ff144f3d6d-ps.txt I did it the way you had it. If x==0, it disables the HUD.[/quote] Thanks. But there's another error: [color="orange"]000ea4ff144f3d6d-ps_replace.txt(304,5-19): error X3000: unrecognized identifier 'dcl_globalFlags'[/color]
masterotaku said:File name: 000ea4ff144f3d6d-ps.txt

I did it the way you had it. If x==0, it disables the HUD.


Thanks. But there's another error:

000ea4ff144f3d6d-ps_replace.txt(304,5-19): error X3000: unrecognized identifier 'dcl_globalFlags'

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

Posted 11/16/2017 06:42 AM   
This shader is nuts, haha. But "dcl_globalFlags refactoringAllowed" isn't used at all later in the shader, so try commenting it, using "//dcl_globalFlags refactoringAllowed".
This shader is nuts, haha. But "dcl_globalFlags refactoringAllowed" isn't used at all later in the shader, so try commenting it, using "//dcl_globalFlags refactoringAllowed".

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 11/16/2017 07:12 AM   
[quote="DetectiveJohnKimble"][quote="masterotaku"]File name: 000ea4ff144f3d6d-ps.txt I did it the way you had it. If x==0, it disables the HUD.[/quote] Thanks. But there's another error: [color="orange"]000ea4ff144f3d6d-ps_replace.txt(304,5-19): error X3000: unrecognized identifier 'dcl_globalFlags'[/color] [/quote] Use the filename 000ea4ff144f3d6d-ps.txt not 000ea4ff144f3d6d-ps_replace.txt
DetectiveJohnKimble said:
masterotaku said:File name: 000ea4ff144f3d6d-ps.txt

I did it the way you had it. If x==0, it disables the HUD.


Thanks. But there's another error:

000ea4ff144f3d6d-ps_replace.txt(304,5-19): error X3000: unrecognized identifier 'dcl_globalFlags'


Use the filename 000ea4ff144f3d6d-ps.txt not 000ea4ff144f3d6d-ps_replace.txt

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 11/16/2017 12:04 PM   
[quote="DarkStarSword"] Use the filename 000ea4ff144f3d6d-ps.txt not 000ea4ff144f3d6d-ps_replace.txt [/quote] This doesn't give me any error messages, but toggle is still not working. I have it set up like this in the d3dx.ini which I assume is correct? [code][Constants] x = 1 [Key1] Key = caps x = 0 type = toggle[/code]
DarkStarSword said:
Use the filename 000ea4ff144f3d6d-ps.txt not 000ea4ff144f3d6d-ps_replace.txt


This doesn't give me any error messages, but toggle is still not working. I have it set up like this in the d3dx.ini which I assume is correct?

[Constants]
x = 1

[Key1]
Key = caps
x = 0
type = toggle

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

Posted 11/16/2017 06:42 PM   
Where I put "if_z r28.x", try changing it to "if_nz r28.x", just to see of it does the opposite effect and to see if it's a shader or hotkey problem.
Where I put "if_z r28.x", try changing it to "if_nz r28.x", just to see of it does the opposite effect and to see if it's a shader or hotkey problem.

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 11/16/2017 10:19 PM   
You may also need to add this before the if_z/nz line, since the if instructions don't behave like the documentation or common sense would lead you to believe, so it is always best to pair them with a comparison instruction, even if all you are doing is comparing against zero/non-zero: [code] eq r28.x, r28.x, l(0.0) [/code]
You may also need to add this before the if_z/nz line, since the if instructions don't behave like the documentation or common sense would lead you to believe, so it is always best to pair them with a comparison instruction, even if all you are doing is comparing against zero/non-zero:

eq r28.x, r28.x, l(0.0)

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 11/17/2017 12:40 AM   
[quote="masterotaku"]Where I put "if_z r28.x", try changing it to "if_nz r28.x", just to see of it does the opposite effect and to see if it's a shader or hotkey problem.[/quote] No change when doing this. [quote="DarkStarSword"]You may also need to add this before the if_z/nz line, since the if instructions don't behave like the documentation or common sense would lead you to believe, so it is always best to pair them with a comparison instruction, even if all you are doing is comparing against zero/non-zero: [code] eq r28.x, r28.x, l(0.0) [/code][/quote] This crashes the game at the main menu.
masterotaku said:Where I put "if_z r28.x", try changing it to "if_nz r28.x", just to see of it does the opposite effect and to see if it's a shader or hotkey problem.


No change when doing this.

DarkStarSword said:You may also need to add this before the if_z/nz line, since the if instructions don't behave like the documentation or common sense would lead you to believe, so it is always best to pair them with a comparison instruction, even if all you are doing is comparing against zero/non-zero:

eq r28.x, r28.x, l(0.0)


This crashes the game at the main menu.

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

Posted 11/17/2017 06:34 AM   
[quote] This crashes the game at the main menu. [/quote]o_O Something copied incorrectly I'd guess (perhaps forgetting the open and/or close bracket in the float literal, or maybe including the line number that the forum added?) - the assembler was not written to cope with human input and doesn't handle errors (silently dropping instructions, corrupting the shader or just outright crashing), so you have to be very careful if you use it and be as precise as a machine. I've improved the assembler considerably since the original implementation to cope with some human quirks (e.g. coping with tabs for indentation and adding comments mid line), but it is still extremely fragile - if you can work out exactly what you did that crashed it, please add that to this bug report: https://github.com/bo3b/3Dmigoto/issues/36 Of course, it is possible to crash the GPU with a badly written assembly shader (e.g. via an infinite loop) that has nothing to do with our assembler, but I can't see how that would have happened in this case. If you can't work it out, please post the complete shader here for us to check.
This crashes the game at the main menu.
o_O

Something copied incorrectly I'd guess (perhaps forgetting the open and/or close bracket in the float literal, or maybe including the line number that the forum added?) - the assembler was not written to cope with human input and doesn't handle errors (silently dropping instructions, corrupting the shader or just outright crashing), so you have to be very careful if you use it and be as precise as a machine.

I've improved the assembler considerably since the original implementation to cope with some human quirks (e.g. coping with tabs for indentation and adding comments mid line), but it is still extremely fragile - if you can work out exactly what you did that crashed it, please add that to this bug report:

https://github.com/bo3b/3Dmigoto/issues/36

Of course, it is possible to crash the GPU with a badly written assembly shader (e.g. via an infinite loop) that has nothing to do with our assembler, but I can't see how that would have happened in this case.

If you can't work it out, please post the complete shader here for us to check.

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 11/17/2017 07:56 AM   
Oh, hang on: [quote][code] dcl_temps 5[/code][/quote] That might be a problem. Change that to: [code] dcl_temps 29[/code] @masterotaku Always remember to bump dcl_temps to one higher than the largest temporary register number you have used, otherwise you will be corrupting some random GPU memory.
Oh, hang on:

dcl_temps 5


That might be a problem. Change that to:

dcl_temps 29


@masterotaku Always remember to bump dcl_temps to one higher than the largest temporary register number you have used, otherwise you will be corrupting some random GPU memory.

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 11/17/2017 08:05 AM   
  115 / 143    
Scroll To Top