Bo3b's School For Shaderhackers
  64 / 88    
Well trhat is the thing I went through both VS and PS and I did not see much. Yes the green hud at infinity but I did not see the shader I was looking for.. So I maybe doing something wrong or just not there?? Should I see more shaders in a dx9 game or not??
Well trhat is the thing I went through both VS and PS and I did not see much. Yes the green hud at infinity but I did not see the shader I was looking for..

So I maybe doing something wrong or just not there?? Should I see more shaders in a dx9 game or not??

Intel i5 7600K @ 4.8ghz / MSI Z270 SLI / Asus 1080GTX - 416.16 / Optoma HD142x Projector / 1 4'x10' Curved Screen PVC / TrackIR / HOTAS Cougar / Cougar MFD's / Track IR / NVidia 3D Vision / Win 10 64bit

Posted 08/19/2016 09:50 AM   
OK I found the vertex shader but it is the canopy too?? either way should there be a vertex file in dump folder?? IF so it is not there but I found the shader perhaps I don't have the ini file set correct.. will look around too the guides to check and see but I thinbk I have the ini set wrong or not correctly to save the file..
OK I found the vertex shader but it is the canopy too?? either way should there be a vertex file in dump folder?? IF so it is not there but I found the shader perhaps I don't have the ini file set correct.. will look around too the guides to check and see but I thinbk I have the ini set wrong or not correctly to save the file..

Intel i5 7600K @ 4.8ghz / MSI Z270 SLI / Asus 1080GTX - 416.16 / Optoma HD142x Projector / 1 4'x10' Curved Screen PVC / TrackIR / HOTAS Cougar / Cougar MFD's / Track IR / NVidia 3D Vision / Win 10 64bit

Posted 08/20/2016 12:32 AM   
Well I found I shoule input this line in the ini file DumpAll=true and it is there bur when I press numpad 6 the ASM file does not save weird it is.. maybe I have the wrong keypress?? will investigate further but I think the ini file is set correctly the file it just not being saved for some reason..
Well I found I shoule input this line in the ini file DumpAll=true and it is there bur when I press numpad 6 the ASM file does not save weird it is..

maybe I have the wrong keypress?? will investigate further but I think the ini file is set correctly the file it just not being saved for some reason..

Intel i5 7600K @ 4.8ghz / MSI Z270 SLI / Asus 1080GTX - 416.16 / Optoma HD142x Projector / 1 4'x10' Curved Screen PVC / TrackIR / HOTAS Cougar / Cougar MFD's / Track IR / NVidia 3D Vision / Win 10 64bit

Posted 08/20/2016 12:50 AM   
[quote="The_Nephilim"]Well I found I shoule input this line in the ini file DumpAll=true and it is there bur when I press numpad 6 the ASM file does not save weird it is.. maybe I have the wrong keypress?? will investigate further but I think the ini file is set correctly the file it just not being saved for some reason..[/quote] That can happen, check the LOG.txt to see if there are any errors. You pretty much need to use dumpall=true all the time. This is covered in my ShaderHacker classes. If you didn't do them, you absolutely must start there. It's a waste of time, both yours and mine, to explain stuff that is already documented.
The_Nephilim said:Well I found I shoule input this line in the ini file DumpAll=true and it is there bur when I press numpad 6 the ASM file does not save weird it is..

maybe I have the wrong keypress?? will investigate further but I think the ini file is set correctly the file it just not being saved for some reason..

That can happen, check the LOG.txt to see if there are any errors.


You pretty much need to use dumpall=true all the time. This is covered in my ShaderHacker classes. If you didn't do them, you absolutely must start there. It's a waste of time, both yours and mine, to explain stuff that is already documented.

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 08/20/2016 03:54 AM   
yes I reread it and that is how I found out. the first time I read it it did not make much sense but it does now.. In the log this is the only error I can see being repeated as there is a 133000Plus lines in there: luaL_loadfile cannot open PSscript.lua: No such file or directory
yes I reread it and that is how I found out. the first time I read it it did not make much sense but it does now..

In the log this is the only error I can see being repeated as there is a 133000Plus lines in there:


luaL_loadfile cannot open PSscript.lua: No such file or directory

Intel i5 7600K @ 4.8ghz / MSI Z270 SLI / Asus 1080GTX - 416.16 / Optoma HD142x Projector / 1 4'x10' Curved Screen PVC / TrackIR / HOTAS Cougar / Cougar MFD's / Track IR / NVidia 3D Vision / Win 10 64bit

Posted 08/20/2016 04:18 AM   
[quote="The_Nephilim"]yes I reread it and that is how I found out. the first time I read it it did not make much sense but it does now.. In the log this is the only error I can see being repeated as there is a 133000Plus lines in there: luaL_loadfile cannot open PSscript.lua: No such file or directory[/quote] That lua file error is not a problem, just a warning. It's annoying that it's on by default, but can't be easily fixed. It's looking for the HelixMod lua files, which can auto-fix games that use known techniques like for Unreal 3 games. The file not saving might happen if the file is already dumped. I'm not sure. Since it's a manual process to move the file to the active override folder, this might be normal behavior. HelixMod is not nearly as user-friendly as 3Dmigoto, and there are silent gotchas, so keep a close eye out. Experiment back and forth when things don't seem to work. It's unfortunately more trial-and-error with HelixMod because of this.
The_Nephilim said:yes I reread it and that is how I found out. the first time I read it it did not make much sense but it does now..

In the log this is the only error I can see being repeated as there is a 133000Plus lines in there:


luaL_loadfile cannot open PSscript.lua: No such file or directory

That lua file error is not a problem, just a warning. It's annoying that it's on by default, but can't be easily fixed. It's looking for the HelixMod lua files, which can auto-fix games that use known techniques like for Unreal 3 games.


The file not saving might happen if the file is already dumped. I'm not sure. Since it's a manual process to move the file to the active override folder, this might be normal behavior.

HelixMod is not nearly as user-friendly as 3Dmigoto, and there are silent gotchas, so keep a close eye out. Experiment back and forth when things don't seem to work. It's unfortunately more trial-and-error with HelixMod because of this.

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 08/20/2016 04:22 AM   
Well I read through 16 pages of this thread last night found a lot of good info and I have a lot of reading to do still.. So for now with the Helixmod I was looking for answers to why the ASM files are not saving found a lead but it was not the problem.. So I will continue reading this entire thread and will continue to read it.. I was also looking at the wiki and there is alo a ton more info there too like entries for the ini and I did not find an answer there either but a lot of good info.. But like you said bo3b it will be a lot of trial and error..thank you for the info and I am still in the process of fixing with 3D migoto Final Fantasy XIV..
Well I read through 16 pages of this thread last night found a lot of good info and I have a lot of reading to do still..

So for now with the Helixmod I was looking for answers to why the ASM files are not saving found a lead but it was not the problem.. So I will continue reading this entire thread and will continue to read it..

I was also looking at the wiki and there is alo a ton more info there too like entries for the ini and I did not find an answer there either but a lot of good info..

But like you said bo3b it will be a lot of trial and error..thank you for the info and I am still in the process of fixing with 3D migoto Final Fantasy XIV..

Intel i5 7600K @ 4.8ghz / MSI Z270 SLI / Asus 1080GTX - 416.16 / Optoma HD142x Projector / 1 4'x10' Curved Screen PVC / TrackIR / HOTAS Cougar / Cougar MFD's / Track IR / NVidia 3D Vision / Win 10 64bit

Posted 08/21/2016 12:10 AM   
Now I'm fixing Dead Rising 3 (the last time someone asked or a fix was here: https://forums.geforce.com/default/topic/772901/3d-vision/dead-rising-3-3d-pics-/, more than 2 years ago, unless there is a newer thread). Basically, I have fixed 3 shadows pixel shaders, a few haloing issues and made some HUD options and improvements. I have also disabled sun rays (the image of one eye was copy-pasted to the other, which is wrong). Edit: IMPORTANT: I'm using the The Witcher 3 profile (that uses the profile specified in the helixmod blog post). Otherwise, there are broken effects that render the same for both eyes. I have added "deadrising3.exe" to the profile instead of modifying the Dead Rising 3 profile. Here is my WIP fix (hunting mode is enabled (hunting=2)): https://www.dropbox.com/s/vqx4ypr59ed6gsc/deadrising3_wip_fix.7z?dl=0 I have changed the StereoParams from t125 to t119 in d3dx.ini (it interfered with some shader I dumped and probably deleted after seeing that it was useless). You can see the hotkeys in d3dx.ini. With "b", you apply or not the partial fix of what I'm going to say now. I'm having trouble with two lighting pixel shaders: df64b0dd4effd2f4-ps_replace.txt (normal gameplay) and ab4b3a46366f29f8-ps_replace.txt (cutscenes). They do basically the same. Content of df64b0dd4effd2f4-ps_replace.txt (modified by me): [code]//Lighting PS (incorrect in HLSL). // ---- Created with 3Dmigoto v1.2.43 on Tue Aug 23 20:26:52 2016 cbuffer _Globals : register(b0) { float4 gTintColour : packoffset(c0); float4 gOutlineColour : packoffset(c1); float4 gOutlineParams : packoffset(c2); float4 gCubemapParams : packoffset(c3); float4 gEnvVar : packoffset(c4); row_major float4x4 gFogParameters : packoffset(c5); float4 gQuantizedDepthParameters : packoffset(c9); float4 gVelocityParameters : packoffset(c10); float4 gFinalGammaParameters : packoffset(c11); float4 gDiffuseColourPS : packoffset(c15); float4 gBlendFactor : packoffset(c16); row_major float4x4 gLightingModelTestParameters : packoffset(c17); float4 gHdrCompressScale : packoffset(c34); float4 gCarPaintParams : packoffset(c35); float4 gPCFKernelScale : packoffset(c36); float4 gLightComponentToggler[3] : packoffset(c37); float4 gScreenParameters : packoffset(c40); float4 gFluidSubColor0 : packoffset(c41); float4 gFluidSubColor1 : packoffset(c42); float4 gFluidSubParams0 : packoffset(c43); float4 gSsaoParams : packoffset(c44); float4 gSsaoMisc : packoffset(c45); row_major float4x4 gBlurSampleWeights : packoffset(c46); float4 gBlurSampleOffsets[8] : packoffset(c50); row_major float4x4 gInverseProjectionMatrix : packoffset(c58); row_major float4x4 gGlow0Parameters_POST : packoffset(c62); row_major float4x4 gGlow1Parameters_POST : packoffset(c66); row_major float4x4 gGlow2Parameters_POST : packoffset(c70); row_major float4x4 gGlow3Parameters_POST : packoffset(c74); float4 gPointLight0Parameters_POST[2] : packoffset(c78); float4 gPointLight1Parameters_POST[2] : packoffset(c80); float4 gPointLight2Parameters_POST[2] : packoffset(c82); float4 gPointLight3Parameters_POST[2] : packoffset(c84); float4 gLightAnimationParameters : packoffset(c86); row_major float4x4 gLightAnimationRotationMatrix : packoffset(c87); float4 gSpotLightDirection0_POST : packoffset(c91); float4 gSpotLightDirection1_POST : packoffset(c92); float4 gSpotLightDirection2_POST : packoffset(c93); float4 gSpotLightDirection3_POST : packoffset(c94); float4 gBloomScaleOffset : packoffset(c95); row_major float4x4 gLensFlareColour : packoffset(c96); float4 gScreenColour : packoffset(c100); float4 gCombinedDOFBlurParameters : packoffset(c101); float4 gDOFCameraBlurParameters : packoffset(c102); float4 gDOFParameters : packoffset(c103); float4 gFilmGrainParams : packoffset(c104); float4 gFilmGrainOffsetScale : packoffset(c105); row_major float4x4 gInverseViewProjection2 : packoffset(c106); row_major float4x4 gPreviousViewProjection : packoffset(c110); row_major float4x4 gCurrToPreviousViewProjection : packoffset(c114); float4 gCombinedVelocityBlurWeights[2] : packoffset(c118); row_major float4x4 gCombinedVelocityBlurOffsets : packoffset(c120); float4 gRadialBlurWeights[2] : packoffset(c124); float4 gVelocityParameters2 : packoffset(c126); float4 gRadialBlurParams : packoffset(c127); float4 gFinalCompositeParameters : packoffset(c128); float4 gFinalCompositeExposure : packoffset(c129); float4 gColourMatrix[3] : packoffset(c130); float4 gVignetteColour : packoffset(c133); float4 gVignetteParameters : packoffset(c134); float4 gToneMapOptions[2] : packoffset(c135); float4 gBloomOptions : packoffset(c137); float4 gSunCoordinate : packoffset(c138); float4 gCrepuscularParams : packoffset(c139); float4 gCrepuscularDecay : packoffset(c140); float4 gCrepuscularDecayAcc : packoffset(c141); float4 gCrepuscularColour : packoffset(c142); float4 gCubeFaceParams[2] : packoffset(c143); float4 gChromaticAberrationParams : packoffset(c145); float4 gBokehOffsets : packoffset(c146); float4 gCoCParams : packoffset(c147); float4 g8x8SampleOffsets[8] : packoffset(c148); float4 g8x8DepthSampleOffsets[8] : packoffset(c156); float4 gOverlayParameters[2] : packoffset(c164); float4 gSampleOffsets[2] : packoffset(c166); float4 gToneMapOptions2 : packoffset(c168); float4 gLuminanceToExposure : packoffset(c169); row_major float4x4 gViewMatrix : packoffset(c170); row_major float4x4 gProjectionMatrix : packoffset(c174); float4 gMaxDistParams : packoffset(c178); row_major float4x4 gIterSampleOffset2dScaleWeight : packoffset(c179); float4 gIterResultBlendingParams : packoffset(c183); float4 gIterMaxDeltaParams : packoffset(c184); float4 gPerspectiveCorrectionParams : packoffset(c185); float4 gHBAOPSParams[6] : packoffset(c186); row_major float4x4 gViewMatrixInverse : packoffset(c192); float4 gPEBlurSampleOffsets : packoffset(c196); row_major float4x4 gShadowMapProjectionViewMatrix0 : packoffset(c197); row_major float4x4 gShadowMapProjectionViewMatrix1 : packoffset(c201); row_major float4x4 gShadowMapProjectionViewMatrix2 : packoffset(c205); row_major float4x4 gShadowMapProjectionViewMatrix3 : packoffset(c209); float4 gShadowMapTexelSize : packoffset(c213); float4 gReflectionScale : packoffset(c214); float4 gScreenSpaceReflectionParams : packoffset(c215); float4 gSoftAlphaParams : packoffset(c216); float4 gDynamicLightDistanceCullDepth : packoffset(c217); float4 gEyeSsaoIntensityParams : packoffset(c218); float4 gEyeSsaoColourParams : packoffset(c219); float4 gSkinSsaoColourParams : packoffset(c220); float4 gHairSsaoColourParams : packoffset(c221); row_major float4x4 gPostFxKeyLightParameters : packoffset(c222); float4 gPostFxKeyLightScaleParams[2] : packoffset(c226); float4 gPostFxHeadLightColour : packoffset(c228); row_major float4x4 gPostFxFogParameters : packoffset(c229); row_major float4x4 gPostFxShadowMapPackedParams : packoffset(c233); float4 gPostFxCascadedShadowLightMatrices[16] : packoffset(c237); float4 gBitMask : packoffset(c253); float4 gFXAAParams[3] : packoffset(c254); float4 gPostFxRimLight2Parameters[2] : packoffset(c257); float4 gPostFxBounceLightParameters[2] : packoffset(c259); float4 gPostFxCharRimLightParameters : packoffset(c261); float4 gFoliageSsaoColourParams : packoffset(c262); float4 gCameraMotionBlurParams : packoffset(c263); float4 gDancingPixelParams : packoffset(c264); float4 gSMAAParamsPS : packoffset(c265); float4 gRimLightFalloffParams : packoffset(c266); } cbuffer CameraParameters : register(b5) { float4 gCameraParameters[2] : packoffset(c0); } SamplerState gDepthTexture_s : register(s0); SamplerState gGBuffer0Texture_s : register(s1); SamplerState gGBuffer1Texture_s : register(s2); SamplerState gGBuffer2Texture_s : register(s3); SamplerState gGBuffer3Texture_s : register(s4); SamplerState gDynamicLightTexture_s : register(s5); SamplerState gPointClampSampler_s : register(s15); Texture2D<float4> gDepthTextureTex : register(t0); Texture2D<float4> gGBuffer0TextureTex : register(t1); Texture2D<float4> gGBuffer1TextureTex : register(t2); Texture2D<float4> gGBuffer2TextureTex : register(t3); Texture2D<float4> gGBuffer3TextureTex : register(t4); Texture2D<float4> gDynamicLightTextureTex : register(t5); Texture2D<float4> gScreenSpaceShadowMap : register(t118); // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t119); void main( float4 v0 : SV_Position0, float4 v1 : COLOR0, float2 v2 : TEXCOORD0, out float4 o0 : SV_Target0, out float4 o1 : SV_Target1) { float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13; uint4 bitmask, uiDest; float4 fDest; float4 iniparams= IniParams.Load(0); float4 stereo = StereoParams.Load(0); float separation = stereo.x; float convergence = stereo.y; r0.z = gDepthTextureTex.Sample(gDepthTexture_s, v2.xy).x; r1.x = cmp(r0.z >= 1); if (r1.x != 0) { if (-1 != 0) discard; } r1.xyzw = gGBuffer0TextureTex.Sample(gGBuffer0Texture_s, v2.xy).xyzw; r2.xyzw = gGBuffer1TextureTex.Sample(gGBuffer1Texture_s, v2.xy).xyzw; r3.xyzw = gGBuffer2TextureTex.Sample(gGBuffer2Texture_s, v2.xy).xyzw; r4.xyzw = gGBuffer3TextureTex.Sample(gGBuffer3Texture_s, v2.xy).xyzw; r5.x = dot(r1.xyz, r1.xyz); r5.x = cmp(r5.x == 0.000000); if (r5.x != 0) { r5.xyz = float3(0,1,0); } else { r5.xyz = r1.xyz * float3(2,2,2) + float3(-1,-1,-1); } if (8 == 0) r1.x = 0; else if (8+13 < 32) { r1.x = (uint)r1.w << (32-(8 + 13)); r1.x = (uint)r1.x >> (32-8); } else r1.x = (uint)r1.w >> 13; r1.x = (uint)r1.x; r1.x = 0.00392156886 * r1.x; r1.yzw = r2.xyz * r2.xyz; r2.x = 255 * r2.w; r2.x = (int)r2.x; if (8 == 0) r2.y = 0; else if (8+13 < 32) { r2.y = (uint)r3.w << (32-(8 + 13)); r2.y = (uint)r2.y >> (32-8); } else r2.y = (uint)r3.w >> 13; r2.y = (uint)r2.y; if (8 == 0) r2.z = 0; else if (8+13 < 32) { r2.z = (uint)r4.w << (32-(8 + 13)); r2.z = (uint)r2.z >> (32-8); } else r2.z = (uint)r4.w >> 13; r2.z = (uint)r2.z; r2.yw = float2(0.00392156886,0.00392156886) * r2.yz; r0.xy = v2.xy * float2(2,-2) + float2(-1,1); r0.w = 1; r6.x = dot(gInverseViewProjection2._m00_m01_m02_m03, r0.xyzw); r6.y = dot(gInverseViewProjection2._m10_m11_m12_m13, r0.xyzw); r6.z = dot(gInverseViewProjection2._m20_m21_m22_m23, r0.xyzw); float shdepth; shdepth=dot(gInverseViewProjection2._m30_m31_m32_m33, r0.xyzw); r0.x = dot(gInverseViewProjection2._m30_m31_m32_m33, r0.xyzw); r0.xyz = r6.xyz / r0.xxx; //Multiply by 0 to disable lighting. newv2.x+=separation*(shdepth*(convergence*0.5)-0.5); fixes shadows, screws lighting. float2 newv2; newv2.xy=v2.xy; newv2.x+=separation*(shdepth*convergence*0.5-0.5); if (iniparams.w==1) { r6.xyzw = gDynamicLightTextureTex.Sample(gDynamicLightTexture_s, newv2.xy).xyzw; } else { r6.xyzw = gDynamicLightTextureTex.Sample(gDynamicLightTexture_s, v2.xy).xyzw; } float4 oldr6; oldr6.xyzw = gDynamicLightTextureTex.Sample(gDynamicLightTexture_s, newv2.xy).xyzw; r0.w = (int)r2.x & 64; float4 r26; r26.xyz = gCameraParameters[0].xyz; r26.x -= stereo.x*(-r26.z - stereo.y)/v2.x; //r7.xyz = r26.xyz + -r0.xyz; r7.xyz = gCameraParameters[0].xyz + -r0.xyz; r2.x = dot(r7.xyz, r7.xyz); r3.w = sqrt(r2.x); r3.w = -gRimLightFalloffParams.x + r3.w; r4.w = gRimLightFalloffParams.y + -gRimLightFalloffParams.x; r3.w = r3.w / r4.w; r3.w = saturate(1 + -r3.w); r0.w = r0.w ? r3.w : 0; r2.x = rsqrt(r2.x); float4 r25; r25.xyz = r7.xyz * r2.xxx; r25.x -= stereo.x*(-r25.z - stereo.y)*0.4640625*(16/9); //r8.xyz = r25.xyz; r8.xyz = r7.xyz * r2.xxx; r3.w = dot(r5.xyz, gPostFxKeyLightParameters._m00_m01_m02); r4.w = -r3.w * gPostFxBounceLightParameters[0].w + -gPostFxBounceLightParameters[0].w; r4.w = 1 + r4.w; r4.w = max(0, r4.w); r5.w = dot(r8.xyz, r5.xyz); r7.w = max(0, r5.w); r7.w = gPostFxKeyLightParameters._m32 + -r7.w; r7.w = 1 + r7.w; r7.w = max(0, r7.w); r8.w = log2(r7.w); r8.w = gPostFxKeyLightParameters._m23 * r8.w; r8.w = exp2(r8.w); r8.w = gPostFxKeyLightParameters._m30 * r8.w; r7.w = 3.14159274 * r7.w; r7.w = sin(r7.w); r7.w = r8.w * r7.w; //Shadows. r8.w = gScreenSpaceShadowMap.Sample(gPointClampSampler_s, v2.xy).x; r8.w = 1 + -r8.w; r9.xy = gPostFxKeyLightScaleParams[0].xz + -r0.xz; r9.x = dot(r9.xy, r9.xy); r9.x = sqrt(r9.x); r9.x = -gPostFxKeyLightScaleParams[1].y + r9.x; r9.y = gPostFxKeyLightScaleParams[1].x + -gPostFxKeyLightScaleParams[1].y; r9.x = saturate(r9.x / r9.y); r9.x = r9.x * r9.x; r9.y = dot(gPostFxKeyLightParameters._m20_m21_m22, r5.xyz); r9.z = max(0, r9.y); r9.w = r9.z * abs(r7.w); r10.x = dot(gPostFxRimLight2Parameters[0].xyz, r5.xyz); r10.y = max(0, r10.x); r10.z = r10.y * abs(r7.w); r11.xyz = gPostFxRimLight2Parameters[1].xyz * r10.zzz; r11.xyz = gPostFxCharRimLightParameters.xyz * r9.www + r11.xyz; r12.xyz = r7.xyz * r2.xxx + gPostFxKeyLightParameters._m20_m21_m22; r9.w = dot(r12.xyz, r12.xyz); r9.w = rsqrt(r9.w); r12.xyz = r12.xyz * r9.www; r9.w = dot(r5.xyz, r12.xyz); r10.z = dot(gPostFxKeyLightParameters._m20_m21_m22, r12.xyz); r10.w = 1 + -r10.z; r11.w = r10.w * r10.w; r11.w = r11.w * r11.w; r10.w = r11.w * r10.w; r2.z = -r2.z * 0.00392156886 + 1; r10.w = r2.z * r10.w + r2.w; r11.w = r1.x * r1.x; r12.w = r9.w * r9.w; r13.x = r12.w * r11.w; r13.x = max(9.99999975e-006, r13.x); r13.y = -r9.w * r9.w + 1; r13.x = r13.y / r13.x; r13.x = -1.44269502 * r13.x; r13.x = exp2(r13.x); r13.y = 3.14159012 * r11.w; r12.w = r12.w * r12.w; r12.w = r12.w * r13.y; r12.w = max(9.99999975e-006, r12.w); r12.w = r13.x / r12.w; r13.x = r9.y * r5.w; r13.z = 4 * r13.x; r9.w = r9.w + r9.w; r13.w = r9.w * r5.w; r12.x = dot(r8.xyz, r12.xyz); r12.x = max(9.99999975e-006, r12.x); r12.x = r13.w / r12.x; r9.y = r9.w * r9.y; r9.w = max(9.99999975e-006, r10.z); r9.y = r9.y / r9.w; r9.y = min(r12.x, r9.y); r9.y = min(1, r9.y); r9.z = r10.w * r9.z; r9.y = r9.z * r9.y; r9.y = r9.y * r12.w; r9.z = cmp(r13.x < 0); r9.w = min(-9.99999975e-006, r13.z); r10.z = max(9.99999975e-006, r13.z); r9.z = r9.z ? r9.w : r10.z; r9.y = r9.y / r9.z; r12.xyz = r7.xyz * r2.xxx + gPostFxRimLight2Parameters[0].xyz; r9.z = dot(r12.xyz, r12.xyz); r9.z = rsqrt(r9.z); r12.xyz = r12.xyz * r9.zzz; r9.z = dot(r5.xyz, r12.xyz); r9.w = dot(gPostFxRimLight2Parameters[0].xyz, r12.xyz); r10.z = 1 + -r9.w; r10.w = r10.z * r10.z; r10.w = r10.w * r10.w; r10.z = r10.w * r10.z; r10.z = r2.z * r10.z + r2.w; r10.w = r9.z * r9.z; r12.w = r10.w * r11.w; r12.w = max(9.99999975e-006, r12.w); r13.x = -r9.z * r9.z + 1; r12.w = r13.x / r12.w; r12.w = -1.44269502 * r12.w; r12.w = exp2(r12.w); r10.w = r10.w * r10.w; r10.w = r10.w * r13.y; r10.w = max(9.99999975e-006, r10.w); r10.w = r12.w / r10.w; r12.w = r10.x * r5.w; r13.x = 4 * r12.w; r9.z = r9.z + r9.z; r13.z = r9.z * r5.w; r12.x = dot(r8.xyz, r12.xyz); r12.x = max(9.99999975e-006, r12.x); r12.x = r13.z / r12.x; r9.z = r9.z * r10.x; r9.w = max(9.99999975e-006, r9.w); r9.z = r9.z / r9.w; r9.z = min(r12.x, r9.z); r9.z = min(1, r9.z); r9.w = r10.y * r10.z; r9.z = r9.w * r9.z; r9.z = r9.z * r10.w; r9.w = cmp(r12.w < 0); r10.x = min(-9.99999975e-006, r13.x); r10.y = max(9.99999975e-006, r13.x); r9.w = r9.w ? r10.x : r10.y; r9.z = r9.z / r9.w; r10.xyz = gPostFxRimLight2Parameters[1].xyz * r9.zzz; r9.yzw = r9.yyy * gPostFxCharRimLightParameters.xyz + r10.xyz; r9.yzw = r9.yzw * abs(r7.www); r9.yzw = r9.yzw * r0.www; r10.xyz = gPostFxBounceLightParameters[0].xyz * r9.xxx; r10.xyz = max(gPostFxBounceLightParameters[1].xyz, r10.xyz); r10.xyz = r10.xyz * r4.www; r10.xyz = r11.xyz * r0.www + r10.xyz; r11.xyz = gPostFxKeyLightParameters._m10_m11_m12 * r9.xxx; r11.xyz = gCubemapParams.yyy * r11.xyz; r11.xyz = r11.xyz * r8.www; r0.w = dot(r5.xyz, r5.xyz); r0.w = rsqrt(r0.w); r12.xyz = r5.xyz * r0.www; r13.xzw = -r12.xyz * r5.www + r8.xyz; r12.xyz = -r12.xyz * r3.www + gPostFxKeyLightParameters._m00_m01_m02; r0.w = dot(r13.xzw, r12.xyz); r12.xy = r1.xx * r1.xx + float2(0.569999993,0.0900000036); r12.xy = r11.ww / r12.xy; r1.x = 0.449999988 * r12.y; r4.w = -r12.x * 0.5 + 1; r7.w = -r5.w * r5.w + 1; r8.w = -r3.w * r3.w + 1; r7.w = saturate(r8.w * r7.w); r7.w = sqrt(r7.w); r8.w = max(r5.w, r3.w); r9.x = cmp(r8.w < 0); r10.w = min(-9.99999975e-006, r8.w); r8.w = max(9.99999975e-006, r8.w); r8.w = r9.x ? r10.w : r8.w; r7.w = r7.w / r8.w; r8.w = max(0, r3.w); r0.w = max(0, r0.w); r0.w = r1.x * r0.w; r0.w = r0.w * r7.w + r4.w; r0.w = r8.w * r0.w; r3.xyz = r11.xyz * r0.www + r3.xyz; r7.xyz = r7.xyz * r2.xxx + gPostFxKeyLightParameters._m00_m01_m02; r0.w = dot(r7.xyz, r7.xyz); r0.w = rsqrt(r0.w); r7.xyz = r7.xyz * r0.www; r0.w = dot(r5.xyz, r7.xyz); r1.x = dot(gPostFxKeyLightParameters._m00_m01_m02, r7.xyz); r2.x = 1 + -r1.x; r4.w = r2.x * r2.x; r4.w = r4.w * r4.w; r2.x = r4.w * r2.x; r2.x = r2.z * r2.x + r2.w; r2.z = r0.w * r0.w; r2.w = r2.z * r11.w; r2.w = max(9.99999975e-006, r2.w); r4.w = -r0.w * r0.w + 1; r2.w = r4.w / r2.w; r2.w = -1.44269502 * r2.w; r2.w = exp2(r2.w); r2.z = r2.z * r2.z; r2.z = r2.z * r13.y; r2.z = max(9.99999975e-006, r2.z); r2.z = r2.w / r2.z; r2.w = r5.w * r3.w; r4.w = 4 * r2.w; r0.w = r0.w + r0.w; r5.x = r0.w * r5.w; r5.y = dot(r8.xyz, r7.xyz); r5.y = max(9.99999975e-006, r5.y); r5.x = r5.x / r5.y; r0.w = r0.w * r3.w; r1.x = max(9.99999975e-006, r1.x); r0.w = r0.w / r1.x; r0.w = min(r5.x, r0.w); r0.w = min(1, r0.w); r1.x = r8.w * r2.x; r0.w = r1.x * r0.w; r0.w = r0.w * r2.z; r1.x = cmp(r2.w < 0); r2.x = min(-9.99999975e-006, r4.w); r2.z = max(9.99999975e-006, r4.w); r1.x = r1.x ? r2.x : r2.z; r0.w = r0.w / r1.x; r1.x = dot(r6.xyz, float3(0.212500006,0.715399981,0.0720999986)); r1.x = max(9.99999975e-006, r1.x); r2.xzw = r6.xyz / r1.xxx; r1.x = cmp(gCubemapParams.x != 1.000000); r1.x = r1.x ? 1.000000 : 0; r3.xyz = r6.xyz * r1.xxx + r3.xyz; r2.xzw = r6.www * r2.xzw; r2.xzw = r2.xzw * r1.xxx; r2.xzw = r0.www * r11.xyz + r2.xzw; r2.xzw = gLightingModelTestParameters._m30_m30_m30 * r2.xzw; r5.xyz = r9.yzw * r2.yyy; r3.xyz = r3.xyz + r10.xyz; r2.xyz = r2.xzw * r2.yyy + r5.xyz; r1.xyz = r3.xyz * r1.yzw + r2.xyz; r2.xyz = r3.xyz + r2.xyz; r0.xyz = -gCameraParameters[0].xyz + r0.xyz; r0.y = dot(r0.xyz, r0.xyz); r0.y = sqrt(r0.y); r3.xz = gPostFxKeyLightParameters._m00_m02; r3.y = 9.99999975e-005; r1.w = dot(r3.xyz, r3.xyz); r1.w = rsqrt(r1.w); r3.xyz = r3.xyz * r1.www; r0.w = 9.99999975e-005; r1.w = dot(r0.xzw, r0.xzw); r1.w = rsqrt(r1.w); r0.xzw = r1.www * r0.xwz; r0.x = dot(r3.xyz, r0.xzw); r0.x = r0.x * 0.5 + 0.5; r3.xyz = gPostFxFogParameters._m30_m31_m32 + -gPostFxFogParameters._m10_m11_m12; r3.xyz = r0.xxx * r3.xyz + gPostFxFogParameters._m10_m11_m12; r5.xyz = gPostFxFogParameters._m20_m21_m22 + -gPostFxFogParameters._m00_m01_m02; r0.xzw = r0.xxx * r5.xyz + gPostFxFogParameters._m00_m01_m02; r0.x = r0.y + -r0.x; r0.x = saturate(r0.x * r0.z); r0.y = -1 + r0.w; r0.x = r0.x * r0.y + 1; r0.yzw = r1.xyz * gTintColour.xyz + -r3.xyz; r0.xyz = r0.xxx * r0.yzw + r3.xyz; r1.xyz = cmp(r0.xyz != r0.xyz); r0.w = (int)r1.y | (int)r1.x; r0.w = (int)r1.z | (int)r0.w; if (r0.w != 0) { r0.xyz = float3(1,0,0); } r1.xyz = cmp(r0.xyz < float3(0,0,0)); r1.xyz = r1.xyz ? float3(1,1,1) : 0; r0.w = dot(r1.xyz, r1.xyz); r0.w = cmp(r0.w != 0.000000); if (r0.w != 0) { r0.xyz = float3(0,1,0); } r0.xyz = r0.xyz * gHdrCompressScale.xxx + r4.xyz; r1.xyz = cmp(r0.xyz != r0.xyz); r0.w = (int)r1.y | (int)r1.x; r0.w = (int)r1.z | (int)r0.w; if (r0.w != 0) { r0.xyz = float3(0,0,0); } r1.xyz = gHdrCompressScale.xxx * r2.xyz; r1.x = dot(r1.xyz, float3(0.212500006,0.715399981,0.0720999986)); r0.w = cmp(r1.x != r1.x); r1.w = cmp(r1.x < 0); r0.w = (int)r0.w | (int)r1.w; if (r0.w != 0) { r1.x = 0; } r0.w = cmp(gDancingPixelParams.x < r1.x); r1.y = r0.w ? 1.000000 : 0; o0.xyz = r0.xyz; o0.w = 1; r1.z = 0; o1.xyzw = r1.xyzz; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // using 3Dmigoto v1.2.43 on Tue Aug 23 20:26:52 2016 // // // Buffer Definitions: // // cbuffer $Globals // { // // float4 gTintColour; // Offset: 0 Size: 16 // float4 gOutlineColour; // Offset: 16 Size: 16 [unused] // float4 gOutlineParams; // Offset: 32 Size: 16 [unused] // float4 gCubemapParams; // Offset: 48 Size: 16 // float4 gEnvVar; // Offset: 64 Size: 16 [unused] // row_major float4x4 gFogParameters; // Offset: 80 Size: 64 [unused] // float4 gQuantizedDepthParameters; // Offset: 144 Size: 16 [unused] // float4 gVelocityParameters; // Offset: 160 Size: 16 [unused] // float4 gFinalGammaParameters; // Offset: 176 Size: 16 [unused] // float4 gDiffuseColourPS; // Offset: 240 Size: 16 [unused] // float4 gBlendFactor; // Offset: 256 Size: 16 [unused] // row_major float4x4 gLightingModelTestParameters;// Offset: 272 Size: 64 // float4 gHdrCompressScale; // Offset: 544 Size: 16 // float4 gCarPaintParams; // Offset: 560 Size: 16 [unused] // float4 gPCFKernelScale; // Offset: 576 Size: 16 [unused] // float4 gLightComponentToggler[3]; // Offset: 592 Size: 48 [unused] // float4 gScreenParameters; // Offset: 640 Size: 16 [unused] // float4 gFluidSubColor0; // Offset: 656 Size: 16 [unused] // float4 gFluidSubColor1; // Offset: 672 Size: 16 [unused] // float4 gFluidSubParams0; // Offset: 688 Size: 16 [unused] // float4 gSsaoParams; // Offset: 704 Size: 16 [unused] // float4 gSsaoMisc; // Offset: 720 Size: 16 [unused] // row_major float4x4 gBlurSampleWeights;// Offset: 736 Size: 64 [unused] // float4 gBlurSampleOffsets[8]; // Offset: 800 Size: 128 [unused] // row_major float4x4 gInverseProjectionMatrix;// Offset: 928 Size: 64 [unused] // row_major float4x4 gGlow0Parameters_POST;// Offset: 992 Size: 64 [unused] // row_major float4x4 gGlow1Parameters_POST;// Offset: 1056 Size: 64 [unused] // row_major float4x4 gGlow2Parameters_POST;// Offset: 1120 Size: 64 [unused] // row_major float4x4 gGlow3Parameters_POST;// Offset: 1184 Size: 64 [unused] // float4 gPointLight0Parameters_POST[2];// Offset: 1248 Size: 32 [unused] // float4 gPointLight1Parameters_POST[2];// Offset: 1280 Size: 32 [unused] // float4 gPointLight2Parameters_POST[2];// Offset: 1312 Size: 32 [unused] // float4 gPointLight3Parameters_POST[2];// Offset: 1344 Size: 32 [unused] // float4 gLightAnimationParameters; // Offset: 1376 Size: 16 [unused] // row_major float4x4 gLightAnimationRotationMatrix;// Offset: 1392 Size: 64 [unused] // float4 gSpotLightDirection0_POST; // Offset: 1456 Size: 16 [unused] // float4 gSpotLightDirection1_POST; // Offset: 1472 Size: 16 [unused] // float4 gSpotLightDirection2_POST; // Offset: 1488 Size: 16 [unused] // float4 gSpotLightDirection3_POST; // Offset: 1504 Size: 16 [unused] // float4 gBloomScaleOffset; // Offset: 1520 Size: 16 [unused] // row_major float4x4 gLensFlareColour;// Offset: 1536 Size: 64 [unused] // float4 gScreenColour; // Offset: 1600 Size: 16 [unused] // float4 gCombinedDOFBlurParameters; // Offset: 1616 Size: 16 [unused] // float4 gDOFCameraBlurParameters; // Offset: 1632 Size: 16 [unused] // float4 gDOFParameters; // Offset: 1648 Size: 16 [unused] // float4 gFilmGrainParams; // Offset: 1664 Size: 16 [unused] // float4 gFilmGrainOffsetScale; // Offset: 1680 Size: 16 [unused] // row_major float4x4 gInverseViewProjection2;// Offset: 1696 Size: 64 // row_major float4x4 gPreviousViewProjection;// Offset: 1760 Size: 64 [unused] // row_major float4x4 gCurrToPreviousViewProjection;// Offset: 1824 Size: 64 [unused] // float4 gCombinedVelocityBlurWeights[2];// Offset: 1888 Size: 32 [unused] // row_major float4x4 gCombinedVelocityBlurOffsets;// Offset: 1920 Size: 64 [unused] // float4 gRadialBlurWeights[2]; // Offset: 1984 Size: 32 [unused] // float4 gVelocityParameters2; // Offset: 2016 Size: 16 [unused] // float4 gRadialBlurParams; // Offset: 2032 Size: 16 [unused] // float4 gFinalCompositeParameters; // Offset: 2048 Size: 16 [unused] // float4 gFinalCompositeExposure; // Offset: 2064 Size: 16 [unused] // float4 gColourMatrix[3]; // Offset: 2080 Size: 48 [unused] // float4 gVignetteColour; // Offset: 2128 Size: 16 [unused] // float4 gVignetteParameters; // Offset: 2144 Size: 16 [unused] // float4 gToneMapOptions[2]; // Offset: 2160 Size: 32 [unused] // float4 gBloomOptions; // Offset: 2192 Size: 16 [unused] // float4 gSunCoordinate; // Offset: 2208 Size: 16 [unused] // float4 gCrepuscularParams; // Offset: 2224 Size: 16 [unused] // float4 gCrepuscularDecay; // Offset: 2240 Size: 16 [unused] // float4 gCrepuscularDecayAcc; // Offset: 2256 Size: 16 [unused] // float4 gCrepuscularColour; // Offset: 2272 Size: 16 [unused] // float4 gCubeFaceParams[2]; // Offset: 2288 Size: 32 [unused] // float4 gChromaticAberrationParams; // Offset: 2320 Size: 16 [unused] // float4 gBokehOffsets; // Offset: 2336 Size: 16 [unused] // float4 gCoCParams; // Offset: 2352 Size: 16 [unused] // float4 g8x8SampleOffsets[8]; // Offset: 2368 Size: 128 [unused] // float4 g8x8DepthSampleOffsets[8]; // Offset: 2496 Size: 128 [unused] // float4 gOverlayParameters[2]; // Offset: 2624 Size: 32 [unused] // float4 gSampleOffsets[2]; // Offset: 2656 Size: 32 [unused] // float4 gToneMapOptions2; // Offset: 2688 Size: 16 [unused] // float4 gLuminanceToExposure; // Offset: 2704 Size: 16 [unused] // row_major float4x4 gViewMatrix; // Offset: 2720 Size: 64 [unused] // row_major float4x4 gProjectionMatrix;// Offset: 2784 Size: 64 [unused] // float4 gMaxDistParams; // Offset: 2848 Size: 16 [unused] // row_major float4x4 gIterSampleOffset2dScaleWeight;// Offset: 2864 Size: 64 [unused] // float4 gIterResultBlendingParams; // Offset: 2928 Size: 16 [unused] // float4 gIterMaxDeltaParams; // Offset: 2944 Size: 16 [unused] // float4 gPerspectiveCorrectionParams;// Offset: 2960 Size: 16 [unused] // float4 gHBAOPSParams[6]; // Offset: 2976 Size: 96 [unused] // row_major float4x4 gViewMatrixInverse;// Offset: 3072 Size: 64 [unused] // float4 gPEBlurSampleOffsets; // Offset: 3136 Size: 16 [unused] // row_major float4x4 gShadowMapProjectionViewMatrix0;// Offset: 3152 Size: 64 [unused] // row_major float4x4 gShadowMapProjectionViewMatrix1;// Offset: 3216 Size: 64 [unused] // row_major float4x4 gShadowMapProjectionViewMatrix2;// Offset: 3280 Size: 64 [unused] // row_major float4x4 gShadowMapProjectionViewMatrix3;// Offset: 3344 Size: 64 [unused] // float4 gShadowMapTexelSize; // Offset: 3408 Size: 16 [unused] // float4 gReflectionScale; // Offset: 3424 Size: 16 [unused] // float4 gScreenSpaceReflectionParams;// Offset: 3440 Size: 16 [unused] // float4 gSoftAlphaParams; // Offset: 3456 Size: 16 [unused] // float4 gDynamicLightDistanceCullDepth;// Offset: 3472 Size: 16 [unused] // float4 gEyeSsaoIntensityParams; // Offset: 3488 Size: 16 [unused] // float4 gEyeSsaoColourParams; // Offset: 3504 Size: 16 [unused] // float4 gSkinSsaoColourParams; // Offset: 3520 Size: 16 [unused] // float4 gHairSsaoColourParams; // Offset: 3536 Size: 16 [unused] // row_major float4x4 gPostFxKeyLightParameters;// Offset: 3552 Size: 64 // float4 gPostFxKeyLightScaleParams[2];// Offset: 3616 Size: 32 // float4 gPostFxHeadLightColour; // Offset: 3648 Size: 16 [unused] // row_major float4x4 gPostFxFogParameters;// Offset: 3664 Size: 64 // row_major float4x4 gPostFxShadowMapPackedParams;// Offset: 3728 Size: 64 [unused] // float4 gPostFxCascadedShadowLightMatrices[16];// Offset: 3792 Size: 256 [unused] // float4 gBitMask; // Offset: 4048 Size: 16 [unused] // float4 gFXAAParams[3]; // Offset: 4064 Size: 48 [unused] // float4 gPostFxRimLight2Parameters[2];// Offset: 4112 Size: 32 // float4 gPostFxBounceLightParameters[2];// Offset: 4144 Size: 32 // float4 gPostFxCharRimLightParameters;// Offset: 4176 Size: 16 // float4 gFoliageSsaoColourParams; // Offset: 4192 Size: 16 [unused] // float4 gCameraMotionBlurParams; // Offset: 4208 Size: 16 [unused] // float4 gDancingPixelParams; // Offset: 4224 Size: 16 // float4 gSMAAParamsPS; // Offset: 4240 Size: 16 [unused] // float4 gRimLightFalloffParams; // Offset: 4256 Size: 16 // // } // // cbuffer CameraParameters // { // // float4 gCameraParameters[2]; // Offset: 0 Size: 32 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // gDepthTexture sampler NA NA 0 1 // gGBuffer0Texture sampler NA NA 1 1 // gGBuffer1Texture sampler NA NA 2 1 // gGBuffer2Texture sampler NA NA 3 1 // gGBuffer3Texture sampler NA NA 4 1 // gDynamicLightTexture sampler NA NA 5 1 // gPointClampSampler sampler NA NA 15 1 // gDepthTextureTex texture float4 2d 0 1 // gGBuffer0TextureTex texture float4 2d 1 1 // gGBuffer1TextureTex texture float4 2d 2 1 // gGBuffer2TextureTex texture float4 2d 3 1 // gGBuffer3TextureTex texture float4 2d 4 1 // gDynamicLightTextureTex texture float4 2d 5 1 // gScreenSpaceShadowMap texture float4 2d 118 1 // $Globals cbuffer NA NA 0 1 // CameraParameters cbuffer NA NA 5 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float // COLOR 0 xyzw 1 NONE float // TEXCOORD 0 xy 2 NONE float xy // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Target 0 xyzw 0 TARGET float xyzw // SV_Target 1 xyzw 1 TARGET float xyzw // ps_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[267], immediateIndexed dcl_constantbuffer cb5[1], immediateIndexed dcl_sampler s0, mode_default dcl_sampler s1, mode_default dcl_sampler s2, mode_default dcl_sampler s3, mode_default dcl_sampler s4, mode_default dcl_sampler s5, mode_default dcl_sampler s15, mode_default dcl_resource_texture2d (float,float,float,float) t0 dcl_resource_texture2d (float,float,float,float) t1 dcl_resource_texture2d (float,float,float,float) t2 dcl_resource_texture2d (float,float,float,float) t3 dcl_resource_texture2d (float,float,float,float) t4 dcl_resource_texture2d (float,float,float,float) t5 dcl_resource_texture2d (float,float,float,float) t118 dcl_input_ps linear v2.xy dcl_output o0.xyzw dcl_output o1.xyzw dcl_temps 14 sample_indexable(texture2d)(float,float,float,float) r0.z, v2.xyxx, t0.yzxw, s0 ge r1.x, r0.z, l(1.000000) if_nz r1.x discard_nz l(-1) endif sample_indexable(texture2d)(float,float,float,float) r1.xyzw, v2.xyxx, t1.xyzw, s1 sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v2.xyxx, t2.xyzw, s2 sample_indexable(texture2d)(float,float,float,float) r3.xyzw, v2.xyxx, t3.xyzw, s3 sample_indexable(texture2d)(float,float,float,float) r4.xyzw, v2.xyxx, t4.xyzw, s4 dp3 r5.x, r1.xyzx, r1.xyzx eq r5.x, r5.x, l(0.000000) if_nz r5.x mov r5.xyz, l(0,1.000000,0,0) else mad r5.xyz, r1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000) endif ubfe r1.x, l(8), l(13), r1.w utof r1.x, r1.x mul r1.x, r1.x, l(0.00392156886) mul r1.yzw, r2.xxyz, r2.xxyz mul r2.x, r2.w, l(255.000000) ftoi r2.x, r2.x ubfe r2.y, l(8), l(13), r3.w utof r2.y, r2.y ubfe r2.z, l(8), l(13), r4.w utof r2.z, r2.z mul r2.yw, r2.yyyz, l(0.000000, 0.00392156886, 0.000000, 0.00392156886) mad r0.xy, v2.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000) mov r0.w, l(1.000000) dp4 r6.x, cb0[106].xyzw, r0.xyzw dp4 r6.y, cb0[107].xyzw, r0.xyzw dp4 r6.z, cb0[108].xyzw, r0.xyzw dp4 r0.x, cb0[109].xyzw, r0.xyzw div r0.xyz, r6.xyzx, r0.xxxx sample_indexable(texture2d)(float,float,float,float) r6.xyzw, v2.xyxx, t5.xyzw, s5 and r0.w, r2.x, l(64) add r7.xyz, -r0.xyzx, cb5[0].xyzx dp3 r2.x, r7.xyzx, r7.xyzx sqrt r3.w, r2.x add r3.w, r3.w, -cb0[266].x add r4.w, -cb0[266].x, cb0[266].y div r3.w, r3.w, r4.w add_sat r3.w, -r3.w, l(1.000000) movc r0.w, r0.w, r3.w, l(0) rsq r2.x, r2.x mul r8.xyz, r2.xxxx, r7.xyzx dp3 r3.w, r5.xyzx, cb0[222].xyzx mad r4.w, -r3.w, cb0[259].w, -cb0[259].w add r4.w, r4.w, l(1.000000) max r4.w, r4.w, l(0.000000) dp3 r5.w, r8.xyzx, r5.xyzx max r7.w, r5.w, l(0.000000) add r7.w, -r7.w, cb0[225].z add r7.w, r7.w, l(1.000000) max r7.w, r7.w, l(0.000000) log r8.w, r7.w mul r8.w, r8.w, cb0[224].w exp r8.w, r8.w mul r8.w, r8.w, cb0[225].x mul r7.w, r7.w, l(3.14159274) sincos r7.w, null, r7.w mul r7.w, r7.w, r8.w sample_indexable(texture2d)(float,float,float,float) r8.w, v2.xyxx, t118.yzwx, s15 add r8.w, -r8.w, l(1.000000) add r9.xy, -r0.xzxx, cb0[226].xzxx dp2 r9.x, r9.xyxx, r9.xyxx sqrt r9.x, r9.x add r9.x, r9.x, -cb0[227].y add r9.y, -cb0[227].y, cb0[227].x div_sat r9.x, r9.x, r9.y mul r9.x, r9.x, r9.x dp3 r9.y, cb0[224].xyzx, r5.xyzx max r9.z, r9.y, l(0.000000) mul r9.w, |r7.w|, r9.z dp3 r10.x, cb0[257].xyzx, r5.xyzx max r10.y, r10.x, l(0.000000) mul r10.z, |r7.w|, r10.y mul r11.xyz, r10.zzzz, cb0[258].xyzx mad r11.xyz, cb0[261].xyzx, r9.wwww, r11.xyzx mad r12.xyz, r7.xyzx, r2.xxxx, cb0[224].xyzx dp3 r9.w, r12.xyzx, r12.xyzx rsq r9.w, r9.w mul r12.xyz, r9.wwww, r12.xyzx dp3 r9.w, r5.xyzx, r12.xyzx dp3 r10.z, cb0[224].xyzx, r12.xyzx add r10.w, -r10.z, l(1.000000) mul r11.w, r10.w, r10.w mul r11.w, r11.w, r11.w mul r10.w, r10.w, r11.w mad r2.z, -r2.z, l(0.00392156886), l(1.000000) mad r10.w, r2.z, r10.w, r2.w mul r11.w, r1.x, r1.x mul r12.w, r9.w, r9.w mul r13.x, r11.w, r12.w max r13.x, r13.x, l(0.000010) mad r13.y, -r9.w, r9.w, l(1.000000) div r13.x, r13.y, r13.x mul r13.x, r13.x, l(-1.442695) exp r13.x, r13.x mul r13.y, r11.w, l(3.141590) mul r12.w, r12.w, r12.w mul r12.w, r13.y, r12.w max r12.w, r12.w, l(0.000010) div r12.w, r13.x, r12.w mul r13.x, r5.w, r9.y mul r13.z, r13.x, l(4.000000) add r9.w, r9.w, r9.w mul r13.w, r5.w, r9.w dp3 r12.x, r8.xyzx, r12.xyzx max r12.x, r12.x, l(0.000010) div r12.x, r13.w, r12.x mul r9.y, r9.y, r9.w max r9.w, r10.z, l(0.000010) div r9.y, r9.y, r9.w min r9.y, r9.y, r12.x min r9.y, r9.y, l(1.000000) mul r9.z, r9.z, r10.w mul r9.y, r9.y, r9.z mul r9.y, r12.w, r9.y lt r9.z, r13.x, l(0.000000) min r9.w, r13.z, l(-0.000010) max r10.z, r13.z, l(0.000010) movc r9.z, r9.z, r9.w, r10.z div r9.y, r9.y, r9.z mad r12.xyz, r7.xyzx, r2.xxxx, cb0[257].xyzx dp3 r9.z, r12.xyzx, r12.xyzx rsq r9.z, r9.z mul r12.xyz, r9.zzzz, r12.xyzx dp3 r9.z, r5.xyzx, r12.xyzx dp3 r9.w, cb0[257].xyzx, r12.xyzx add r10.z, -r9.w, l(1.000000) mul r10.w, r10.z, r10.z mul r10.w, r10.w, r10.w mul r10.z, r10.z, r10.w mad r10.z, r2.z, r10.z, r2.w mul r10.w, r9.z, r9.z mul r12.w, r11.w, r10.w max r12.w, r12.w, l(0.000010) mad r13.x, -r9.z, r9.z, l(1.000000) div r12.w, r13.x, r12.w mul r12.w, r12.w, l(-1.442695) exp r12.w, r12.w mul r10.w, r10.w, r10.w mul r10.w, r13.y, r10.w max r10.w, r10.w, l(0.000010) div r10.w, r12.w, r10.w mul r12.w, r5.w, r10.x mul r13.x, r12.w, l(4.000000) add r9.z, r9.z, r9.z mul r13.z, r5.w, r9.z dp3 r12.x, r8.xyzx, r12.xyzx max r12.x, r12.x, l(0.000010) div r12.x, r13.z, r12.x mul r9.z, r10.x, r9.z max r9.w, r9.w, l(0.000010) div r9.z, r9.z, r9.w min r9.z, r9.z, r12.x min r9.z, r9.z, l(1.000000) mul r9.w, r10.z, r10.y mul r9.z, r9.z, r9.w mul r9.z, r10.w, r9.z lt r9.w, r12.w, l(0.000000) min r10.x, r13.x, l(-0.000010) max r10.y, r13.x, l(0.000010) movc r9.w, r9.w, r10.x, r10.y div r9.z, r9.z, r9.w mul r10.xyz, r9.zzzz, cb0[258].xyzx mad r9.yzw, r9.yyyy, cb0[261].xxyz, r10.xxyz mul r9.yzw, |r7.wwww|, r9.yyzw mul r9.yzw, r0.wwww, r9.yyzw mul r10.xyz, r9.xxxx, cb0[259].xyzx max r10.xyz, r10.xyzx, cb0[260].xyzx mul r10.xyz, r4.wwww, r10.xyzx mad r10.xyz, r11.xyzx, r0.wwww, r10.xyzx mul r11.xyz, r9.xxxx, cb0[223].xyzx mul r11.xyz, r11.xyzx, cb0[3].yyyy mul r11.xyz, r8.wwww, r11.xyzx dp3 r0.w, r5.xyzx, r5.xyzx rsq r0.w, r0.w mul r12.xyz, r0.wwww, r5.xyzx mad r13.xzw, -r12.xxyz, r5.wwww, r8.xxyz mad r12.xyz, -r12.xyzx, r3.wwww, cb0[222].xyzx dp3 r0.w, r13.xzwx, r12.xyzx mad r12.xy, r1.xxxx, r1.xxxx, l(0.570000, 0.090000, 0.000000, 0.000000) div r12.xy, r11.wwww, r12.xyxx mul r1.x, r12.y, l(0.450000) mad r4.w, -r12.x, l(0.500000), l(1.000000) mad r7.w, -r5.w, r5.w, l(1.000000) mad r8.w, -r3.w, r3.w, l(1.000000) mul_sat r7.w, r7.w, r8.w sqrt r7.w, r7.w max r8.w, r3.w, r5.w lt r9.x, r8.w, l(0.000000) min r10.w, r8.w, l(-0.000010) max r8.w, r8.w, l(0.000010) movc r8.w, r9.x, r10.w, r8.w div r7.w, r7.w, r8.w max r8.w, r3.w, l(0.000000) max r0.w, r0.w, l(0.000000) mul r0.w, r0.w, r1.x mad r0.w, r0.w, r7.w, r4.w mul r0.w, r0.w, r8.w mad r3.xyz, r11.xyzx, r0.wwww, r3.xyzx mad r7.xyz, r7.xyzx, r2.xxxx, cb0[222].xyzx dp3 r0.w, r7.xyzx, r7.xyzx rsq r0.w, r0.w mul r7.xyz, r0.wwww, r7.xyzx dp3 r0.w, r5.xyzx, r7.xyzx dp3 r1.x, cb0[222].xyzx, r7.xyzx add r2.x, -r1.x, l(1.000000) mul r4.w, r2.x, r2.x mul r4.w, r4.w, r4.w mul r2.x, r2.x, r4.w mad r2.x, r2.z, r2.x, r2.w mul r2.z, r0.w, r0.w mul r2.w, r11.w, r2.z max r2.w, r2.w, l(0.000010) mad r4.w, -r0.w, r0.w, l(1.000000) div r2.w, r4.w, r2.w mul r2.w, r2.w, l(-1.442695) exp r2.w, r2.w mul r2.z, r2.z, r2.z mul r2.z, r13.y, r2.z max r2.z, r2.z, l(0.000010) div r2.z, r2.w, r2.z mul r2.w, r3.w, r5.w mul r4.w, r2.w, l(4.000000) add r0.w, r0.w, r0.w mul r5.x, r5.w, r0.w dp3 r5.y, r8.xyzx, r7.xyzx max r5.y, r5.y, l(0.000010) div r5.x, r5.x, r5.y mul r0.w, r3.w, r0.w max r1.x, r1.x, l(0.000010) div r0.w, r0.w, r1.x min r0.w, r0.w, r5.x min r0.w, r0.w, l(1.000000) mul r1.x, r2.x, r8.w mul r0.w, r0.w, r1.x mul r0.w, r2.z, r0.w lt r1.x, r2.w, l(0.000000) min r2.x, r4.w, l(-0.000010) max r2.z, r4.w, l(0.000010) movc r1.x, r1.x, r2.x, r2.z div r0.w, r0.w, r1.x dp3 r1.x, r6.xyzx, l(0.212500, 0.715400, 0.072100, 0.000000) max r1.x, r1.x, l(0.000010) div r2.xzw, r6.xxyz, r1.xxxx ne r1.x, cb0[3].x, l(1.000000) and r1.x, r1.x, l(0x3f800000) mad r3.xyz, r6.xyzx, r1.xxxx, r3.xyzx mul r2.xzw, r2.xxzw, r6.wwww mul r2.xzw, r1.xxxx, r2.xxzw mad r2.xzw, r0.wwww, r11.xxyz, r2.xxzw mul r2.xzw, r2.xxzw, cb0[20].xxxx mul r5.xyz, r2.yyyy, r9.yzwy add r3.xyz, r10.xyzx, r3.xyzx mad r2.xyz, r2.xzwx, r2.yyyy, r5.xyzx mad r1.xyz, r3.xyzx, r1.yzwy, r2.xyzx add r2.xyz, r2.xyzx, r3.xyzx add r0.xyz, r0.xyzx, -cb5[0].xyzx dp3 r0.y, r0.xyzx, r0.xyzx sqrt r0.y, r0.y mov r3.xz, cb0[222].xxzx mov r3.y, l(0.000100) dp3 r1.w, r3.xyzx, r3.xyzx rsq r1.w, r1.w mul r3.xyz, r1.wwww, r3.xyzx mov r0.w, l(0.000100) dp3 r1.w, r0.xzwx, r0.xzwx rsq r1.w, r1.w mul r0.xzw, r0.xxwz, r1.wwww dp3 r0.x, r3.xyzx, r0.xzwx mad r0.x, r0.x, l(0.500000), l(0.500000) add r3.xyz, -cb0[230].xyzx, cb0[232].xyzx mad r3.xyz, r0.xxxx, r3.xyzx, cb0[230].xyzx add r5.xyz, -cb0[229].xyzx, cb0[231].xyzx mad r0.xzw, r0.xxxx, r5.xxyz, cb0[229].xxyz add r0.x, -r0.x, r0.y mul_sat r0.x, r0.z, r0.x add r0.y, r0.w, l(-1.000000) mad r0.x, r0.x, r0.y, l(1.000000) mad r0.yzw, r1.xxyz, cb0[0].xxyz, -r3.xxyz mad r0.xyz, r0.xxxx, r0.yzwy, r3.xyzx ne r1.xyz, r0.xyzx, r0.xyzx or r0.w, r1.y, r1.x or r0.w, r1.z, r0.w if_nz r0.w mov r0.xyz, l(1.000000,0,0,0) endif lt r1.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000) and r1.xyz, r1.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0) dp3 r0.w, r1.xyzx, r1.xyzx ne r0.w, r0.w, l(0.000000) if_nz r0.w mov r0.xyz, l(0,1.000000,0,0) endif mad r0.xyz, r0.xyzx, cb0[34].xxxx, r4.xyzx ne r1.xyz, r0.xyzx, r0.xyzx or r0.w, r1.y, r1.x or r0.w, r1.z, r0.w if_nz r0.w mov r0.xyz, l(0,0,0,0) endif mul r1.xyz, r2.xyzx, cb0[34].xxxx dp3 r1.x, r1.xyzx, l(0.212500, 0.715400, 0.072100, 0.000000) ne r0.w, r1.x, r1.x lt r1.w, r1.x, l(0.000000) or r0.w, r0.w, r1.w if_nz r0.w mov r1.x, l(0) endif lt r0.w, cb0[264].x, r1.x and r1.y, r0.w, l(0x3f800000) mov o0.xyz, r0.xyzx mov o0.w, l(1.000000) mov r1.z, l(0) mov o1.xyzw, r1.xyzz ret // Approximately 319 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code] These shaders control some lighting (which is OK with some exceptions) and dynamic shadows produced by light. They are at screen depth by default and I couldn't find any other shader that controls them. Look where I use "iniparams.w" and the lines before it (please, don't pay attention to other variables and commented things I had tried in other parts of the shader, like r25 and r26. They are unused). With that fix (when you press "b"), dynamic shadows are fixed, BUT the rest of lighting is pretty much broken (with more separation). Before: http://u.cubeupload.com/masterotaku/deadrising3014.jpg After: http://u.cubeupload.com/masterotaku/deadrising3015.jpg Some places look a lot worse that that. I chose a moderate example. I couldn't find another place in the shader to correct that (for now). In following uses of r6, using the variable that I called "oldr6" (which doesn't have the fix) didn't make any difference. In line 264, there is this: [code]r8.w = gScreenSpaceShadowMap.Sample(gPointClampSampler_s, v2.xy).x;[/code] If I use "newv2" there instead of "v2", it fixes the shadows of the other 3 pixel shaders I had already fixed. If I disable the fix in those shaders, I can see that their shadows are correct but there is haloing in the environment and objects. That's why I though I could be making the same mistake with the dynamic shadows I showed you first. My question is: is lighting fixable in this shader somewhere after breaking it, or do I have to find an unknown shadows shader? If someone knows how to fix this, please help. By the way, dumping this shader changed/disabled some specular reflections. helifax told me that after I fix this I should use "export_hlsl=3" to get the fixed shader in ASM and fix the differences compared to the original ASM shader.
Now I'm fixing Dead Rising 3 (the last time someone asked or a fix was here: https://forums.geforce.com/default/topic/772901/3d-vision/dead-rising-3-3d-pics-/, more than 2 years ago, unless there is a newer thread).

Basically, I have fixed 3 shadows pixel shaders, a few haloing issues and made some HUD options and improvements. I have also disabled sun rays (the image of one eye was copy-pasted to the other, which is wrong).

Edit: IMPORTANT: I'm using the The Witcher 3 profile (that uses the profile specified in the helixmod blog post). Otherwise, there are broken effects that render the same for both eyes. I have added "deadrising3.exe" to the profile instead of modifying the Dead Rising 3 profile.

Here is my WIP fix (hunting mode is enabled (hunting=2)):

https://www.dropbox.com/s/vqx4ypr59ed6gsc/deadrising3_wip_fix.7z?dl=0

I have changed the StereoParams from t125 to t119 in d3dx.ini (it interfered with some shader I dumped and probably deleted after seeing that it was useless). You can see the hotkeys in d3dx.ini. With "b", you apply or not the partial fix of what I'm going to say now.

I'm having trouble with two lighting pixel shaders: df64b0dd4effd2f4-ps_replace.txt (normal gameplay) and ab4b3a46366f29f8-ps_replace.txt (cutscenes).

They do basically the same.

Content of df64b0dd4effd2f4-ps_replace.txt (modified by me):

//Lighting PS (incorrect in HLSL).
// ---- Created with 3Dmigoto v1.2.43 on Tue Aug 23 20:26:52 2016

cbuffer _Globals : register(b0)
{
float4 gTintColour : packoffset(c0);
float4 gOutlineColour : packoffset(c1);
float4 gOutlineParams : packoffset(c2);
float4 gCubemapParams : packoffset(c3);
float4 gEnvVar : packoffset(c4);
row_major float4x4 gFogParameters : packoffset(c5);
float4 gQuantizedDepthParameters : packoffset(c9);
float4 gVelocityParameters : packoffset(c10);
float4 gFinalGammaParameters : packoffset(c11);
float4 gDiffuseColourPS : packoffset(c15);
float4 gBlendFactor : packoffset(c16);
row_major float4x4 gLightingModelTestParameters : packoffset(c17);
float4 gHdrCompressScale : packoffset(c34);
float4 gCarPaintParams : packoffset(c35);
float4 gPCFKernelScale : packoffset(c36);
float4 gLightComponentToggler[3] : packoffset(c37);
float4 gScreenParameters : packoffset(c40);
float4 gFluidSubColor0 : packoffset(c41);
float4 gFluidSubColor1 : packoffset(c42);
float4 gFluidSubParams0 : packoffset(c43);
float4 gSsaoParams : packoffset(c44);
float4 gSsaoMisc : packoffset(c45);
row_major float4x4 gBlurSampleWeights : packoffset(c46);
float4 gBlurSampleOffsets[8] : packoffset(c50);
row_major float4x4 gInverseProjectionMatrix : packoffset(c58);
row_major float4x4 gGlow0Parameters_POST : packoffset(c62);
row_major float4x4 gGlow1Parameters_POST : packoffset(c66);
row_major float4x4 gGlow2Parameters_POST : packoffset(c70);
row_major float4x4 gGlow3Parameters_POST : packoffset(c74);
float4 gPointLight0Parameters_POST[2] : packoffset(c78);
float4 gPointLight1Parameters_POST[2] : packoffset(c80);
float4 gPointLight2Parameters_POST[2] : packoffset(c82);
float4 gPointLight3Parameters_POST[2] : packoffset(c84);
float4 gLightAnimationParameters : packoffset(c86);
row_major float4x4 gLightAnimationRotationMatrix : packoffset(c87);
float4 gSpotLightDirection0_POST : packoffset(c91);
float4 gSpotLightDirection1_POST : packoffset(c92);
float4 gSpotLightDirection2_POST : packoffset(c93);
float4 gSpotLightDirection3_POST : packoffset(c94);
float4 gBloomScaleOffset : packoffset(c95);
row_major float4x4 gLensFlareColour : packoffset(c96);
float4 gScreenColour : packoffset(c100);
float4 gCombinedDOFBlurParameters : packoffset(c101);
float4 gDOFCameraBlurParameters : packoffset(c102);
float4 gDOFParameters : packoffset(c103);
float4 gFilmGrainParams : packoffset(c104);
float4 gFilmGrainOffsetScale : packoffset(c105);
row_major float4x4 gInverseViewProjection2 : packoffset(c106);
row_major float4x4 gPreviousViewProjection : packoffset(c110);
row_major float4x4 gCurrToPreviousViewProjection : packoffset(c114);
float4 gCombinedVelocityBlurWeights[2] : packoffset(c118);
row_major float4x4 gCombinedVelocityBlurOffsets : packoffset(c120);
float4 gRadialBlurWeights[2] : packoffset(c124);
float4 gVelocityParameters2 : packoffset(c126);
float4 gRadialBlurParams : packoffset(c127);
float4 gFinalCompositeParameters : packoffset(c128);
float4 gFinalCompositeExposure : packoffset(c129);
float4 gColourMatrix[3] : packoffset(c130);
float4 gVignetteColour : packoffset(c133);
float4 gVignetteParameters : packoffset(c134);
float4 gToneMapOptions[2] : packoffset(c135);
float4 gBloomOptions : packoffset(c137);
float4 gSunCoordinate : packoffset(c138);
float4 gCrepuscularParams : packoffset(c139);
float4 gCrepuscularDecay : packoffset(c140);
float4 gCrepuscularDecayAcc : packoffset(c141);
float4 gCrepuscularColour : packoffset(c142);
float4 gCubeFaceParams[2] : packoffset(c143);
float4 gChromaticAberrationParams : packoffset(c145);
float4 gBokehOffsets : packoffset(c146);
float4 gCoCParams : packoffset(c147);
float4 g8x8SampleOffsets[8] : packoffset(c148);
float4 g8x8DepthSampleOffsets[8] : packoffset(c156);
float4 gOverlayParameters[2] : packoffset(c164);
float4 gSampleOffsets[2] : packoffset(c166);
float4 gToneMapOptions2 : packoffset(c168);
float4 gLuminanceToExposure : packoffset(c169);
row_major float4x4 gViewMatrix : packoffset(c170);
row_major float4x4 gProjectionMatrix : packoffset(c174);
float4 gMaxDistParams : packoffset(c178);
row_major float4x4 gIterSampleOffset2dScaleWeight : packoffset(c179);
float4 gIterResultBlendingParams : packoffset(c183);
float4 gIterMaxDeltaParams : packoffset(c184);
float4 gPerspectiveCorrectionParams : packoffset(c185);
float4 gHBAOPSParams[6] : packoffset(c186);
row_major float4x4 gViewMatrixInverse : packoffset(c192);
float4 gPEBlurSampleOffsets : packoffset(c196);
row_major float4x4 gShadowMapProjectionViewMatrix0 : packoffset(c197);
row_major float4x4 gShadowMapProjectionViewMatrix1 : packoffset(c201);
row_major float4x4 gShadowMapProjectionViewMatrix2 : packoffset(c205);
row_major float4x4 gShadowMapProjectionViewMatrix3 : packoffset(c209);
float4 gShadowMapTexelSize : packoffset(c213);
float4 gReflectionScale : packoffset(c214);
float4 gScreenSpaceReflectionParams : packoffset(c215);
float4 gSoftAlphaParams : packoffset(c216);
float4 gDynamicLightDistanceCullDepth : packoffset(c217);
float4 gEyeSsaoIntensityParams : packoffset(c218);
float4 gEyeSsaoColourParams : packoffset(c219);
float4 gSkinSsaoColourParams : packoffset(c220);
float4 gHairSsaoColourParams : packoffset(c221);
row_major float4x4 gPostFxKeyLightParameters : packoffset(c222);
float4 gPostFxKeyLightScaleParams[2] : packoffset(c226);
float4 gPostFxHeadLightColour : packoffset(c228);
row_major float4x4 gPostFxFogParameters : packoffset(c229);
row_major float4x4 gPostFxShadowMapPackedParams : packoffset(c233);
float4 gPostFxCascadedShadowLightMatrices[16] : packoffset(c237);
float4 gBitMask : packoffset(c253);
float4 gFXAAParams[3] : packoffset(c254);
float4 gPostFxRimLight2Parameters[2] : packoffset(c257);
float4 gPostFxBounceLightParameters[2] : packoffset(c259);
float4 gPostFxCharRimLightParameters : packoffset(c261);
float4 gFoliageSsaoColourParams : packoffset(c262);
float4 gCameraMotionBlurParams : packoffset(c263);
float4 gDancingPixelParams : packoffset(c264);
float4 gSMAAParamsPS : packoffset(c265);
float4 gRimLightFalloffParams : packoffset(c266);
}

cbuffer CameraParameters : register(b5)
{
float4 gCameraParameters[2] : packoffset(c0);
}

SamplerState gDepthTexture_s : register(s0);
SamplerState gGBuffer0Texture_s : register(s1);
SamplerState gGBuffer1Texture_s : register(s2);
SamplerState gGBuffer2Texture_s : register(s3);
SamplerState gGBuffer3Texture_s : register(s4);
SamplerState gDynamicLightTexture_s : register(s5);
SamplerState gPointClampSampler_s : register(s15);
Texture2D<float4> gDepthTextureTex : register(t0);
Texture2D<float4> gGBuffer0TextureTex : register(t1);
Texture2D<float4> gGBuffer1TextureTex : register(t2);
Texture2D<float4> gGBuffer2TextureTex : register(t3);
Texture2D<float4> gGBuffer3TextureTex : register(t4);
Texture2D<float4> gDynamicLightTextureTex : register(t5);
Texture2D<float4> gScreenSpaceShadowMap : register(t118);


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


void main(
float4 v0 : SV_Position0,
float4 v1 : COLOR0,
float2 v2 : TEXCOORD0,
out float4 o0 : SV_Target0,
out float4 o1 : SV_Target1)
{
float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13;
uint4 bitmask, uiDest;
float4 fDest;

float4 iniparams= IniParams.Load(0);
float4 stereo = StereoParams.Load(0);
float separation = stereo.x;
float convergence = stereo.y;

r0.z = gDepthTextureTex.Sample(gDepthTexture_s, v2.xy).x;
r1.x = cmp(r0.z >= 1);
if (r1.x != 0) {
if (-1 != 0) discard;
}
r1.xyzw = gGBuffer0TextureTex.Sample(gGBuffer0Texture_s, v2.xy).xyzw;
r2.xyzw = gGBuffer1TextureTex.Sample(gGBuffer1Texture_s, v2.xy).xyzw;
r3.xyzw = gGBuffer2TextureTex.Sample(gGBuffer2Texture_s, v2.xy).xyzw;
r4.xyzw = gGBuffer3TextureTex.Sample(gGBuffer3Texture_s, v2.xy).xyzw;
r5.x = dot(r1.xyz, r1.xyz);
r5.x = cmp(r5.x == 0.000000);
if (r5.x != 0) {
r5.xyz = float3(0,1,0);
} else {
r5.xyz = r1.xyz * float3(2,2,2) + float3(-1,-1,-1);
}
if (8 == 0) r1.x = 0; else if (8+13 < 32) { r1.x = (uint)r1.w << (32-(8 + 13)); r1.x = (uint)r1.x >> (32-8); } else r1.x = (uint)r1.w >> 13;
r1.x = (uint)r1.x;
r1.x = 0.00392156886 * r1.x;
r1.yzw = r2.xyz * r2.xyz;
r2.x = 255 * r2.w;
r2.x = (int)r2.x;
if (8 == 0) r2.y = 0; else if (8+13 < 32) { r2.y = (uint)r3.w << (32-(8 + 13)); r2.y = (uint)r2.y >> (32-8); } else r2.y = (uint)r3.w >> 13;
r2.y = (uint)r2.y;
if (8 == 0) r2.z = 0; else if (8+13 < 32) { r2.z = (uint)r4.w << (32-(8 + 13)); r2.z = (uint)r2.z >> (32-8); } else r2.z = (uint)r4.w >> 13;
r2.z = (uint)r2.z;
r2.yw = float2(0.00392156886,0.00392156886) * r2.yz;
r0.xy = v2.xy * float2(2,-2) + float2(-1,1);
r0.w = 1;

r6.x = dot(gInverseViewProjection2._m00_m01_m02_m03, r0.xyzw);
r6.y = dot(gInverseViewProjection2._m10_m11_m12_m13, r0.xyzw);
r6.z = dot(gInverseViewProjection2._m20_m21_m22_m23, r0.xyzw);

float shdepth;
shdepth=dot(gInverseViewProjection2._m30_m31_m32_m33, r0.xyzw);

r0.x = dot(gInverseViewProjection2._m30_m31_m32_m33, r0.xyzw);
r0.xyz = r6.xyz / r0.xxx;

//Multiply by 0 to disable lighting. newv2.x+=separation*(shdepth*(convergence*0.5)-0.5); fixes shadows, screws lighting.
float2 newv2;
newv2.xy=v2.xy;
newv2.x+=separation*(shdepth*convergence*0.5-0.5);

if (iniparams.w==1)
{
r6.xyzw = gDynamicLightTextureTex.Sample(gDynamicLightTexture_s, newv2.xy).xyzw;
}
else
{
r6.xyzw = gDynamicLightTextureTex.Sample(gDynamicLightTexture_s, v2.xy).xyzw;
}

float4 oldr6;
oldr6.xyzw = gDynamicLightTextureTex.Sample(gDynamicLightTexture_s, newv2.xy).xyzw;
r0.w = (int)r2.x & 64;

float4 r26;
r26.xyz = gCameraParameters[0].xyz;
r26.x -= stereo.x*(-r26.z - stereo.y)/v2.x;

//r7.xyz = r26.xyz + -r0.xyz;
r7.xyz = gCameraParameters[0].xyz + -r0.xyz;
r2.x = dot(r7.xyz, r7.xyz);
r3.w = sqrt(r2.x);
r3.w = -gRimLightFalloffParams.x + r3.w;
r4.w = gRimLightFalloffParams.y + -gRimLightFalloffParams.x;
r3.w = r3.w / r4.w;
r3.w = saturate(1 + -r3.w);
r0.w = r0.w ? r3.w : 0;
r2.x = rsqrt(r2.x);

float4 r25;
r25.xyz = r7.xyz * r2.xxx;
r25.x -= stereo.x*(-r25.z - stereo.y)*0.4640625*(16/9);
//r8.xyz = r25.xyz;

r8.xyz = r7.xyz * r2.xxx;
r3.w = dot(r5.xyz, gPostFxKeyLightParameters._m00_m01_m02);
r4.w = -r3.w * gPostFxBounceLightParameters[0].w + -gPostFxBounceLightParameters[0].w;
r4.w = 1 + r4.w;
r4.w = max(0, r4.w);
r5.w = dot(r8.xyz, r5.xyz);
r7.w = max(0, r5.w);
r7.w = gPostFxKeyLightParameters._m32 + -r7.w;
r7.w = 1 + r7.w;
r7.w = max(0, r7.w);
r8.w = log2(r7.w);
r8.w = gPostFxKeyLightParameters._m23 * r8.w;
r8.w = exp2(r8.w);
r8.w = gPostFxKeyLightParameters._m30 * r8.w;
r7.w = 3.14159274 * r7.w;
r7.w = sin(r7.w);
r7.w = r8.w * r7.w;

//Shadows.
r8.w = gScreenSpaceShadowMap.Sample(gPointClampSampler_s, v2.xy).x;
r8.w = 1 + -r8.w;
r9.xy = gPostFxKeyLightScaleParams[0].xz + -r0.xz;
r9.x = dot(r9.xy, r9.xy);
r9.x = sqrt(r9.x);
r9.x = -gPostFxKeyLightScaleParams[1].y + r9.x;
r9.y = gPostFxKeyLightScaleParams[1].x + -gPostFxKeyLightScaleParams[1].y;
r9.x = saturate(r9.x / r9.y);
r9.x = r9.x * r9.x;
r9.y = dot(gPostFxKeyLightParameters._m20_m21_m22, r5.xyz);
r9.z = max(0, r9.y);
r9.w = r9.z * abs(r7.w);
r10.x = dot(gPostFxRimLight2Parameters[0].xyz, r5.xyz);
r10.y = max(0, r10.x);
r10.z = r10.y * abs(r7.w);
r11.xyz = gPostFxRimLight2Parameters[1].xyz * r10.zzz;
r11.xyz = gPostFxCharRimLightParameters.xyz * r9.www + r11.xyz;
r12.xyz = r7.xyz * r2.xxx + gPostFxKeyLightParameters._m20_m21_m22;
r9.w = dot(r12.xyz, r12.xyz);
r9.w = rsqrt(r9.w);
r12.xyz = r12.xyz * r9.www;
r9.w = dot(r5.xyz, r12.xyz);
r10.z = dot(gPostFxKeyLightParameters._m20_m21_m22, r12.xyz);
r10.w = 1 + -r10.z;
r11.w = r10.w * r10.w;
r11.w = r11.w * r11.w;
r10.w = r11.w * r10.w;
r2.z = -r2.z * 0.00392156886 + 1;
r10.w = r2.z * r10.w + r2.w;
r11.w = r1.x * r1.x;
r12.w = r9.w * r9.w;
r13.x = r12.w * r11.w;
r13.x = max(9.99999975e-006, r13.x);
r13.y = -r9.w * r9.w + 1;
r13.x = r13.y / r13.x;
r13.x = -1.44269502 * r13.x;
r13.x = exp2(r13.x);
r13.y = 3.14159012 * r11.w;
r12.w = r12.w * r12.w;
r12.w = r12.w * r13.y;
r12.w = max(9.99999975e-006, r12.w);
r12.w = r13.x / r12.w;
r13.x = r9.y * r5.w;
r13.z = 4 * r13.x;
r9.w = r9.w + r9.w;
r13.w = r9.w * r5.w;
r12.x = dot(r8.xyz, r12.xyz);
r12.x = max(9.99999975e-006, r12.x);
r12.x = r13.w / r12.x;
r9.y = r9.w * r9.y;
r9.w = max(9.99999975e-006, r10.z);
r9.y = r9.y / r9.w;
r9.y = min(r12.x, r9.y);
r9.y = min(1, r9.y);
r9.z = r10.w * r9.z;
r9.y = r9.z * r9.y;
r9.y = r9.y * r12.w;
r9.z = cmp(r13.x < 0);
r9.w = min(-9.99999975e-006, r13.z);
r10.z = max(9.99999975e-006, r13.z);
r9.z = r9.z ? r9.w : r10.z;
r9.y = r9.y / r9.z;
r12.xyz = r7.xyz * r2.xxx + gPostFxRimLight2Parameters[0].xyz;
r9.z = dot(r12.xyz, r12.xyz);
r9.z = rsqrt(r9.z);
r12.xyz = r12.xyz * r9.zzz;
r9.z = dot(r5.xyz, r12.xyz);
r9.w = dot(gPostFxRimLight2Parameters[0].xyz, r12.xyz);
r10.z = 1 + -r9.w;
r10.w = r10.z * r10.z;
r10.w = r10.w * r10.w;
r10.z = r10.w * r10.z;
r10.z = r2.z * r10.z + r2.w;
r10.w = r9.z * r9.z;
r12.w = r10.w * r11.w;
r12.w = max(9.99999975e-006, r12.w);
r13.x = -r9.z * r9.z + 1;
r12.w = r13.x / r12.w;
r12.w = -1.44269502 * r12.w;
r12.w = exp2(r12.w);
r10.w = r10.w * r10.w;
r10.w = r10.w * r13.y;
r10.w = max(9.99999975e-006, r10.w);
r10.w = r12.w / r10.w;
r12.w = r10.x * r5.w;
r13.x = 4 * r12.w;
r9.z = r9.z + r9.z;
r13.z = r9.z * r5.w;
r12.x = dot(r8.xyz, r12.xyz);
r12.x = max(9.99999975e-006, r12.x);
r12.x = r13.z / r12.x;
r9.z = r9.z * r10.x;
r9.w = max(9.99999975e-006, r9.w);
r9.z = r9.z / r9.w;
r9.z = min(r12.x, r9.z);
r9.z = min(1, r9.z);
r9.w = r10.y * r10.z;
r9.z = r9.w * r9.z;
r9.z = r9.z * r10.w;
r9.w = cmp(r12.w < 0);
r10.x = min(-9.99999975e-006, r13.x);
r10.y = max(9.99999975e-006, r13.x);
r9.w = r9.w ? r10.x : r10.y;
r9.z = r9.z / r9.w;
r10.xyz = gPostFxRimLight2Parameters[1].xyz * r9.zzz;
r9.yzw = r9.yyy * gPostFxCharRimLightParameters.xyz + r10.xyz;
r9.yzw = r9.yzw * abs(r7.www);
r9.yzw = r9.yzw * r0.www;
r10.xyz = gPostFxBounceLightParameters[0].xyz * r9.xxx;
r10.xyz = max(gPostFxBounceLightParameters[1].xyz, r10.xyz);
r10.xyz = r10.xyz * r4.www;
r10.xyz = r11.xyz * r0.www + r10.xyz;
r11.xyz = gPostFxKeyLightParameters._m10_m11_m12 * r9.xxx;
r11.xyz = gCubemapParams.yyy * r11.xyz;
r11.xyz = r11.xyz * r8.www;
r0.w = dot(r5.xyz, r5.xyz);
r0.w = rsqrt(r0.w);
r12.xyz = r5.xyz * r0.www;
r13.xzw = -r12.xyz * r5.www + r8.xyz;
r12.xyz = -r12.xyz * r3.www + gPostFxKeyLightParameters._m00_m01_m02;
r0.w = dot(r13.xzw, r12.xyz);
r12.xy = r1.xx * r1.xx + float2(0.569999993,0.0900000036);
r12.xy = r11.ww / r12.xy;
r1.x = 0.449999988 * r12.y;
r4.w = -r12.x * 0.5 + 1;
r7.w = -r5.w * r5.w + 1;
r8.w = -r3.w * r3.w + 1;
r7.w = saturate(r8.w * r7.w);
r7.w = sqrt(r7.w);
r8.w = max(r5.w, r3.w);
r9.x = cmp(r8.w < 0);
r10.w = min(-9.99999975e-006, r8.w);
r8.w = max(9.99999975e-006, r8.w);
r8.w = r9.x ? r10.w : r8.w;
r7.w = r7.w / r8.w;
r8.w = max(0, r3.w);
r0.w = max(0, r0.w);
r0.w = r1.x * r0.w;
r0.w = r0.w * r7.w + r4.w;
r0.w = r8.w * r0.w;
r3.xyz = r11.xyz * r0.www + r3.xyz;
r7.xyz = r7.xyz * r2.xxx + gPostFxKeyLightParameters._m00_m01_m02;
r0.w = dot(r7.xyz, r7.xyz);
r0.w = rsqrt(r0.w);
r7.xyz = r7.xyz * r0.www;
r0.w = dot(r5.xyz, r7.xyz);
r1.x = dot(gPostFxKeyLightParameters._m00_m01_m02, r7.xyz);
r2.x = 1 + -r1.x;
r4.w = r2.x * r2.x;
r4.w = r4.w * r4.w;
r2.x = r4.w * r2.x;
r2.x = r2.z * r2.x + r2.w;
r2.z = r0.w * r0.w;
r2.w = r2.z * r11.w;
r2.w = max(9.99999975e-006, r2.w);
r4.w = -r0.w * r0.w + 1;
r2.w = r4.w / r2.w;
r2.w = -1.44269502 * r2.w;
r2.w = exp2(r2.w);
r2.z = r2.z * r2.z;
r2.z = r2.z * r13.y;
r2.z = max(9.99999975e-006, r2.z);
r2.z = r2.w / r2.z;
r2.w = r5.w * r3.w;
r4.w = 4 * r2.w;
r0.w = r0.w + r0.w;
r5.x = r0.w * r5.w;
r5.y = dot(r8.xyz, r7.xyz);
r5.y = max(9.99999975e-006, r5.y);
r5.x = r5.x / r5.y;
r0.w = r0.w * r3.w;
r1.x = max(9.99999975e-006, r1.x);
r0.w = r0.w / r1.x;
r0.w = min(r5.x, r0.w);
r0.w = min(1, r0.w);
r1.x = r8.w * r2.x;
r0.w = r1.x * r0.w;
r0.w = r0.w * r2.z;
r1.x = cmp(r2.w < 0);
r2.x = min(-9.99999975e-006, r4.w);
r2.z = max(9.99999975e-006, r4.w);
r1.x = r1.x ? r2.x : r2.z;
r0.w = r0.w / r1.x;
r1.x = dot(r6.xyz, float3(0.212500006,0.715399981,0.0720999986));
r1.x = max(9.99999975e-006, r1.x);
r2.xzw = r6.xyz / r1.xxx;
r1.x = cmp(gCubemapParams.x != 1.000000);
r1.x = r1.x ? 1.000000 : 0;
r3.xyz = r6.xyz * r1.xxx + r3.xyz;
r2.xzw = r6.www * r2.xzw;
r2.xzw = r2.xzw * r1.xxx;
r2.xzw = r0.www * r11.xyz + r2.xzw;
r2.xzw = gLightingModelTestParameters._m30_m30_m30 * r2.xzw;
r5.xyz = r9.yzw * r2.yyy;
r3.xyz = r3.xyz + r10.xyz;
r2.xyz = r2.xzw * r2.yyy + r5.xyz;
r1.xyz = r3.xyz * r1.yzw + r2.xyz;
r2.xyz = r3.xyz + r2.xyz;
r0.xyz = -gCameraParameters[0].xyz + r0.xyz;
r0.y = dot(r0.xyz, r0.xyz);
r0.y = sqrt(r0.y);
r3.xz = gPostFxKeyLightParameters._m00_m02;
r3.y = 9.99999975e-005;
r1.w = dot(r3.xyz, r3.xyz);
r1.w = rsqrt(r1.w);
r3.xyz = r3.xyz * r1.www;
r0.w = 9.99999975e-005;
r1.w = dot(r0.xzw, r0.xzw);
r1.w = rsqrt(r1.w);
r0.xzw = r1.www * r0.xwz;
r0.x = dot(r3.xyz, r0.xzw);
r0.x = r0.x * 0.5 + 0.5;
r3.xyz = gPostFxFogParameters._m30_m31_m32 + -gPostFxFogParameters._m10_m11_m12;
r3.xyz = r0.xxx * r3.xyz + gPostFxFogParameters._m10_m11_m12;
r5.xyz = gPostFxFogParameters._m20_m21_m22 + -gPostFxFogParameters._m00_m01_m02;
r0.xzw = r0.xxx * r5.xyz + gPostFxFogParameters._m00_m01_m02;
r0.x = r0.y + -r0.x;
r0.x = saturate(r0.x * r0.z);
r0.y = -1 + r0.w;
r0.x = r0.x * r0.y + 1;
r0.yzw = r1.xyz * gTintColour.xyz + -r3.xyz;
r0.xyz = r0.xxx * r0.yzw + r3.xyz;
r1.xyz = cmp(r0.xyz != r0.xyz);
r0.w = (int)r1.y | (int)r1.x;
r0.w = (int)r1.z | (int)r0.w;
if (r0.w != 0) {
r0.xyz = float3(1,0,0);
}
r1.xyz = cmp(r0.xyz < float3(0,0,0));
r1.xyz = r1.xyz ? float3(1,1,1) : 0;
r0.w = dot(r1.xyz, r1.xyz);
r0.w = cmp(r0.w != 0.000000);
if (r0.w != 0) {
r0.xyz = float3(0,1,0);
}
r0.xyz = r0.xyz * gHdrCompressScale.xxx + r4.xyz;
r1.xyz = cmp(r0.xyz != r0.xyz);
r0.w = (int)r1.y | (int)r1.x;
r0.w = (int)r1.z | (int)r0.w;
if (r0.w != 0) {
r0.xyz = float3(0,0,0);
}
r1.xyz = gHdrCompressScale.xxx * r2.xyz;
r1.x = dot(r1.xyz, float3(0.212500006,0.715399981,0.0720999986));
r0.w = cmp(r1.x != r1.x);
r1.w = cmp(r1.x < 0);
r0.w = (int)r0.w | (int)r1.w;
if (r0.w != 0) {
r1.x = 0;
}
r0.w = cmp(gDancingPixelParams.x < r1.x);
r1.y = r0.w ? 1.000000 : 0;
o0.xyz = r0.xyz;
o0.w = 1;
r1.z = 0;
o1.xyzw = r1.xyzz;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// using 3Dmigoto v1.2.43 on Tue Aug 23 20:26:52 2016
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
// float4 gTintColour; // Offset: 0 Size: 16
// float4 gOutlineColour; // Offset: 16 Size: 16 [unused]
// float4 gOutlineParams; // Offset: 32 Size: 16 [unused]
// float4 gCubemapParams; // Offset: 48 Size: 16
// float4 gEnvVar; // Offset: 64 Size: 16 [unused]
// row_major float4x4 gFogParameters; // Offset: 80 Size: 64 [unused]
// float4 gQuantizedDepthParameters; // Offset: 144 Size: 16 [unused]
// float4 gVelocityParameters; // Offset: 160 Size: 16 [unused]
// float4 gFinalGammaParameters; // Offset: 176 Size: 16 [unused]
// float4 gDiffuseColourPS; // Offset: 240 Size: 16 [unused]
// float4 gBlendFactor; // Offset: 256 Size: 16 [unused]
// row_major float4x4 gLightingModelTestParameters;// Offset: 272 Size: 64
// float4 gHdrCompressScale; // Offset: 544 Size: 16
// float4 gCarPaintParams; // Offset: 560 Size: 16 [unused]
// float4 gPCFKernelScale; // Offset: 576 Size: 16 [unused]
// float4 gLightComponentToggler[3]; // Offset: 592 Size: 48 [unused]
// float4 gScreenParameters; // Offset: 640 Size: 16 [unused]
// float4 gFluidSubColor0; // Offset: 656 Size: 16 [unused]
// float4 gFluidSubColor1; // Offset: 672 Size: 16 [unused]
// float4 gFluidSubParams0; // Offset: 688 Size: 16 [unused]
// float4 gSsaoParams; // Offset: 704 Size: 16 [unused]
// float4 gSsaoMisc; // Offset: 720 Size: 16 [unused]
// row_major float4x4 gBlurSampleWeights;// Offset: 736 Size: 64 [unused]
// float4 gBlurSampleOffsets[8]; // Offset: 800 Size: 128 [unused]
// row_major float4x4 gInverseProjectionMatrix;// Offset: 928 Size: 64 [unused]
// row_major float4x4 gGlow0Parameters_POST;// Offset: 992 Size: 64 [unused]
// row_major float4x4 gGlow1Parameters_POST;// Offset: 1056 Size: 64 [unused]
// row_major float4x4 gGlow2Parameters_POST;// Offset: 1120 Size: 64 [unused]
// row_major float4x4 gGlow3Parameters_POST;// Offset: 1184 Size: 64 [unused]
// float4 gPointLight0Parameters_POST[2];// Offset: 1248 Size: 32 [unused]
// float4 gPointLight1Parameters_POST[2];// Offset: 1280 Size: 32 [unused]
// float4 gPointLight2Parameters_POST[2];// Offset: 1312 Size: 32 [unused]
// float4 gPointLight3Parameters_POST[2];// Offset: 1344 Size: 32 [unused]
// float4 gLightAnimationParameters; // Offset: 1376 Size: 16 [unused]
// row_major float4x4 gLightAnimationRotationMatrix;// Offset: 1392 Size: 64 [unused]
// float4 gSpotLightDirection0_POST; // Offset: 1456 Size: 16 [unused]
// float4 gSpotLightDirection1_POST; // Offset: 1472 Size: 16 [unused]
// float4 gSpotLightDirection2_POST; // Offset: 1488 Size: 16 [unused]
// float4 gSpotLightDirection3_POST; // Offset: 1504 Size: 16 [unused]
// float4 gBloomScaleOffset; // Offset: 1520 Size: 16 [unused]
// row_major float4x4 gLensFlareColour;// Offset: 1536 Size: 64 [unused]
// float4 gScreenColour; // Offset: 1600 Size: 16 [unused]
// float4 gCombinedDOFBlurParameters; // Offset: 1616 Size: 16 [unused]
// float4 gDOFCameraBlurParameters; // Offset: 1632 Size: 16 [unused]
// float4 gDOFParameters; // Offset: 1648 Size: 16 [unused]
// float4 gFilmGrainParams; // Offset: 1664 Size: 16 [unused]
// float4 gFilmGrainOffsetScale; // Offset: 1680 Size: 16 [unused]
// row_major float4x4 gInverseViewProjection2;// Offset: 1696 Size: 64
// row_major float4x4 gPreviousViewProjection;// Offset: 1760 Size: 64 [unused]
// row_major float4x4 gCurrToPreviousViewProjection;// Offset: 1824 Size: 64 [unused]
// float4 gCombinedVelocityBlurWeights[2];// Offset: 1888 Size: 32 [unused]
// row_major float4x4 gCombinedVelocityBlurOffsets;// Offset: 1920 Size: 64 [unused]
// float4 gRadialBlurWeights[2]; // Offset: 1984 Size: 32 [unused]
// float4 gVelocityParameters2; // Offset: 2016 Size: 16 [unused]
// float4 gRadialBlurParams; // Offset: 2032 Size: 16 [unused]
// float4 gFinalCompositeParameters; // Offset: 2048 Size: 16 [unused]
// float4 gFinalCompositeExposure; // Offset: 2064 Size: 16 [unused]
// float4 gColourMatrix[3]; // Offset: 2080 Size: 48 [unused]
// float4 gVignetteColour; // Offset: 2128 Size: 16 [unused]
// float4 gVignetteParameters; // Offset: 2144 Size: 16 [unused]
// float4 gToneMapOptions[2]; // Offset: 2160 Size: 32 [unused]
// float4 gBloomOptions; // Offset: 2192 Size: 16 [unused]
// float4 gSunCoordinate; // Offset: 2208 Size: 16 [unused]
// float4 gCrepuscularParams; // Offset: 2224 Size: 16 [unused]
// float4 gCrepuscularDecay; // Offset: 2240 Size: 16 [unused]
// float4 gCrepuscularDecayAcc; // Offset: 2256 Size: 16 [unused]
// float4 gCrepuscularColour; // Offset: 2272 Size: 16 [unused]
// float4 gCubeFaceParams[2]; // Offset: 2288 Size: 32 [unused]
// float4 gChromaticAberrationParams; // Offset: 2320 Size: 16 [unused]
// float4 gBokehOffsets; // Offset: 2336 Size: 16 [unused]
// float4 gCoCParams; // Offset: 2352 Size: 16 [unused]
// float4 g8x8SampleOffsets[8]; // Offset: 2368 Size: 128 [unused]
// float4 g8x8DepthSampleOffsets[8]; // Offset: 2496 Size: 128 [unused]
// float4 gOverlayParameters[2]; // Offset: 2624 Size: 32 [unused]
// float4 gSampleOffsets[2]; // Offset: 2656 Size: 32 [unused]
// float4 gToneMapOptions2; // Offset: 2688 Size: 16 [unused]
// float4 gLuminanceToExposure; // Offset: 2704 Size: 16 [unused]
// row_major float4x4 gViewMatrix; // Offset: 2720 Size: 64 [unused]
// row_major float4x4 gProjectionMatrix;// Offset: 2784 Size: 64 [unused]
// float4 gMaxDistParams; // Offset: 2848 Size: 16 [unused]
// row_major float4x4 gIterSampleOffset2dScaleWeight;// Offset: 2864 Size: 64 [unused]
// float4 gIterResultBlendingParams; // Offset: 2928 Size: 16 [unused]
// float4 gIterMaxDeltaParams; // Offset: 2944 Size: 16 [unused]
// float4 gPerspectiveCorrectionParams;// Offset: 2960 Size: 16 [unused]
// float4 gHBAOPSParams[6]; // Offset: 2976 Size: 96 [unused]
// row_major float4x4 gViewMatrixInverse;// Offset: 3072 Size: 64 [unused]
// float4 gPEBlurSampleOffsets; // Offset: 3136 Size: 16 [unused]
// row_major float4x4 gShadowMapProjectionViewMatrix0;// Offset: 3152 Size: 64 [unused]
// row_major float4x4 gShadowMapProjectionViewMatrix1;// Offset: 3216 Size: 64 [unused]
// row_major float4x4 gShadowMapProjectionViewMatrix2;// Offset: 3280 Size: 64 [unused]
// row_major float4x4 gShadowMapProjectionViewMatrix3;// Offset: 3344 Size: 64 [unused]
// float4 gShadowMapTexelSize; // Offset: 3408 Size: 16 [unused]
// float4 gReflectionScale; // Offset: 3424 Size: 16 [unused]
// float4 gScreenSpaceReflectionParams;// Offset: 3440 Size: 16 [unused]
// float4 gSoftAlphaParams; // Offset: 3456 Size: 16 [unused]
// float4 gDynamicLightDistanceCullDepth;// Offset: 3472 Size: 16 [unused]
// float4 gEyeSsaoIntensityParams; // Offset: 3488 Size: 16 [unused]
// float4 gEyeSsaoColourParams; // Offset: 3504 Size: 16 [unused]
// float4 gSkinSsaoColourParams; // Offset: 3520 Size: 16 [unused]
// float4 gHairSsaoColourParams; // Offset: 3536 Size: 16 [unused]
// row_major float4x4 gPostFxKeyLightParameters;// Offset: 3552 Size: 64
// float4 gPostFxKeyLightScaleParams[2];// Offset: 3616 Size: 32
// float4 gPostFxHeadLightColour; // Offset: 3648 Size: 16 [unused]
// row_major float4x4 gPostFxFogParameters;// Offset: 3664 Size: 64
// row_major float4x4 gPostFxShadowMapPackedParams;// Offset: 3728 Size: 64 [unused]
// float4 gPostFxCascadedShadowLightMatrices[16];// Offset: 3792 Size: 256 [unused]
// float4 gBitMask; // Offset: 4048 Size: 16 [unused]
// float4 gFXAAParams[3]; // Offset: 4064 Size: 48 [unused]
// float4 gPostFxRimLight2Parameters[2];// Offset: 4112 Size: 32
// float4 gPostFxBounceLightParameters[2];// Offset: 4144 Size: 32
// float4 gPostFxCharRimLightParameters;// Offset: 4176 Size: 16
// float4 gFoliageSsaoColourParams; // Offset: 4192 Size: 16 [unused]
// float4 gCameraMotionBlurParams; // Offset: 4208 Size: 16 [unused]
// float4 gDancingPixelParams; // Offset: 4224 Size: 16
// float4 gSMAAParamsPS; // Offset: 4240 Size: 16 [unused]
// float4 gRimLightFalloffParams; // Offset: 4256 Size: 16
//
// }
//
// cbuffer CameraParameters
// {
//
// float4 gCameraParameters[2]; // Offset: 0 Size: 32
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// gDepthTexture sampler NA NA 0 1
// gGBuffer0Texture sampler NA NA 1 1
// gGBuffer1Texture sampler NA NA 2 1
// gGBuffer2Texture sampler NA NA 3 1
// gGBuffer3Texture sampler NA NA 4 1
// gDynamicLightTexture sampler NA NA 5 1
// gPointClampSampler sampler NA NA 15 1
// gDepthTextureTex texture float4 2d 0 1
// gGBuffer0TextureTex texture float4 2d 1 1
// gGBuffer1TextureTex texture float4 2d 2 1
// gGBuffer2TextureTex texture float4 2d 3 1
// gGBuffer3TextureTex texture float4 2d 4 1
// gDynamicLightTextureTex texture float4 2d 5 1
// gScreenSpaceShadowMap texture float4 2d 118 1
// $Globals cbuffer NA NA 0 1
// CameraParameters cbuffer NA NA 5 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE float
// TEXCOORD 0 xy 2 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
// SV_Target 1 xyzw 1 TARGET float xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[267], immediateIndexed
dcl_constantbuffer cb5[1], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s15, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t118
dcl_input_ps linear v2.xy
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 14
sample_indexable(texture2d)(float,float,float,float) r0.z, v2.xyxx, t0.yzxw, s0
ge r1.x, r0.z, l(1.000000)
if_nz r1.x
discard_nz l(-1)
endif
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, v2.xyxx, t1.xyzw, s1
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v2.xyxx, t2.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, v2.xyxx, t3.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, v2.xyxx, t4.xyzw, s4
dp3 r5.x, r1.xyzx, r1.xyzx
eq r5.x, r5.x, l(0.000000)
if_nz r5.x
mov r5.xyz, l(0,1.000000,0,0)
else
mad r5.xyz, r1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
endif
ubfe r1.x, l(8), l(13), r1.w
utof r1.x, r1.x
mul r1.x, r1.x, l(0.00392156886)
mul r1.yzw, r2.xxyz, r2.xxyz
mul r2.x, r2.w, l(255.000000)
ftoi r2.x, r2.x
ubfe r2.y, l(8), l(13), r3.w
utof r2.y, r2.y
ubfe r2.z, l(8), l(13), r4.w
utof r2.z, r2.z
mul r2.yw, r2.yyyz, l(0.000000, 0.00392156886, 0.000000, 0.00392156886)
mad r0.xy, v2.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mov r0.w, l(1.000000)
dp4 r6.x, cb0[106].xyzw, r0.xyzw
dp4 r6.y, cb0[107].xyzw, r0.xyzw
dp4 r6.z, cb0[108].xyzw, r0.xyzw
dp4 r0.x, cb0[109].xyzw, r0.xyzw
div r0.xyz, r6.xyzx, r0.xxxx
sample_indexable(texture2d)(float,float,float,float) r6.xyzw, v2.xyxx, t5.xyzw, s5
and r0.w, r2.x, l(64)
add r7.xyz, -r0.xyzx, cb5[0].xyzx
dp3 r2.x, r7.xyzx, r7.xyzx
sqrt r3.w, r2.x
add r3.w, r3.w, -cb0[266].x
add r4.w, -cb0[266].x, cb0[266].y
div r3.w, r3.w, r4.w
add_sat r3.w, -r3.w, l(1.000000)
movc r0.w, r0.w, r3.w, l(0)
rsq r2.x, r2.x
mul r8.xyz, r2.xxxx, r7.xyzx
dp3 r3.w, r5.xyzx, cb0[222].xyzx
mad r4.w, -r3.w, cb0[259].w, -cb0[259].w
add r4.w, r4.w, l(1.000000)
max r4.w, r4.w, l(0.000000)
dp3 r5.w, r8.xyzx, r5.xyzx
max r7.w, r5.w, l(0.000000)
add r7.w, -r7.w, cb0[225].z
add r7.w, r7.w, l(1.000000)
max r7.w, r7.w, l(0.000000)
log r8.w, r7.w
mul r8.w, r8.w, cb0[224].w
exp r8.w, r8.w
mul r8.w, r8.w, cb0[225].x
mul r7.w, r7.w, l(3.14159274)
sincos r7.w, null, r7.w
mul r7.w, r7.w, r8.w
sample_indexable(texture2d)(float,float,float,float) r8.w, v2.xyxx, t118.yzwx, s15
add r8.w, -r8.w, l(1.000000)
add r9.xy, -r0.xzxx, cb0[226].xzxx
dp2 r9.x, r9.xyxx, r9.xyxx
sqrt r9.x, r9.x
add r9.x, r9.x, -cb0[227].y
add r9.y, -cb0[227].y, cb0[227].x
div_sat r9.x, r9.x, r9.y
mul r9.x, r9.x, r9.x
dp3 r9.y, cb0[224].xyzx, r5.xyzx
max r9.z, r9.y, l(0.000000)
mul r9.w, |r7.w|, r9.z
dp3 r10.x, cb0[257].xyzx, r5.xyzx
max r10.y, r10.x, l(0.000000)
mul r10.z, |r7.w|, r10.y
mul r11.xyz, r10.zzzz, cb0[258].xyzx
mad r11.xyz, cb0[261].xyzx, r9.wwww, r11.xyzx
mad r12.xyz, r7.xyzx, r2.xxxx, cb0[224].xyzx
dp3 r9.w, r12.xyzx, r12.xyzx
rsq r9.w, r9.w
mul r12.xyz, r9.wwww, r12.xyzx
dp3 r9.w, r5.xyzx, r12.xyzx
dp3 r10.z, cb0[224].xyzx, r12.xyzx
add r10.w, -r10.z, l(1.000000)
mul r11.w, r10.w, r10.w
mul r11.w, r11.w, r11.w
mul r10.w, r10.w, r11.w
mad r2.z, -r2.z, l(0.00392156886), l(1.000000)
mad r10.w, r2.z, r10.w, r2.w
mul r11.w, r1.x, r1.x
mul r12.w, r9.w, r9.w
mul r13.x, r11.w, r12.w
max r13.x, r13.x, l(0.000010)
mad r13.y, -r9.w, r9.w, l(1.000000)
div r13.x, r13.y, r13.x
mul r13.x, r13.x, l(-1.442695)
exp r13.x, r13.x
mul r13.y, r11.w, l(3.141590)
mul r12.w, r12.w, r12.w
mul r12.w, r13.y, r12.w
max r12.w, r12.w, l(0.000010)
div r12.w, r13.x, r12.w
mul r13.x, r5.w, r9.y
mul r13.z, r13.x, l(4.000000)
add r9.w, r9.w, r9.w
mul r13.w, r5.w, r9.w
dp3 r12.x, r8.xyzx, r12.xyzx
max r12.x, r12.x, l(0.000010)
div r12.x, r13.w, r12.x
mul r9.y, r9.y, r9.w
max r9.w, r10.z, l(0.000010)
div r9.y, r9.y, r9.w
min r9.y, r9.y, r12.x
min r9.y, r9.y, l(1.000000)
mul r9.z, r9.z, r10.w
mul r9.y, r9.y, r9.z
mul r9.y, r12.w, r9.y
lt r9.z, r13.x, l(0.000000)
min r9.w, r13.z, l(-0.000010)
max r10.z, r13.z, l(0.000010)
movc r9.z, r9.z, r9.w, r10.z
div r9.y, r9.y, r9.z
mad r12.xyz, r7.xyzx, r2.xxxx, cb0[257].xyzx
dp3 r9.z, r12.xyzx, r12.xyzx
rsq r9.z, r9.z
mul r12.xyz, r9.zzzz, r12.xyzx
dp3 r9.z, r5.xyzx, r12.xyzx
dp3 r9.w, cb0[257].xyzx, r12.xyzx
add r10.z, -r9.w, l(1.000000)
mul r10.w, r10.z, r10.z
mul r10.w, r10.w, r10.w
mul r10.z, r10.z, r10.w
mad r10.z, r2.z, r10.z, r2.w
mul r10.w, r9.z, r9.z
mul r12.w, r11.w, r10.w
max r12.w, r12.w, l(0.000010)
mad r13.x, -r9.z, r9.z, l(1.000000)
div r12.w, r13.x, r12.w
mul r12.w, r12.w, l(-1.442695)
exp r12.w, r12.w
mul r10.w, r10.w, r10.w
mul r10.w, r13.y, r10.w
max r10.w, r10.w, l(0.000010)
div r10.w, r12.w, r10.w
mul r12.w, r5.w, r10.x
mul r13.x, r12.w, l(4.000000)
add r9.z, r9.z, r9.z
mul r13.z, r5.w, r9.z
dp3 r12.x, r8.xyzx, r12.xyzx
max r12.x, r12.x, l(0.000010)
div r12.x, r13.z, r12.x
mul r9.z, r10.x, r9.z
max r9.w, r9.w, l(0.000010)
div r9.z, r9.z, r9.w
min r9.z, r9.z, r12.x
min r9.z, r9.z, l(1.000000)
mul r9.w, r10.z, r10.y
mul r9.z, r9.z, r9.w
mul r9.z, r10.w, r9.z
lt r9.w, r12.w, l(0.000000)
min r10.x, r13.x, l(-0.000010)
max r10.y, r13.x, l(0.000010)
movc r9.w, r9.w, r10.x, r10.y
div r9.z, r9.z, r9.w
mul r10.xyz, r9.zzzz, cb0[258].xyzx
mad r9.yzw, r9.yyyy, cb0[261].xxyz, r10.xxyz
mul r9.yzw, |r7.wwww|, r9.yyzw
mul r9.yzw, r0.wwww, r9.yyzw
mul r10.xyz, r9.xxxx, cb0[259].xyzx
max r10.xyz, r10.xyzx, cb0[260].xyzx
mul r10.xyz, r4.wwww, r10.xyzx
mad r10.xyz, r11.xyzx, r0.wwww, r10.xyzx
mul r11.xyz, r9.xxxx, cb0[223].xyzx
mul r11.xyz, r11.xyzx, cb0[3].yyyy
mul r11.xyz, r8.wwww, r11.xyzx
dp3 r0.w, r5.xyzx, r5.xyzx
rsq r0.w, r0.w
mul r12.xyz, r0.wwww, r5.xyzx
mad r13.xzw, -r12.xxyz, r5.wwww, r8.xxyz
mad r12.xyz, -r12.xyzx, r3.wwww, cb0[222].xyzx
dp3 r0.w, r13.xzwx, r12.xyzx
mad r12.xy, r1.xxxx, r1.xxxx, l(0.570000, 0.090000, 0.000000, 0.000000)
div r12.xy, r11.wwww, r12.xyxx
mul r1.x, r12.y, l(0.450000)
mad r4.w, -r12.x, l(0.500000), l(1.000000)
mad r7.w, -r5.w, r5.w, l(1.000000)
mad r8.w, -r3.w, r3.w, l(1.000000)
mul_sat r7.w, r7.w, r8.w
sqrt r7.w, r7.w
max r8.w, r3.w, r5.w
lt r9.x, r8.w, l(0.000000)
min r10.w, r8.w, l(-0.000010)
max r8.w, r8.w, l(0.000010)
movc r8.w, r9.x, r10.w, r8.w
div r7.w, r7.w, r8.w
max r8.w, r3.w, l(0.000000)
max r0.w, r0.w, l(0.000000)
mul r0.w, r0.w, r1.x
mad r0.w, r0.w, r7.w, r4.w
mul r0.w, r0.w, r8.w
mad r3.xyz, r11.xyzx, r0.wwww, r3.xyzx
mad r7.xyz, r7.xyzx, r2.xxxx, cb0[222].xyzx
dp3 r0.w, r7.xyzx, r7.xyzx
rsq r0.w, r0.w
mul r7.xyz, r0.wwww, r7.xyzx
dp3 r0.w, r5.xyzx, r7.xyzx
dp3 r1.x, cb0[222].xyzx, r7.xyzx
add r2.x, -r1.x, l(1.000000)
mul r4.w, r2.x, r2.x
mul r4.w, r4.w, r4.w
mul r2.x, r2.x, r4.w
mad r2.x, r2.z, r2.x, r2.w
mul r2.z, r0.w, r0.w
mul r2.w, r11.w, r2.z
max r2.w, r2.w, l(0.000010)
mad r4.w, -r0.w, r0.w, l(1.000000)
div r2.w, r4.w, r2.w
mul r2.w, r2.w, l(-1.442695)
exp r2.w, r2.w
mul r2.z, r2.z, r2.z
mul r2.z, r13.y, r2.z
max r2.z, r2.z, l(0.000010)
div r2.z, r2.w, r2.z
mul r2.w, r3.w, r5.w
mul r4.w, r2.w, l(4.000000)
add r0.w, r0.w, r0.w
mul r5.x, r5.w, r0.w
dp3 r5.y, r8.xyzx, r7.xyzx
max r5.y, r5.y, l(0.000010)
div r5.x, r5.x, r5.y
mul r0.w, r3.w, r0.w
max r1.x, r1.x, l(0.000010)
div r0.w, r0.w, r1.x
min r0.w, r0.w, r5.x
min r0.w, r0.w, l(1.000000)
mul r1.x, r2.x, r8.w
mul r0.w, r0.w, r1.x
mul r0.w, r2.z, r0.w
lt r1.x, r2.w, l(0.000000)
min r2.x, r4.w, l(-0.000010)
max r2.z, r4.w, l(0.000010)
movc r1.x, r1.x, r2.x, r2.z
div r0.w, r0.w, r1.x
dp3 r1.x, r6.xyzx, l(0.212500, 0.715400, 0.072100, 0.000000)
max r1.x, r1.x, l(0.000010)
div r2.xzw, r6.xxyz, r1.xxxx
ne r1.x, cb0[3].x, l(1.000000)
and r1.x, r1.x, l(0x3f800000)
mad r3.xyz, r6.xyzx, r1.xxxx, r3.xyzx
mul r2.xzw, r2.xxzw, r6.wwww
mul r2.xzw, r1.xxxx, r2.xxzw
mad r2.xzw, r0.wwww, r11.xxyz, r2.xxzw
mul r2.xzw, r2.xxzw, cb0[20].xxxx
mul r5.xyz, r2.yyyy, r9.yzwy
add r3.xyz, r10.xyzx, r3.xyzx
mad r2.xyz, r2.xzwx, r2.yyyy, r5.xyzx
mad r1.xyz, r3.xyzx, r1.yzwy, r2.xyzx
add r2.xyz, r2.xyzx, r3.xyzx
add r0.xyz, r0.xyzx, -cb5[0].xyzx
dp3 r0.y, r0.xyzx, r0.xyzx
sqrt r0.y, r0.y
mov r3.xz, cb0[222].xxzx
mov r3.y, l(0.000100)
dp3 r1.w, r3.xyzx, r3.xyzx
rsq r1.w, r1.w
mul r3.xyz, r1.wwww, r3.xyzx
mov r0.w, l(0.000100)
dp3 r1.w, r0.xzwx, r0.xzwx
rsq r1.w, r1.w
mul r0.xzw, r0.xxwz, r1.wwww
dp3 r0.x, r3.xyzx, r0.xzwx
mad r0.x, r0.x, l(0.500000), l(0.500000)
add r3.xyz, -cb0[230].xyzx, cb0[232].xyzx
mad r3.xyz, r0.xxxx, r3.xyzx, cb0[230].xyzx
add r5.xyz, -cb0[229].xyzx, cb0[231].xyzx
mad r0.xzw, r0.xxxx, r5.xxyz, cb0[229].xxyz
add r0.x, -r0.x, r0.y
mul_sat r0.x, r0.z, r0.x
add r0.y, r0.w, l(-1.000000)
mad r0.x, r0.x, r0.y, l(1.000000)
mad r0.yzw, r1.xxyz, cb0[0].xxyz, -r3.xxyz
mad r0.xyz, r0.xxxx, r0.yzwy, r3.xyzx
ne r1.xyz, r0.xyzx, r0.xyzx
or r0.w, r1.y, r1.x
or r0.w, r1.z, r0.w
if_nz r0.w
mov r0.xyz, l(1.000000,0,0,0)
endif
lt r1.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r1.xyz, r1.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
dp3 r0.w, r1.xyzx, r1.xyzx
ne r0.w, r0.w, l(0.000000)
if_nz r0.w
mov r0.xyz, l(0,1.000000,0,0)
endif
mad r0.xyz, r0.xyzx, cb0[34].xxxx, r4.xyzx
ne r1.xyz, r0.xyzx, r0.xyzx
or r0.w, r1.y, r1.x
or r0.w, r1.z, r0.w
if_nz r0.w
mov r0.xyz, l(0,0,0,0)
endif
mul r1.xyz, r2.xyzx, cb0[34].xxxx
dp3 r1.x, r1.xyzx, l(0.212500, 0.715400, 0.072100, 0.000000)
ne r0.w, r1.x, r1.x
lt r1.w, r1.x, l(0.000000)
or r0.w, r0.w, r1.w
if_nz r0.w
mov r1.x, l(0)
endif
lt r0.w, cb0[264].x, r1.x
and r1.y, r0.w, l(0x3f800000)
mov o0.xyz, r0.xyzx
mov o0.w, l(1.000000)
mov r1.z, l(0)
mov o1.xyzw, r1.xyzz
ret
// Approximately 319 instruction slots used

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


These shaders control some lighting (which is OK with some exceptions) and dynamic shadows produced by light. They are at screen depth by default and I couldn't find any other shader that controls them.

Look where I use "iniparams.w" and the lines before it (please, don't pay attention to other variables and commented things I had tried in other parts of the shader, like r25 and r26. They are unused). With that fix (when you press "b"), dynamic shadows are fixed, BUT the rest of lighting is pretty much broken (with more separation).

Before: http://u.cubeupload.com/masterotaku/deadrising3014.jpg
After: http://u.cubeupload.com/masterotaku/deadrising3015.jpg

Some places look a lot worse that that. I chose a moderate example.

I couldn't find another place in the shader to correct that (for now). In following uses of r6, using the variable that I called "oldr6" (which doesn't have the fix) didn't make any difference.

In line 264, there is this:

r8.w = gScreenSpaceShadowMap.Sample(gPointClampSampler_s, v2.xy).x;


If I use "newv2" there instead of "v2", it fixes the shadows of the other 3 pixel shaders I had already fixed. If I disable the fix in those shaders, I can see that their shadows are correct but there is haloing in the environment and objects. That's why I though I could be making the same mistake with the dynamic shadows I showed you first.

My question is: is lighting fixable in this shader somewhere after breaking it, or do I have to find an unknown shadows shader?

If someone knows how to fix this, please help.

By the way, dumping this shader changed/disabled some specular reflections. helifax told me that after I fix this I should use "export_hlsl=3" to get the fixed shader in ASM and fix the differences compared to the original ASM shader.

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 08/24/2016 05:23 PM   
The shadows on charactes on Tales of Zesteria are "displaced", are stereo but not correspond with the player position. More or less depth/convergence at certain camera angles. There are other shadows for static meshes what works fine but the one on riggid models are not. Tried to replace that with riggid model's shadows without luck and tried to understand looking to another old dx9 games .... It looks veeeeeeery simple.. not sure, tried a lot of mindless maths.... After a long tinkering what i can say, is what the shadows was projecting on a invisible cube around the player.... Each time i modify anything except "mul" the shaders gets disabled .... Any advice pls ? Thanks ! [code]// // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // Parameters: // // struct // { // row_major float4x4 mWVPMatrix; // // } gCBufferMatrix; // // float4 gViewportOffset; // // // Registers: // // Name Reg Size // --------------- ----- ---- // gCBufferMatrix c0 4 // gViewportOffset c240 1 // vs_3_0 //def c220, 0, 0, 5, 1 dcl_position v0 dcl_position o0 dcl_texcoord o1 mul r0, c1, v0.y mad r0, v0.x, c0, r0 mad r0, v0.z, c2, r0 mad r0, v0.w, c3, r0 add o0, r0, c240 mov o1, r0 // approximately 6 instruction slots used[/code] Also tried with prototype 1 and 2 and Crysis profiles .
The shadows on charactes on Tales of Zesteria are "displaced", are stereo but not correspond with the player position. More or less depth/convergence at certain camera angles.

There are other shadows for static meshes what works fine but the one on riggid models are not. Tried to replace that with riggid model's shadows without luck and tried to understand looking to another old dx9 games ....

It looks veeeeeeery simple.. not sure, tried a lot of mindless maths.... After a long tinkering what i can say, is what the shadows was projecting on a invisible cube around the player....

Each time i modify anything except "mul" the shaders gets disabled .... Any advice pls ? Thanks !

//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
// struct
// {
// row_major float4x4 mWVPMatrix;
//
// } gCBufferMatrix;
//
// float4 gViewportOffset;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// gCBufferMatrix c0 4
// gViewportOffset c240 1
//

vs_3_0
//def c220, 0, 0, 5, 1
dcl_position v0
dcl_position o0
dcl_texcoord o1
mul r0, c1, v0.y
mad r0, v0.x, c0, r0
mad r0, v0.z, c2, r0
mad r0, v0.w, c3, r0
add o0, r0, c240
mov o1, r0

// approximately 6 instruction slots used



Also tried with prototype 1 and 2 and Crysis profiles .

Posted 08/25/2016 06:37 PM   
@masterotaku Very nice you're fixing that game.... time ago i take a look and fix a few stuff (i fix like 8 shaders, included some shadows one)....is in my to do list :) I don't have the game installed and lend to my father a hard Drive with the backup of a few stuff (where the wip of this game is - and my father lives in another city).... i don't remember doing some elaborate stuff (the if for example). I will install the game for the weekend to help.
@masterotaku
Very nice you're fixing that game.... time ago i take a look and fix a few stuff (i fix like 8 shaders, included some shadows one)....is in my to do list :)

I don't have the game installed and lend to my father a hard Drive with the backup of a few stuff (where the wip of this game is - and my father lives in another city).... i don't remember doing some elaborate stuff (the if for example). I will install the game for the weekend to help.

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

Like my fixes? you can donate to Paypal: dhr.donation@gmail.com

Posted 08/25/2016 10:16 PM   
Thank you, DHR. Meanwhile, I'll be entertained fixing things in Deus Ex HR Director's Cut (after all, I want to play it, and with good 3D) and trying more things in DR3.
Thank you, DHR.

Meanwhile, I'll be entertained fixing things in Deus Ex HR Director's Cut (after all, I want to play it, and with good 3D) and trying more things in DR3.

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 08/25/2016 10:38 PM   
OK I am doing the lessons and I am on Lesson 3 Const. Now I went through the video twicw and read it many time.. I a, having issues with the Quiz on Step 3: When the effect is being displayed, change its color. Now I am at a impass as I don't recall seeing where in this lesson or past lessons to change the color of an effect.. I think it is to be done with the constants or maybe not.. I just plain am drawing a blank on this one.. I would like some help but don't just tell me the answer. but would I change the color of the effect with a Constant?? IF so was there a past lesson that touched on this?? or did the lesson 3 touch this.. If the lesson touched on this I just don't see it :(
OK I am doing the lessons and I am on Lesson 3 Const. Now I went through the video twicw and read it many time.. I a, having issues with the Quiz on Step 3:

When the effect is being displayed, change its color.


Now I am at a impass as I don't recall seeing where in this lesson or past lessons to change the color of an effect.. I think it is to be done with the constants or maybe not.. I just plain am drawing a blank on this one..

I would like some help but don't just tell me the answer. but would I change the color of the effect with a Constant?? IF so was there a past lesson that touched on this?? or did the lesson 3 touch this..

If the lesson touched on this I just don't see it :(

Intel i5 7600K @ 4.8ghz / MSI Z270 SLI / Asus 1080GTX - 416.16 / Optoma HD142x Projector / 1 4'x10' Curved Screen PVC / TrackIR / HOTAS Cougar / Cougar MFD's / Track IR / NVidia 3D Vision / Win 10 64bit

Posted 09/02/2016 12:57 AM   
I got it .. I thought the color was only going to be on the little circle that was the bloom. it apparently colored the entire box.. so I don't tneed help with this lesson I figured it out.. When I looked before I thought I was doing it right but when I saw an entire block get colored in I thought I had done it wrong but apparently was right all along..
I got it .. I thought the color was only going to be on the little circle that was the bloom. it apparently colored the entire box.. so I don't tneed help with this lesson I figured it out..

When I looked before I thought I was doing it right but when I saw an entire block get colored in I thought I had done it wrong but apparently was right all along..

Intel i5 7600K @ 4.8ghz / MSI Z270 SLI / Asus 1080GTX - 416.16 / Optoma HD142x Projector / 1 4'x10' Curved Screen PVC / TrackIR / HOTAS Cougar / Cougar MFD's / Track IR / NVidia 3D Vision / Win 10 64bit

Posted 09/02/2016 05:42 AM   
@masterotaku Just test Dead Rising 3....and the lights need to be fixed in a compute shader. There are 2 main CS that control the dynamics lights. I don't see any setting or in the config file to disable CS Lights. [s]The bad thing is that 3Dmigoto can't dump any CS (manually or in shaderchache), only jps are dumped; so bo3b or DSS need to take a look to 3Dmigoto to dump CS and try to fix them. In the ShaderCache only PS and VS are dumped (tested only with 1.2.43)[/s] Edit: Now one CS is dumped in the ShaderCache.....very strange behavior. Tile Lights.... [code]Resource bind info for TiledLightBuffer // { // // struct tShadowLightData // { // // float3 mPosition; // Offset: 0 // float mAttenuation; // Offset: 12 // float3 mColor; // Offset: 16 // float mStrength; // Offset: 28 // float3 mDirection; // Offset: 32 // float mHalfCosConeAngle; // Offset: 44 // row_major float4x4 mShadowMapProjectViewMatrix;// Offset: 48 // // } $Element; // Offset: 0 Size: 112 // // }[/code]
@masterotaku

Just test Dead Rising 3....and the lights need to be fixed in a compute shader. There are 2 main CS that control the dynamics lights. I don't see any setting or in the config file to disable CS Lights.

The bad thing is that 3Dmigoto can't dump any CS (manually or in shaderchache), only jps are dumped; so bo3b or DSS need to take a look to 3Dmigoto to dump CS and try to fix them. In the ShaderCache only PS and VS are dumped (tested only with 1.2.43)

Edit: Now one CS is dumped in the ShaderCache.....very strange behavior.

Tile Lights....
Resource bind info for TiledLightBuffer
// {
//
// struct tShadowLightData
// {
//
// float3 mPosition; // Offset: 0
// float mAttenuation; // Offset: 12
// float3 mColor; // Offset: 16
// float mStrength; // Offset: 28
// float3 mDirection; // Offset: 32
// float mHalfCosConeAngle; // Offset: 44
// row_major float4x4 mShadowMapProjectViewMatrix;// Offset: 48
//
// } $Element; // Offset: 0 Size: 112
//
// }

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

Like my fixes? you can donate to Paypal: dhr.donation@gmail.com

Posted 09/13/2016 09:38 PM   
Thank you, DHR. So, what now? I have never tackled compute shaders, so I don't know what to do or where to start. I suppose that CS has more content than those 17 lines, right?
Thank you, DHR.

So, what now? I have never tackled compute shaders, so I don't know what to do or where to start.

I suppose that CS has more content than those 17 lines, right?

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 09/13/2016 10:30 PM   
  64 / 88    
Scroll To Top