Crysis 3 - 3D fix discussion
  4 / 10    
@DarkStarSword The fix disables when i move to left or right, and never recover again....i have to change PARTICLE and WATER to other setting , apply...and change back to HIGH to recover....it's very strange. Yesterday i fix 2 ds related (VERY HIGH) to that water and seems OK if you look to the horizont line or up, but if you look down appear that bright reflection pattern with one type of reflection broke and the other OK. Horizont Line OK: [img]https://forums.geforce.com/cmd/default/download-comment-attachment/65383/[/img] Look down: [img]https://forums.geforce.com/cmd/default/download-comment-attachment/65384/[/img] @bo3b attach the ASM files. I prefer to look that water with VS and both PS hand fixed by you :)
@DarkStarSword
The fix disables when i move to left or right, and never recover again....i have to change PARTICLE and WATER to other setting , apply...and change back to HIGH to recover....it's very strange.

Yesterday i fix 2 ds related (VERY HIGH) to that water and seems OK if you look to the horizont line or up, but if you look down appear that bright reflection pattern with one type of reflection broke and the other OK.

Horizont Line OK:
Image

Look down:
Image


@bo3b
attach the ASM files. I prefer to look that water with VS and both PS hand fixed by you :)

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

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

#46
Posted 07/24/2015 11:04 AM   
I wonder if it could be some weird interaction between some shaders... can you send me your current WIP and I'll see if I can find some time to take a look before I go away tomorrow?
I wonder if it could be some weird interaction between some shaders... can you send me your current WIP and I'll see if I can find some time to take a look before I go away tomorrow?

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

#47
Posted 07/24/2015 02:54 PM   
I just send you a PM with the WIP version. interaction between some shaders....you mean your fix with HIGH settings, or the issue in the screenshots attached (VERY HIGH)?
I just send you a PM with the WIP version.

interaction between some shaders....you mean your fix with HIGH settings, or the issue in the screenshots attached (VERY HIGH)?

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

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

#48
Posted 07/24/2015 07:49 PM   
Just wanted to say thank you to you for looking into this. It looks good in 2d surround so unfortunately you're sort of compelling me to upgrade to SLI 980 TIs!
Just wanted to say thank you to you for looking into this. It looks good in 2d surround so unfortunately you're sort of compelling me to upgrade to SLI 980 TIs!

GTX 1070 SLI, I7-6700k ~ 4.4Ghz, 3x BenQ XL2420T, BenQ TK800, LG 55EG960V (3D OLED), Samsung 850 EVO SSD, Crucial M4 SSD, 3D vision kit, Xpand x104 glasses, Corsair HX1000i, Win 10 pro 64/Win 7 64https://www.3dmark.com/fs/9529310

#49
Posted 07/24/2015 10:42 PM   
[quote]@bo3b attach the ASM files. I prefer to look that water with VS and both PS hand fixed by you :)[/quote] Good, thanks. I've take a relatively detailed look at the 9b3a shader, and I think this one is pretty good. I'm not seeing anything specifically wrong, but the code changes a lot in terms of registers used. If you use the show_original for this shader are you seeing defects? Here is a slightly tweaked version of the file, to put back the proper name use. No other changes. [code]// Fixed warning for SampleGrad. // For some reason it did not pick up names out of cb2, cb3, and created defaults. // Maybe length of the substruct names like __0DetailNormalsScale__1NormalsScale__2__3 // Also maybe not packoffset variant. cbuffer PER_BATCH : register(b0) { float4 vfViewPos : packoffset(c0); float4 cFogColorDensity : packoffset(c1); float3 vfSunDir : packoffset(c2); float4 volFogShadowDarkening : packoffset(c3); float4 PS_WorldViewPos : packoffset(c4); float3 vfColGradDelta : packoffset(c5); float4 vfRampParams : packoffset(c6); float4 vfColGradRadial : packoffset(c7); float4 vfParams : packoffset(c8); float4 PS_NearFarClipDist : packoffset(c9); float4 vfColGradParams : packoffset(c10); float4 volFogShadowDarkeningSunAmb : packoffset(c11); float4 PS_ScreenSize : packoffset(c12); float3 CameraFrontVector : packoffset(c13); float3 vfColGradBase : packoffset(c14); float4 PS_HPosScale : packoffset(c15); } cbuffer PER_INSTANCE : register(b1) { row_major float4x4 mViewProj : packoffset(c0); } cbuffer PER_FRAME : register(b2) { float4 g_PS_SunLightDir : packoffset(c2); } cbuffer PER_MATERIAL : register(b3) { float4 MatSpecColor : packoffset(c1); float2 __0RealtimeReflMul__1EnvCubeReflMul__2__3 : packoffset(c6); float2 __0DetailNormalsScale__1NormalsScale__2__3 : packoffset(c7); float4 __0__1__2__3EnvCubeScale : packoffset(c8); float4 __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling : packoffset(c9); } SamplerState sceneDepthSampler_s : register(s0); SamplerState RefractionSampler_s : register(s1); SamplerState ReflSampler_s : register(s2); SamplerState WaterNormalsSampler_s : register(s3); SamplerState volFogShadowSampler_s : register(s4); Texture2D<float4> WaterNormalsSampler : register(t0); Texture2D<float4> RefractionSampler : register(t1); Texture2D<float4> sceneDepthSampler : register(t2); Texture2D<float4> ReflSampler : register(t3); Texture2D<float4> volFogShadowSampler : register(t4); Texture2D<float4> StereoParams : register(t125); Texture1D<float4> IniParams : register(t120); void main( float4 v0 : SV_Position0, float4 v1 : TEXCOORD0, float4 v2 : TEXCOORD1, float4 v3 : TEXCOORD2, float4 v4 : TEXCOORD3, float4 v5 : TEXCOORD4, out float4 o0 : SV_Target0) { float4 r0,r1,r2,r3,r4,r5; uint4 bitmask, uiDest; float4 fDest; r0.xy = float2(0.25,0.25) * v1.xy; r0.xyz = WaterNormalsSampler.Sample(WaterNormalsSampler_s, r0.xy).xyw; r0.xyz = r0.xyz * float3(0.150000006,0.150000006,0.100000001) + float3(-0.075000003,-0.075000003,-0.0500000007); r0.w = dot(v3.xyz, v3.xyz); r0.w = rsqrt(r0.w); r1.xyz = v3.xyz * r0.www; r0.xyzw = r1.xyxy * r0.zzzz + r0.xyxy; r2.xy = v1.xy * float2(1,1) + r0.zw; r2.xyz = WaterNormalsSampler.Sample(WaterNormalsSampler_s, r2.xy).xyw; r2.xyz = r2.xyz * float3(0.150000006,0.150000006,0.100000001) + float3(-0.075000003,-0.075000003,-0.0500000007); r2.xyzw = r1.xyxy * r2.zzzz + r2.xyxy; r0.xyzw = r2.xyzw + r0.xyzw; r2.xy = float2(0.5,0.5) * v1.zw; r1.w = __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling.w * __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling.z; r2.xy = r2.xy / r1.ww; r1.w = r1.w + r1.w; r2.xy = r2.xy * r1.ww + r0.xy; r2.xy = WaterNormalsSampler.Sample(WaterNormalsSampler_s, r2.xy).xy; r2.xy = r2.xy * float2(2,2) + float2(-1,-1); r3.xyzw = v1.xyxy / __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling.wwww; r4.xyzw = __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling.wwww * float4(0.25,0.25,1,1); r0.xyzw = r3.xyzw * r4.xyzw + r0.xyzw; r3.xyz = WaterNormalsSampler.Sample(WaterNormalsSampler_s, r0.xy).xyz; r0.xyz = WaterNormalsSampler.Sample(WaterNormalsSampler_s, r0.zw).xyz; r3.xyz = r3.xyz * float3(2,2,2) + float3(-1,-1,-1); r0.xyz = r0.xyz * float3(2,2,2) + r3.xyz; r0.xy = r2.xy * __0DetailNormalsScale__1NormalsScale__2__3.xx + r0.xy; r0.xyz = float3(-1,-1,-1) + r0.xyz; r0.xy = __0DetailNormalsScale__1NormalsScale__2__3.yy * r0.xy; r0.w = dot(r0.xyz, r0.xyz); r0.w = rsqrt(r0.w); r2.xyz = r0.xyz * r0.www + float3(-0,-0,-1); r0.xyz = r0.xyz * r0.www; r2.xyz = r2.xyz * float3(0.300000012,0.300000012,0.300000012) + float3(0,0,1); r3.xyz = PS_WorldViewPos.xyz + -v5.xyz; r0.w = dot(r3.xyz, r2.xyz); r0.w = r0.w + r0.w; r2.xyz = r2.xyz * -r0.www + r3.xyz; r0.w = dot(r2.xyz, r2.xyz); r0.w = rsqrt(r0.w); r2.xyz = r2.xyz * r0.www + v5.xyz; r2.w = 1; r3.x = dot(mViewProj._m00_m01_m02_m03, r2.xyzw); r3.y = dot(mViewProj._m10_m11_m12_m13, r2.xyzw); r0.w = dot(mViewProj._m30_m31_m32_m33, r2.xyzw); r2.xy = r3.xy / r0.ww; r3.xyz = v5.xyz; r3.w = 1; r4.x = dot(mViewProj._m00_m01_m02_m03, r3.xyzw); r4.y = dot(mViewProj._m10_m11_m12_m13, r3.xyzw); r0.w = dot(mViewProj._m30_m31_m32_m33, r3.xyzw); r2.zw = r4.xy / r0.ww; r2.xy = r2.xy + -r2.zw; r0.w = dot(r2.xy, r2.xy); r0.w = rsqrt(r0.w); r2.xy = r2.xy * r0.ww; r2.xy = PS_HPosScale.xy * r2.xy; r0.w = 0.5 * PS_ScreenSize.y; r0.w = log2(r0.w); r0.w = -4 + r0.w; r0.w = -MatSpecColor.w * r0.w + r0.w; r2.xy = r2.xy * r0.ww; r2.xy = PS_ScreenSize.ww * r2.xy; r2.xy = float2(64,64) * r2.xy; r2.zw = v2.xy / v2.ww; r0.w = sceneDepthSampler.Sample(sceneDepthSampler_s, r2.zw).x; r1.w = r0.w * PS_NearFarClipDist.y + -v2.w; r0.w = PS_NearFarClipDist.y * r0.w; r1.w = saturate(__0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling.x * r1.w); r3.xy = r1.ww * r0.xy; r0.x = dot(r1.xyz, r0.xyz); r0.y = dot(r1.xyz, CameraFrontVector.xyz); r0.x = -r0.x * v3.w + 1; r1.xy = v2.zz * r3.xy; r3.xw = float2(0.150000006,0.150000006); r3.yz = PS_HPosScale.yx; r3.xy = r3.xy * r1.xy; r3.xy = r3.xy * r3.zw + r2.zw; r0.z = -r1.y * r3.w + 1; r4.z = -r0.z * PS_HPosScale.y + 1; r0.z = sceneDepthSampler.Sample(sceneDepthSampler_s, r3.xy).x; r0.z = PS_NearFarClipDist.y * r0.z; r0.z = v2.w < r0.z; r0.z = r0.z ? 1.000000 : 0; r1.z = 0.150000006 * r1.x; r1.xy = PS_HPosScale.xy * r1.xy; r4.x = r1.z * r3.z; r3.xy = r4.xz * r0.zz + r2.zw; r3.xyzw = ReflSampler.SampleGrad(ReflSampler_s, r3.xy, r2.xy, float2(0,0)).xyzw; r0.z = r3.w * r3.w; r0.z = 32 * r0.z; r3.xyz = r3.xyz * r0.zzz; r3.xyz = r3.xyz / g_PS_SunLightDir.www; r2.xy = r1.xy * float2(0.0985000059,0.0985000059) + r2.zw; r0.z = sceneDepthSampler.Sample(sceneDepthSampler_s, r2.xy).x; r4.z = PS_NearFarClipDist.y * r0.z; r5.xyzw = r1.xyxy * float4(0.102499999,0.102499999,0.100000001,0.100000001) + r2.zwzw; r1.xy = float2(0.100000001,0.100000001) * r1.xy; r0.z = sceneDepthSampler.Sample(sceneDepthSampler_s, r5.zw).x; r1.z = sceneDepthSampler.Sample(sceneDepthSampler_s, r5.xy).x; r4.y = PS_NearFarClipDist.y * r0.z; r4.x = PS_NearFarClipDist.y * r1.z; r0.z = r1.z * PS_NearFarClipDist.y + -r0.w; r4.xyz = v2.www < r4.xyz; r4.xyz = r4.xyz ? 1.000000 : 0; r2.xy = r4.xx * r1.xy; r2.xy = r2.xy * float2(1.02499998,1.02499998) + r2.zw; r5.x = RefractionSampler.Sample(RefractionSampler_s, r2.xy).x; r2.xy = r4.zz * r1.xy; r1.xy = r1.xy * r4.yy + r2.zw; r0.z = r4.x * r0.z + r0.w; r5.y = RefractionSampler.Sample(RefractionSampler_s, r1.xy).y; r1.xy = r2.xy * float2(0.985000014,0.985000014) + r2.zw; r0.w = volFogShadowSampler.Sample(volFogShadowSampler_s, r2.zw).w; r5.z = RefractionSampler.Sample(RefractionSampler_s, r1.xy).z; r1.xyz = r5.xyz / g_PS_SunLightDir.www; r1.xyz = -cFogColorDensity.xyz + r1.xyz; r2.x = dot(v3.xyz, CameraFrontVector.xyz); r0.z = -r2.x + r0.z; r0.z = max(0, r0.z); r0.z = -cFogColorDensity.w * r0.z; r0.y = r0.z / r0.y; r0.y = exp2(r0.y); r0.y = min(1, r0.y); r1.xyz = r0.yyy * r1.xyz + cFogColorDensity.xyz; r2.xyz = r3.xyz + -r1.xyz; r0.y = r0.x * r0.x; r0.y = r0.y * r0.y; r0.x = r0.x * r0.y; r0.x = saturate(r0.x * 0.949999988 + 0.0500000007); r0.y = saturate(-0.330000013 + v2.w); r0.y = r1.w * r0.y; r0.x = r0.x * r0.y; r1.xyz = r0.xxx * r2.xyz + r1.xyz; r0.x = saturate(v5.z * vfColGradParams.x + vfColGradParams.y); r0.z = 2 + -r0.x; r0.x = r0.x * r0.z; r2.xyz = r0.xxx * vfColGradDelta.xyz + vfColGradBase.xyz; r0.x = dot(-v3.xyz, -v3.xyz); r0.z = rsqrt(r0.x); r0.x = sqrt(r0.x); r3.xyz = -v3.xyz * r0.zzz; r0.z = dot(r3.xyz, vfSunDir.xyz); r0.z = r0.z * -vfColGradParams.z + vfColGradParams.z; r0.z = exp2(r0.z); r1.w = saturate(vfColGradRadial.w * r0.x); r1.w = log2(r1.w); r1.w = vfColGradParams.w * r1.w; r1.w = exp2(r1.w); r0.z = r1.w * r0.z; r3.xyz = vfColGradRadial.xyz * r0.zzz; r4.xy = saturate(r0.ww * volFogShadowDarkeningSunAmb.xz + volFogShadowDarkeningSunAmb.yw); r3.xyz = r4.xxx * r3.xyz; r2.xyz = r2.xyz * r4.yyy + r3.xyz; r3.xyz = volFogShadowDarkening.xxx * r2.xyz; r2.xyz = -r2.xyz * volFogShadowDarkening.xxx + r2.xyz; r2.xyz = r0.www * r2.xyz + r3.xyz; r2.xyz = r2.xyz + -r1.xyz; r0.yzw = r0.yyy * r2.xyz + r1.xyz; r1.xyz = r1.xyz + -r0.yzw; r1.w = vfParams.x * -v3.z; r2.x = 1.44269502 * r1.w; r2.x = exp2(r2.x); r2.x = -1 + r2.x; r2.x = r2.x / r1.w; r1.w = 0.00999999978 < abs(r1.w); r1.w = r1.w ? r2.x : 1; r2.x = vfParams.y * r0.x; r0.x = saturate(r0.x * vfRampParams.x + vfRampParams.y); r1.w = r2.x * r1.w; r1.w = exp2(-r1.w); r1.w = min(1, r1.w); r1.w = 1 + -r1.w; r2.x = 2 + -r0.x; r0.x = r2.x * r0.x; r0.x = r0.x * vfRampParams.z + vfRampParams.w; r0.x = -r1.w * r0.x + 1; r0.x = saturate(max(vfParams.w, r0.x)); r0.xyz = r0.xxx * r1.xyz + r0.yzw; o0.xyz = g_PS_SunLightDir.www * r0.xyz; o0.w = 1; return; } [/code] I'm still looking at de67 shader, but initial look seems pretty good. If I tweak the settings to prefer flow control, that big block of if statements in the middle is identical.
@bo3b
attach the ASM files. I prefer to look that water with VS and both PS hand fixed by you :)

Good, thanks. I've take a relatively detailed look at the 9b3a shader, and I think this one is pretty good. I'm not seeing anything specifically wrong, but the code changes a lot in terms of registers used.

If you use the show_original for this shader are you seeing defects?


Here is a slightly tweaked version of the file, to put back the proper name use. No other changes.

// Fixed warning for SampleGrad.

// For some reason it did not pick up names out of cb2, cb3, and created defaults.
// Maybe length of the substruct names like __0DetailNormalsScale__1NormalsScale__2__3
// Also maybe not packoffset variant.

cbuffer PER_BATCH : register(b0)
{
float4 vfViewPos : packoffset(c0);
float4 cFogColorDensity : packoffset(c1);
float3 vfSunDir : packoffset(c2);
float4 volFogShadowDarkening : packoffset(c3);
float4 PS_WorldViewPos : packoffset(c4);
float3 vfColGradDelta : packoffset(c5);
float4 vfRampParams : packoffset(c6);
float4 vfColGradRadial : packoffset(c7);
float4 vfParams : packoffset(c8);
float4 PS_NearFarClipDist : packoffset(c9);
float4 vfColGradParams : packoffset(c10);
float4 volFogShadowDarkeningSunAmb : packoffset(c11);
float4 PS_ScreenSize : packoffset(c12);
float3 CameraFrontVector : packoffset(c13);
float3 vfColGradBase : packoffset(c14);
float4 PS_HPosScale : packoffset(c15);
}

cbuffer PER_INSTANCE : register(b1)
{
row_major float4x4 mViewProj : packoffset(c0);
}

cbuffer PER_FRAME : register(b2)
{
float4 g_PS_SunLightDir : packoffset(c2);
}

cbuffer PER_MATERIAL : register(b3)
{
float4 MatSpecColor : packoffset(c1);
float2 __0RealtimeReflMul__1EnvCubeReflMul__2__3 : packoffset(c6);
float2 __0DetailNormalsScale__1NormalsScale__2__3 : packoffset(c7);
float4 __0__1__2__3EnvCubeScale : packoffset(c8);
float4 __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling : packoffset(c9);
}
SamplerState sceneDepthSampler_s : register(s0);
SamplerState RefractionSampler_s : register(s1);
SamplerState ReflSampler_s : register(s2);
SamplerState WaterNormalsSampler_s : register(s3);
SamplerState volFogShadowSampler_s : register(s4);
Texture2D<float4> WaterNormalsSampler : register(t0);
Texture2D<float4> RefractionSampler : register(t1);
Texture2D<float4> sceneDepthSampler : register(t2);
Texture2D<float4> ReflSampler : register(t3);
Texture2D<float4> volFogShadowSampler : register(t4);

Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main(
float4 v0 : SV_Position0,
float4 v1 : TEXCOORD0,
float4 v2 : TEXCOORD1,
float4 v3 : TEXCOORD2,
float4 v4 : TEXCOORD3,
float4 v5 : TEXCOORD4,
out float4 o0 : SV_Target0)
{
float4 r0,r1,r2,r3,r4,r5;
uint4 bitmask, uiDest;
float4 fDest;

r0.xy = float2(0.25,0.25) * v1.xy;
r0.xyz = WaterNormalsSampler.Sample(WaterNormalsSampler_s, r0.xy).xyw;
r0.xyz = r0.xyz * float3(0.150000006,0.150000006,0.100000001) + float3(-0.075000003,-0.075000003,-0.0500000007);
r0.w = dot(v3.xyz, v3.xyz);
r0.w = rsqrt(r0.w);
r1.xyz = v3.xyz * r0.www;
r0.xyzw = r1.xyxy * r0.zzzz + r0.xyxy;
r2.xy = v1.xy * float2(1,1) + r0.zw;
r2.xyz = WaterNormalsSampler.Sample(WaterNormalsSampler_s, r2.xy).xyw;
r2.xyz = r2.xyz * float3(0.150000006,0.150000006,0.100000001) + float3(-0.075000003,-0.075000003,-0.0500000007);
r2.xyzw = r1.xyxy * r2.zzzz + r2.xyxy;
r0.xyzw = r2.xyzw + r0.xyzw;
r2.xy = float2(0.5,0.5) * v1.zw;
r1.w = __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling.w * __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling.z;
r2.xy = r2.xy / r1.ww;
r1.w = r1.w + r1.w;
r2.xy = r2.xy * r1.ww + r0.xy;
r2.xy = WaterNormalsSampler.Sample(WaterNormalsSampler_s, r2.xy).xy;
r2.xy = r2.xy * float2(2,2) + float2(-1,-1);
r3.xyzw = v1.xyxy / __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling.wwww;
r4.xyzw = __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling.wwww * float4(0.25,0.25,1,1);
r0.xyzw = r3.xyzw * r4.xyzw + r0.xyzw;
r3.xyz = WaterNormalsSampler.Sample(WaterNormalsSampler_s, r0.xy).xyz;
r0.xyz = WaterNormalsSampler.Sample(WaterNormalsSampler_s, r0.zw).xyz;
r3.xyz = r3.xyz * float3(2,2,2) + float3(-1,-1,-1);
r0.xyz = r0.xyz * float3(2,2,2) + r3.xyz;
r0.xy = r2.xy * __0DetailNormalsScale__1NormalsScale__2__3.xx + r0.xy;
r0.xyz = float3(-1,-1,-1) + r0.xyz;
r0.xy = __0DetailNormalsScale__1NormalsScale__2__3.yy * r0.xy;
r0.w = dot(r0.xyz, r0.xyz);
r0.w = rsqrt(r0.w);
r2.xyz = r0.xyz * r0.www + float3(-0,-0,-1);
r0.xyz = r0.xyz * r0.www;
r2.xyz = r2.xyz * float3(0.300000012,0.300000012,0.300000012) + float3(0,0,1);
r3.xyz = PS_WorldViewPos.xyz + -v5.xyz;
r0.w = dot(r3.xyz, r2.xyz);
r0.w = r0.w + r0.w;
r2.xyz = r2.xyz * -r0.www + r3.xyz;
r0.w = dot(r2.xyz, r2.xyz);
r0.w = rsqrt(r0.w);
r2.xyz = r2.xyz * r0.www + v5.xyz;
r2.w = 1;
r3.x = dot(mViewProj._m00_m01_m02_m03, r2.xyzw);
r3.y = dot(mViewProj._m10_m11_m12_m13, r2.xyzw);
r0.w = dot(mViewProj._m30_m31_m32_m33, r2.xyzw);
r2.xy = r3.xy / r0.ww;
r3.xyz = v5.xyz;
r3.w = 1;
r4.x = dot(mViewProj._m00_m01_m02_m03, r3.xyzw);
r4.y = dot(mViewProj._m10_m11_m12_m13, r3.xyzw);
r0.w = dot(mViewProj._m30_m31_m32_m33, r3.xyzw);
r2.zw = r4.xy / r0.ww;
r2.xy = r2.xy + -r2.zw;
r0.w = dot(r2.xy, r2.xy);
r0.w = rsqrt(r0.w);
r2.xy = r2.xy * r0.ww;
r2.xy = PS_HPosScale.xy * r2.xy;
r0.w = 0.5 * PS_ScreenSize.y;
r0.w = log2(r0.w);
r0.w = -4 + r0.w;
r0.w = -MatSpecColor.w * r0.w + r0.w;
r2.xy = r2.xy * r0.ww;
r2.xy = PS_ScreenSize.ww * r2.xy;
r2.xy = float2(64,64) * r2.xy;
r2.zw = v2.xy / v2.ww;
r0.w = sceneDepthSampler.Sample(sceneDepthSampler_s, r2.zw).x;
r1.w = r0.w * PS_NearFarClipDist.y + -v2.w;
r0.w = PS_NearFarClipDist.y * r0.w;
r1.w = saturate(__0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling.x * r1.w);
r3.xy = r1.ww * r0.xy;
r0.x = dot(r1.xyz, r0.xyz);
r0.y = dot(r1.xyz, CameraFrontVector.xyz);
r0.x = -r0.x * v3.w + 1;
r1.xy = v2.zz * r3.xy;
r3.xw = float2(0.150000006,0.150000006);
r3.yz = PS_HPosScale.yx;
r3.xy = r3.xy * r1.xy;
r3.xy = r3.xy * r3.zw + r2.zw;
r0.z = -r1.y * r3.w + 1;
r4.z = -r0.z * PS_HPosScale.y + 1;
r0.z = sceneDepthSampler.Sample(sceneDepthSampler_s, r3.xy).x;
r0.z = PS_NearFarClipDist.y * r0.z;
r0.z = v2.w < r0.z;
r0.z = r0.z ? 1.000000 : 0;
r1.z = 0.150000006 * r1.x;
r1.xy = PS_HPosScale.xy * r1.xy;
r4.x = r1.z * r3.z;
r3.xy = r4.xz * r0.zz + r2.zw;
r3.xyzw = ReflSampler.SampleGrad(ReflSampler_s, r3.xy, r2.xy, float2(0,0)).xyzw;
r0.z = r3.w * r3.w;
r0.z = 32 * r0.z;
r3.xyz = r3.xyz * r0.zzz;
r3.xyz = r3.xyz / g_PS_SunLightDir.www;
r2.xy = r1.xy * float2(0.0985000059,0.0985000059) + r2.zw;
r0.z = sceneDepthSampler.Sample(sceneDepthSampler_s, r2.xy).x;
r4.z = PS_NearFarClipDist.y * r0.z;
r5.xyzw = r1.xyxy * float4(0.102499999,0.102499999,0.100000001,0.100000001) + r2.zwzw;
r1.xy = float2(0.100000001,0.100000001) * r1.xy;
r0.z = sceneDepthSampler.Sample(sceneDepthSampler_s, r5.zw).x;
r1.z = sceneDepthSampler.Sample(sceneDepthSampler_s, r5.xy).x;
r4.y = PS_NearFarClipDist.y * r0.z;
r4.x = PS_NearFarClipDist.y * r1.z;
r0.z = r1.z * PS_NearFarClipDist.y + -r0.w;
r4.xyz = v2.www < r4.xyz;
r4.xyz = r4.xyz ? 1.000000 : 0;
r2.xy = r4.xx * r1.xy;
r2.xy = r2.xy * float2(1.02499998,1.02499998) + r2.zw;
r5.x = RefractionSampler.Sample(RefractionSampler_s, r2.xy).x;
r2.xy = r4.zz * r1.xy;
r1.xy = r1.xy * r4.yy + r2.zw;
r0.z = r4.x * r0.z + r0.w;
r5.y = RefractionSampler.Sample(RefractionSampler_s, r1.xy).y;
r1.xy = r2.xy * float2(0.985000014,0.985000014) + r2.zw;
r0.w = volFogShadowSampler.Sample(volFogShadowSampler_s, r2.zw).w;
r5.z = RefractionSampler.Sample(RefractionSampler_s, r1.xy).z;
r1.xyz = r5.xyz / g_PS_SunLightDir.www;
r1.xyz = -cFogColorDensity.xyz + r1.xyz;
r2.x = dot(v3.xyz, CameraFrontVector.xyz);
r0.z = -r2.x + r0.z;
r0.z = max(0, r0.z);
r0.z = -cFogColorDensity.w * r0.z;
r0.y = r0.z / r0.y;
r0.y = exp2(r0.y);
r0.y = min(1, r0.y);
r1.xyz = r0.yyy * r1.xyz + cFogColorDensity.xyz;
r2.xyz = r3.xyz + -r1.xyz;
r0.y = r0.x * r0.x;
r0.y = r0.y * r0.y;
r0.x = r0.x * r0.y;
r0.x = saturate(r0.x * 0.949999988 + 0.0500000007);
r0.y = saturate(-0.330000013 + v2.w);
r0.y = r1.w * r0.y;
r0.x = r0.x * r0.y;
r1.xyz = r0.xxx * r2.xyz + r1.xyz;
r0.x = saturate(v5.z * vfColGradParams.x + vfColGradParams.y);
r0.z = 2 + -r0.x;
r0.x = r0.x * r0.z;
r2.xyz = r0.xxx * vfColGradDelta.xyz + vfColGradBase.xyz;
r0.x = dot(-v3.xyz, -v3.xyz);
r0.z = rsqrt(r0.x);
r0.x = sqrt(r0.x);
r3.xyz = -v3.xyz * r0.zzz;
r0.z = dot(r3.xyz, vfSunDir.xyz);
r0.z = r0.z * -vfColGradParams.z + vfColGradParams.z;
r0.z = exp2(r0.z);
r1.w = saturate(vfColGradRadial.w * r0.x);
r1.w = log2(r1.w);
r1.w = vfColGradParams.w * r1.w;
r1.w = exp2(r1.w);
r0.z = r1.w * r0.z;
r3.xyz = vfColGradRadial.xyz * r0.zzz;
r4.xy = saturate(r0.ww * volFogShadowDarkeningSunAmb.xz + volFogShadowDarkeningSunAmb.yw);
r3.xyz = r4.xxx * r3.xyz;
r2.xyz = r2.xyz * r4.yyy + r3.xyz;
r3.xyz = volFogShadowDarkening.xxx * r2.xyz;
r2.xyz = -r2.xyz * volFogShadowDarkening.xxx + r2.xyz;
r2.xyz = r0.www * r2.xyz + r3.xyz;
r2.xyz = r2.xyz + -r1.xyz;
r0.yzw = r0.yyy * r2.xyz + r1.xyz;
r1.xyz = r1.xyz + -r0.yzw;
r1.w = vfParams.x * -v3.z;
r2.x = 1.44269502 * r1.w;
r2.x = exp2(r2.x);
r2.x = -1 + r2.x;
r2.x = r2.x / r1.w;
r1.w = 0.00999999978 < abs(r1.w);
r1.w = r1.w ? r2.x : 1;
r2.x = vfParams.y * r0.x;
r0.x = saturate(r0.x * vfRampParams.x + vfRampParams.y);
r1.w = r2.x * r1.w;
r1.w = exp2(-r1.w);
r1.w = min(1, r1.w);
r1.w = 1 + -r1.w;
r2.x = 2 + -r0.x;
r0.x = r2.x * r0.x;
r0.x = r0.x * vfRampParams.z + vfRampParams.w;
r0.x = -r1.w * r0.x + 1;
r0.x = saturate(max(vfParams.w, r0.x));
r0.xyz = r0.xxx * r1.xyz + r0.yzw;
o0.xyz = g_PS_SunLightDir.www * r0.xyz;
o0.w = 1;
return;
}



I'm still looking at de67 shader, but initial look seems pretty good. If I tweak the settings to prefer flow control, that big block of if statements in the middle is identical.

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

#50
Posted 07/25/2015 12:45 AM   
OK, next shader here, the de67fe4f68dba921-ps_replace.txt. I'm confident that this shader produces the same result as the original ASM. I don't see any problems with the ASM generated here. With a couple of small tweaks, including emphasizing the flow control, here is a diff comparison so that you can see the original file, and the recompiled HLSL code, side by side, with differences. https://www.diffchecker.com/snvjatgr Note how close those are. There are always some re-ordering of code, and using different variables, but if you follow the code, you get the same results. The _discard_ operation at the top for example. While it looks different, the logic is the same. The big block in the middle causes the warnings, but those happen in either case, and seem to be part of the original shader actually. You can see that with this mode of emphasize flow control, that they are identical. Here is a small tweak on that file to improve the naming of the variables, but no other changes to the code. [code]cbuffer PER_BATCH : register(b0) { row_major float4x4 mViewProjPrev : packoffset(c0); float4 PS_WorldViewPos : packoffset(c4); float4 vBBoxMin : packoffset(c5); float4 vBBoxMax : packoffset(c6); float4 PS_NearFarClipDist : packoffset(c7); float4 PS_HPosScale : packoffset(c8); } cbuffer PER_INSTANCE : register(b1) { row_major float4x4 mViewProj : packoffset(c0); } cbuffer PER_FRAME : register(b2) { float4 g_PS_SunLightDir : packoffset(c2); float4 g_PS_ProjRatio : packoffset(c223); } cbuffer PER_MATERIAL : register(b3) { float4 MatSpecColor : packoffset(c1); float2 __0RealtimeReflMul__1EnvCubeReflMul__2__3 : packoffset(c6); float2 __0DetailNormalsScale__1NormalsScale__2__3 : packoffset(c7); float4 __0__1__2__3EnvCubeScale : packoffset(c8); float4 __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling : packoffset(c9); } SamplerState RefractionHalfResSampler_s : register(s0); SamplerState ReflSamplerPrev_s : register(s1); SamplerState envMapSamplerCUBE_s : register(s2); SamplerState sceneDepthSamplerScaled_s : register(s3); Texture2D<float4> sceneDepthSamplerScaled : register(t0); TextureCube<float4> envMapSamplerCUBE : register(t1); Texture2D<float4> RefractionHalfResSampler : register(t2); Texture2D<float4> ReflSamplerPrev : register(t3); Texture2D<float4> StereoParams : register(t125); Texture1D<float4> IniParams : register(t120); void main( float4 v0 : SV_Position0, float4 v1 : TEXCOORD0, float4 v2 : TEXCOORD1, float4 v3 : TEXCOORD2, float4 v4 : TEXCOORD3, float4 v5 : TEXCOORD4, out float4 o0 : SV_Target0) { float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14; uint4 bitmask, uiDest; float4 fDest; r0.z = PS_NearFarClipDist.w * v2.w; r1.xy = v2.xy / v2.ww; r1.x = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r1.xy).x; r1.x = -v2.w * PS_NearFarClipDist.w + r1.x; r1.x = r1.x < 0; if (r1.x != 0) discard; r1.xyz = PS_WorldViewPos.xyz + -v5.xyz; r1.xyz = r1.zzz * float3(-0,-0,-2) + r1.xyz; r1.w = dot(r1.xyz, r1.xyz); r1.w = rsqrt(r1.w); r1.xyz = r1.xyz * r1.www; r2.xyz = vBBoxMax.xyz + vBBoxMin.xyz; r3.xyz = float3(0.5,0.5,0.5) * r2.xyz; r4.xyz = -r2.xyz * float3(0.5,0.5,0.5) + vBBoxMax.xyz; r4.xyz = __0__1__2__3EnvCubeScale.www * r4.xyz + r3.xyz; r5.xyz = -r2.xyz * float3(0.5,0.5,0.5) + vBBoxMin.xyz; r3.xyz = __0__1__2__3EnvCubeScale.www * r5.xyz + r3.xyz; r4.xyz = -v5.xyz + r4.xyz; r4.xyz = r4.xyz / r1.xyz; r3.xyz = -v5.xyz + r3.xyz; r3.xyz = r3.xyz / r1.xyz; r5.xyz = float3(0,0,0) < r1.xyz; r3.xyz = r5.xyz ? r3.xyz : r4.xyz; r1.w = min(r3.x, r3.y); r1.w = min(r1.w, r3.z); r1.xyz = r1.xyz * r1.www + v5.xyz; r1.xyz = -r2.xyz * float3(0.5,0.5,0.5) + r1.xyz; r1.w = -MatSpecColor.w * 6 + 6; r1.xyzw = envMapSamplerCUBE.SampleLevel(envMapSamplerCUBE_s, r1.xyz, r1.w).xyzw; r1.w = r1.w * r1.w; r1.w = 16 * r1.w; r1.xyz = r1.xyz * r1.www; r1.xyz = MatSpecColor.xyz * r1.xyz; r1.w = 0.150000006 * PS_HPosScale.y; r2.xyz = -PS_WorldViewPos.xyz + v5.xyz; r2.w = dot(r2.xyz, r2.xyz); r2.w = rsqrt(r2.w); r2.xyz = r2.xyz * r2.www; r3.xyz = r2.zzz * float3(-0,-0,-2) + r2.xyz; r2.w = dot(r3.xyz, r3.xyz); r2.w = rsqrt(r2.w); r3.xyz = r3.xyz * r2.www; r4.xyz = v5.xyz; r4.w = 1; r5.x = dot(mViewProj._m00_m01_m02_m03, r4.xyzw); r5.y = dot(mViewProj._m10_m11_m12_m13, r4.xyzw); r0.w = dot(mViewProj._m30_m31_m32_m33, r4.xyzw); r2.w = 0.5 * r0.w; r5.xy = r5.xy * float2(0.5,-0.5) + r2.ww; r0.xy = PS_HPosScale.xy * r5.xy; r5.xyz = r3.xyz * float3(129,129,129) + v5.xyz; r5.w = 1; r6.x = dot(mViewProj._m00_m01_m02_m03, r5.xyzw); r6.y = dot(mViewProj._m10_m11_m12_m13, r5.xyzw); r2.w = dot(mViewProj._m30_m31_m32_m33, r5.xyzw); r3.w = 0.5 * r2.w; r5.xy = r6.xy * float2(0.5,-0.5) + r3.ww; r5.xy = PS_HPosScale.xy * r5.xy; r5.xy = r5.xy / r2.ww; r2.w = 1 + -r5.y; r2.w = min(r2.w, r5.y); r3.w = r1.w < r2.w; r2.w = saturate(r2.w / r1.w); r6.w = r3.w ? 1 : r2.w; r2.w = 3.1875 / PS_NearFarClipDist.y; r7.xyz = r3.xyz * float3(17,17,17) + v5.xyz; r7.w = 1; r8.x = dot(mViewProj._m00_m01_m02_m03, r7.xyzw); r8.y = dot(mViewProj._m10_m11_m12_m13, r7.xyzw); r3.w = dot(mViewProj._m20_m21_m22_m23, r7.xyzw); r7.w = dot(mViewProj._m30_m31_m32_m33, r7.xyzw); r3.w = r3.w / r7.w; r3.w = -g_PS_ProjRatio.x + r3.w; r7.z = g_PS_ProjRatio.y / r3.w; r3.w = 0.5 * r7.w; r5.zw = r8.xy * float2(0.5,-0.5) + r3.ww; r7.xy = PS_HPosScale.xy * r5.zw; r8.xyzw = r7.xyzw + -r0.xyzw; r9.xyzw = r8.xyzw * float4(0.125,0.125,0.125,0.125) + r0.xyzw; r5.zw = r9.xy / r9.ww; r3.w = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r5.zw).x; r3.w = r3.w + -r9.z; r3.w = abs(r3.w) >= r2.w; r9.xyzw = r8.xyzw * float4(0.25,0.25,0.25,0.25) + r0.xyzw; r5.zw = r9.xy / r9.ww; r5.z = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r5.zw).x; r10.xyzw = r8.xyzw * float4(0.375,0.375,0.375,0.375) + r0.xyzw; r9.xy = r10.xy / r10.ww; r5.w = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r9.xy).x; r11.xyzw = r8.xyzw * float4(0.5,0.5,0.5,0.5) + r0.xyzw; r9.xy = r11.xy / r11.ww; r9.x = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r9.xy).x; r12.xyzw = r8.xyzw * float4(0.625,0.625,0.625,0.625) + r0.xyzw; r9.yw = r12.xy / r12.ww; r9.y = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r9.yw).x; r13.xyzw = r8.xyzw * float4(0.75,0.75,0.75,0.75) + r0.xyzw; r10.xy = r13.xy / r13.ww; r9.w = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r10.xy).x; r14.xyzw = r8.xyzw * float4(0.875,0.875,0.875,0.875) + r0.xyzw; r10.xy = r14.xy / r14.ww; r0.z = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r10.xy).x; r7.xy = r7.xy / r7.ww; r7.x = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r7.xy).x; if (r3.w != 0) { r3.w = r5.z + -r9.z; r3.w = abs(r3.w) >= r2.w; if (r3.w != 0) { r3.w = r5.w + -r10.z; r3.w = abs(r3.w) >= r2.w; if (r3.w != 0) { r3.w = r9.x + -r11.z; r3.w = abs(r3.w) >= r2.w; if (r3.w != 0) { r3.w = r9.y + -r12.z; r3.w = abs(r3.w) >= r2.w; if (r3.w != 0) { r3.w = r9.w + -r13.z; r3.w = abs(r3.w) >= r2.w; if (r3.w != 0) { r0.z = r0.z + -r14.z; r0.z = abs(r0.z) >= r2.w; if (r0.z != 0) { r0.z = r7.x + -r7.z; r0.z = abs(r0.z) >= r2.w; r0.z = r0.z ? 0 : 1; } else { r0.z = 0.875; } } else { r0.z = 0.75; } } else { r0.z = 0.625; } } else { r0.z = 0.5; } } else { r0.z = 0.375; } } else { r0.z = 0.25; } } else { r0.z = 0.125; } r2.w = 0 < r0.z; if (r2.w != 0) { r0.xyw = r8.xyw * r0.zzz + r0.xyw; r0.xy = r0.xy / r0.ww; r7.xyzw = RefractionHalfResSampler.SampleLevel(RefractionHalfResSampler_s, r0.xy, 0).xyzw; r0.x = 32 * r7.w; r6.xyz = r7.xyz * r0.xxx; r0.x = 1 + -r0.y; r0.x = min(r0.x, r0.y); r0.y = r1.w < r0.x; r0.x = saturate(r0.x / r1.w); r0.x = r0.y ? 1 : r0.x; r0.y = 1 + -r0.z; r6.w = r0.x * r0.y + r6.w; } else { r0.xyzw = RefractionHalfResSampler.SampleLevel(RefractionHalfResSampler_s, r5.xy, 0).xyzw; r0.w = 32 * r0.w; r6.xyz = r0.xyz * r0.www; } r0.x = dot(r2.xyz, r3.xyz); r0.x = saturate(0.5 + r0.x); r0.xyzw = r6.xyzw * r0.xxxx; r0.xyz = r0.xyz * r0.www; r0.xyz = r0.xyz / g_PS_SunLightDir.www; r1.xyz = __0RealtimeReflMul__1EnvCubeReflMul__2__3.yyy * r1.xyz; r0.w = min(1, r0.w); r0.xyz = r0.xyz * __0RealtimeReflMul__1EnvCubeReflMul__2__3.xxx + -r1.xyz; r0.xyz = r0.www * r0.xyz + r1.xyz; r1.x = dot(mViewProjPrev._m00_m01_m02_m03, r4.xyzw); r1.y = dot(mViewProjPrev._m10_m11_m12_m13, r4.xyzw); r0.w = dot(mViewProjPrev._m30_m31_m32_m33, r4.xyzw); r1.xy = r1.xy * float2(1,-1) + r0.ww; r1.xy = float2(0.5,0.5) * r1.xy; r1.xy = r1.xy / r0.ww; r2.x = PS_HPosScale.z * r1.x; r0.w = 1 + -r1.y; r2.y = -r0.w * PS_HPosScale.w + 1; r1.xyzw = ReflSamplerPrev.Sample(ReflSamplerPrev_s, r2.xy).xyzw; r0.w = r1.w * r1.w; r0.w = 32 * r0.w; r1.xyz = r1.xyz * r0.www; r1.xyz = r1.xyz / g_PS_SunLightDir.www; r1.xyz = float3(0.25,0.25,0.25) * r1.xyz; r0.xyz = r0.xyz * float3(0.75,0.75,0.75) + r1.xyz; r0.xyz = g_PS_SunLightDir.www * r0.xyz; r0.w = 1; r0.w = saturate(dot(r0.xyzw, float4(0.03125,0.03125,0.03125,0.00392156886))); r0.w = 255 * r0.w; r0.w = ceil(r0.w); r1.xy = float2(0.00392156886,0.125490203) * r0.ww; o0.xyz = r0.xyz / r1.yyy; o0.w = sqrt(r1.x); return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HLSL errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\GAMES\Crysis 3\wrapper1349(188,24-35): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation D:\GAMES\Crysis 3\wrapper1349(185,22-34): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation D:\GAMES\Crysis 3\wrapper1349(182,20-32): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation D:\GAMES\Crysis 3\wrapper1349(179,18-30): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation D:\GAMES\Crysis 3\wrapper1349(176,16-28): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation D:\GAMES\Crysis 3\wrapper1349(173,14-26): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation D:\GAMES\Crysis 3\wrapper1349(170,12-23): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code]
OK, next shader here, the de67fe4f68dba921-ps_replace.txt. I'm confident that this shader produces the same result as the original ASM. I don't see any problems with the ASM generated here.

With a couple of small tweaks, including emphasizing the flow control, here is a diff comparison so that you can see the original file, and the recompiled HLSL code, side by side, with differences.


https://www.diffchecker.com/snvjatgr



Note how close those are. There are always some re-ordering of code, and using different variables, but if you follow the code, you get the same results. The _discard_ operation at the top for example. While it looks different, the logic is the same.

The big block in the middle causes the warnings, but those happen in either case, and seem to be part of the original shader actually. You can see that with this mode of emphasize flow control, that they are identical.


Here is a small tweak on that file to improve the naming of the variables, but no other changes to the code.

cbuffer PER_BATCH : register(b0)
{
row_major float4x4 mViewProjPrev : packoffset(c0);
float4 PS_WorldViewPos : packoffset(c4);
float4 vBBoxMin : packoffset(c5);
float4 vBBoxMax : packoffset(c6);
float4 PS_NearFarClipDist : packoffset(c7);
float4 PS_HPosScale : packoffset(c8);
}

cbuffer PER_INSTANCE : register(b1)
{
row_major float4x4 mViewProj : packoffset(c0);
}

cbuffer PER_FRAME : register(b2)
{
float4 g_PS_SunLightDir : packoffset(c2);
float4 g_PS_ProjRatio : packoffset(c223);
}

cbuffer PER_MATERIAL : register(b3)
{
float4 MatSpecColor : packoffset(c1);
float2 __0RealtimeReflMul__1EnvCubeReflMul__2__3 : packoffset(c6);
float2 __0DetailNormalsScale__1NormalsScale__2__3 : packoffset(c7);
float4 __0__1__2__3EnvCubeScale : packoffset(c8);
float4 __0SoftIntersectionFactor__1RainTilling__2DetailTilling__3Tilling : packoffset(c9);
}
SamplerState RefractionHalfResSampler_s : register(s0);
SamplerState ReflSamplerPrev_s : register(s1);
SamplerState envMapSamplerCUBE_s : register(s2);
SamplerState sceneDepthSamplerScaled_s : register(s3);
Texture2D<float4> sceneDepthSamplerScaled : register(t0);
TextureCube<float4> envMapSamplerCUBE : register(t1);
Texture2D<float4> RefractionHalfResSampler : register(t2);
Texture2D<float4> ReflSamplerPrev : register(t3);

Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main(
float4 v0 : SV_Position0,
float4 v1 : TEXCOORD0,
float4 v2 : TEXCOORD1,
float4 v3 : TEXCOORD2,
float4 v4 : TEXCOORD3,
float4 v5 : TEXCOORD4,
out float4 o0 : SV_Target0)
{
float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14;
uint4 bitmask, uiDest;
float4 fDest;

r0.z = PS_NearFarClipDist.w * v2.w;
r1.xy = v2.xy / v2.ww;
r1.x = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r1.xy).x;
r1.x = -v2.w * PS_NearFarClipDist.w + r1.x;
r1.x = r1.x < 0;
if (r1.x != 0) discard;
r1.xyz = PS_WorldViewPos.xyz + -v5.xyz;
r1.xyz = r1.zzz * float3(-0,-0,-2) + r1.xyz;
r1.w = dot(r1.xyz, r1.xyz);
r1.w = rsqrt(r1.w);
r1.xyz = r1.xyz * r1.www;
r2.xyz = vBBoxMax.xyz + vBBoxMin.xyz;
r3.xyz = float3(0.5,0.5,0.5) * r2.xyz;
r4.xyz = -r2.xyz * float3(0.5,0.5,0.5) + vBBoxMax.xyz;
r4.xyz = __0__1__2__3EnvCubeScale.www * r4.xyz + r3.xyz;
r5.xyz = -r2.xyz * float3(0.5,0.5,0.5) + vBBoxMin.xyz;
r3.xyz = __0__1__2__3EnvCubeScale.www * r5.xyz + r3.xyz;
r4.xyz = -v5.xyz + r4.xyz;
r4.xyz = r4.xyz / r1.xyz;
r3.xyz = -v5.xyz + r3.xyz;
r3.xyz = r3.xyz / r1.xyz;
r5.xyz = float3(0,0,0) < r1.xyz;
r3.xyz = r5.xyz ? r3.xyz : r4.xyz;
r1.w = min(r3.x, r3.y);
r1.w = min(r1.w, r3.z);
r1.xyz = r1.xyz * r1.www + v5.xyz;
r1.xyz = -r2.xyz * float3(0.5,0.5,0.5) + r1.xyz;
r1.w = -MatSpecColor.w * 6 + 6;
r1.xyzw = envMapSamplerCUBE.SampleLevel(envMapSamplerCUBE_s, r1.xyz, r1.w).xyzw;
r1.w = r1.w * r1.w;
r1.w = 16 * r1.w;
r1.xyz = r1.xyz * r1.www;
r1.xyz = MatSpecColor.xyz * r1.xyz;
r1.w = 0.150000006 * PS_HPosScale.y;
r2.xyz = -PS_WorldViewPos.xyz + v5.xyz;
r2.w = dot(r2.xyz, r2.xyz);
r2.w = rsqrt(r2.w);
r2.xyz = r2.xyz * r2.www;
r3.xyz = r2.zzz * float3(-0,-0,-2) + r2.xyz;
r2.w = dot(r3.xyz, r3.xyz);
r2.w = rsqrt(r2.w);
r3.xyz = r3.xyz * r2.www;
r4.xyz = v5.xyz;
r4.w = 1;
r5.x = dot(mViewProj._m00_m01_m02_m03, r4.xyzw);
r5.y = dot(mViewProj._m10_m11_m12_m13, r4.xyzw);
r0.w = dot(mViewProj._m30_m31_m32_m33, r4.xyzw);
r2.w = 0.5 * r0.w;
r5.xy = r5.xy * float2(0.5,-0.5) + r2.ww;
r0.xy = PS_HPosScale.xy * r5.xy;
r5.xyz = r3.xyz * float3(129,129,129) + v5.xyz;
r5.w = 1;
r6.x = dot(mViewProj._m00_m01_m02_m03, r5.xyzw);
r6.y = dot(mViewProj._m10_m11_m12_m13, r5.xyzw);
r2.w = dot(mViewProj._m30_m31_m32_m33, r5.xyzw);
r3.w = 0.5 * r2.w;
r5.xy = r6.xy * float2(0.5,-0.5) + r3.ww;
r5.xy = PS_HPosScale.xy * r5.xy;
r5.xy = r5.xy / r2.ww;
r2.w = 1 + -r5.y;
r2.w = min(r2.w, r5.y);
r3.w = r1.w < r2.w;
r2.w = saturate(r2.w / r1.w);
r6.w = r3.w ? 1 : r2.w;
r2.w = 3.1875 / PS_NearFarClipDist.y;
r7.xyz = r3.xyz * float3(17,17,17) + v5.xyz;
r7.w = 1;
r8.x = dot(mViewProj._m00_m01_m02_m03, r7.xyzw);
r8.y = dot(mViewProj._m10_m11_m12_m13, r7.xyzw);
r3.w = dot(mViewProj._m20_m21_m22_m23, r7.xyzw);
r7.w = dot(mViewProj._m30_m31_m32_m33, r7.xyzw);
r3.w = r3.w / r7.w;
r3.w = -g_PS_ProjRatio.x + r3.w;
r7.z = g_PS_ProjRatio.y / r3.w;
r3.w = 0.5 * r7.w;
r5.zw = r8.xy * float2(0.5,-0.5) + r3.ww;
r7.xy = PS_HPosScale.xy * r5.zw;
r8.xyzw = r7.xyzw + -r0.xyzw;
r9.xyzw = r8.xyzw * float4(0.125,0.125,0.125,0.125) + r0.xyzw;
r5.zw = r9.xy / r9.ww;
r3.w = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r5.zw).x;
r3.w = r3.w + -r9.z;
r3.w = abs(r3.w) >= r2.w;
r9.xyzw = r8.xyzw * float4(0.25,0.25,0.25,0.25) + r0.xyzw;
r5.zw = r9.xy / r9.ww;
r5.z = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r5.zw).x;
r10.xyzw = r8.xyzw * float4(0.375,0.375,0.375,0.375) + r0.xyzw;
r9.xy = r10.xy / r10.ww;
r5.w = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r9.xy).x;
r11.xyzw = r8.xyzw * float4(0.5,0.5,0.5,0.5) + r0.xyzw;
r9.xy = r11.xy / r11.ww;
r9.x = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r9.xy).x;
r12.xyzw = r8.xyzw * float4(0.625,0.625,0.625,0.625) + r0.xyzw;
r9.yw = r12.xy / r12.ww;
r9.y = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r9.yw).x;
r13.xyzw = r8.xyzw * float4(0.75,0.75,0.75,0.75) + r0.xyzw;
r10.xy = r13.xy / r13.ww;
r9.w = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r10.xy).x;
r14.xyzw = r8.xyzw * float4(0.875,0.875,0.875,0.875) + r0.xyzw;
r10.xy = r14.xy / r14.ww;
r0.z = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r10.xy).x;
r7.xy = r7.xy / r7.ww;
r7.x = sceneDepthSamplerScaled.Sample(sceneDepthSamplerScaled_s, r7.xy).x;
if (r3.w != 0) {
r3.w = r5.z + -r9.z;
r3.w = abs(r3.w) >= r2.w;
if (r3.w != 0) {
r3.w = r5.w + -r10.z;
r3.w = abs(r3.w) >= r2.w;
if (r3.w != 0) {
r3.w = r9.x + -r11.z;
r3.w = abs(r3.w) >= r2.w;
if (r3.w != 0) {
r3.w = r9.y + -r12.z;
r3.w = abs(r3.w) >= r2.w;
if (r3.w != 0) {
r3.w = r9.w + -r13.z;
r3.w = abs(r3.w) >= r2.w;
if (r3.w != 0) {
r0.z = r0.z + -r14.z;
r0.z = abs(r0.z) >= r2.w;
if (r0.z != 0) {
r0.z = r7.x + -r7.z;
r0.z = abs(r0.z) >= r2.w;
r0.z = r0.z ? 0 : 1;
} else {
r0.z = 0.875;
}
} else {
r0.z = 0.75;
}
} else {
r0.z = 0.625;
}
} else {
r0.z = 0.5;
}
} else {
r0.z = 0.375;
}
} else {
r0.z = 0.25;
}
} else {
r0.z = 0.125;
}
r2.w = 0 < r0.z;
if (r2.w != 0) {
r0.xyw = r8.xyw * r0.zzz + r0.xyw;
r0.xy = r0.xy / r0.ww;
r7.xyzw = RefractionHalfResSampler.SampleLevel(RefractionHalfResSampler_s, r0.xy, 0).xyzw;
r0.x = 32 * r7.w;
r6.xyz = r7.xyz * r0.xxx;
r0.x = 1 + -r0.y;
r0.x = min(r0.x, r0.y);
r0.y = r1.w < r0.x;
r0.x = saturate(r0.x / r1.w);
r0.x = r0.y ? 1 : r0.x;
r0.y = 1 + -r0.z;
r6.w = r0.x * r0.y + r6.w;
} else {
r0.xyzw = RefractionHalfResSampler.SampleLevel(RefractionHalfResSampler_s, r5.xy, 0).xyzw;
r0.w = 32 * r0.w;
r6.xyz = r0.xyz * r0.www;
}
r0.x = dot(r2.xyz, r3.xyz);
r0.x = saturate(0.5 + r0.x);
r0.xyzw = r6.xyzw * r0.xxxx;
r0.xyz = r0.xyz * r0.www;
r0.xyz = r0.xyz / g_PS_SunLightDir.www;
r1.xyz = __0RealtimeReflMul__1EnvCubeReflMul__2__3.yyy * r1.xyz;
r0.w = min(1, r0.w);
r0.xyz = r0.xyz * __0RealtimeReflMul__1EnvCubeReflMul__2__3.xxx + -r1.xyz;
r0.xyz = r0.www * r0.xyz + r1.xyz;
r1.x = dot(mViewProjPrev._m00_m01_m02_m03, r4.xyzw);
r1.y = dot(mViewProjPrev._m10_m11_m12_m13, r4.xyzw);
r0.w = dot(mViewProjPrev._m30_m31_m32_m33, r4.xyzw);
r1.xy = r1.xy * float2(1,-1) + r0.ww;
r1.xy = float2(0.5,0.5) * r1.xy;
r1.xy = r1.xy / r0.ww;
r2.x = PS_HPosScale.z * r1.x;
r0.w = 1 + -r1.y;
r2.y = -r0.w * PS_HPosScale.w + 1;
r1.xyzw = ReflSamplerPrev.Sample(ReflSamplerPrev_s, r2.xy).xyzw;
r0.w = r1.w * r1.w;
r0.w = 32 * r0.w;
r1.xyz = r1.xyz * r0.www;
r1.xyz = r1.xyz / g_PS_SunLightDir.www;
r1.xyz = float3(0.25,0.25,0.25) * r1.xyz;
r0.xyz = r0.xyz * float3(0.75,0.75,0.75) + r1.xyz;
r0.xyz = g_PS_SunLightDir.www * r0.xyz;
r0.w = 1;
r0.w = saturate(dot(r0.xyzw, float4(0.03125,0.03125,0.03125,0.00392156886)));
r0.w = 255 * r0.w;
r0.w = ceil(r0.w);
r1.xy = float2(0.00392156886,0.125490203) * r0.ww;
o0.xyz = r0.xyz / r1.yyy;
o0.w = sqrt(r1.x);
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HLSL errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\GAMES\Crysis 3\wrapper1349(188,24-35): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation
D:\GAMES\Crysis 3\wrapper1349(185,22-34): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation
D:\GAMES\Crysis 3\wrapper1349(182,20-32): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation
D:\GAMES\Crysis 3\wrapper1349(179,18-30): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation
D:\GAMES\Crysis 3\wrapper1349(176,16-28): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation
D:\GAMES\Crysis 3\wrapper1349(173,14-26): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation
D:\GAMES\Crysis 3\wrapper1349(170,12-23): warning X4121: gradient-based operations must be moved out of flow control to prevent divergence. Performance may improve by using a non-gradient operation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

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

#51
Posted 07/25/2015 01:57 AM   
Thanks bo3b!! I'm still digging with the water reflections....i look others water with same shaders and the effect when looking down is the same, it's like there is a layer that swift the reflections when you look down....also this happens in 2D without 3Dmigoto (it's an ugly transition)...the second reflection (the one that replace the real reflection) seems to be a 2D image in the surface (similar to watch dog in some windows/glass)...i don't know if possible to fix....i'm still looking. Also there is another effect i'm looking...is the water shine reflections in walls, roof, etc...when the water is moving (when you touch the water for example). All others effect are cover :) [img]https://forums.geforce.com/cmd/default/download-comment-attachment/65396/[/img] [img]https://forums.geforce.com/cmd/default/download-comment-attachment/65397/[/img] [img]https://forums.geforce.com/cmd/default/download-comment-attachment/65398/[/img] [img]https://forums.geforce.com/cmd/default/download-comment-attachment/65399/[/img] [img]https://forums.geforce.com/cmd/default/download-comment-attachment/65400/[/img]
Thanks bo3b!!

I'm still digging with the water reflections....i look others water with same shaders and the effect when looking down is the same, it's like there is a layer that swift the reflections when you look down....also this happens in 2D without 3Dmigoto (it's an ugly transition)...the second reflection (the one that replace the real reflection) seems to be a 2D image in the surface (similar to watch dog in some windows/glass)...i don't know if possible to fix....i'm still looking.


Also there is another effect i'm looking...is the water shine reflections in walls, roof, etc...when the water is moving (when you touch the water for example).

All others effect are cover :)

Image

Image

Image

Image

Image

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

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

#52
Posted 07/25/2015 02:10 AM   
[quote=""]Thanks bo3b!! I'm still digging with the water reflections....i look others water with same shaders and the effect when looking down is the same, it's like there is a layer that swift the reflections when you look down....also this happens in 2D without 3Dmigoto (it's an ugly transition)...the second reflection (the one that replace the real reflection) seems to be a 2D image in the surface (similar to watch dog in some windows/glass)...i don't know if possible to fix....i'm still looking. Also there is another effect i'm looking...is the water shine reflections in walls, roof, etc...when the water is moving (when you touch the water for example). All others effect are cover :)[/quote] Man, that is looking terrific! Great stuff DHR! I've dug into it further, and there is a problem with the 5b48 VS. The two PS are both OK now, but the VS is the one that causes the white water surface and changes when holding down the show-original key of F9. I think the code I gave above should fix this. Edit: OK, I've finished my research on these 3 shaders, and damn if the problem isn't actually a bug in the fxc compiler. There are a lot of confusing optimizations both in our generated code, and the ASM, but the actual problem stems from fxc inverting the comparison of "r0.x = 0 < r1.z;" to be "r0.x = r1.z < 0;" For both the x and y params. That normally would be OK, because it's is a GT, LT setup, except for the fact that one param is negated. Because of that the order does matter here, and it breaks. So... No fix needed for the Decompiler at the moment, although I'm thinking seriously about changing the LT, GT opcodes.
said:Thanks bo3b!!

I'm still digging with the water reflections....i look others water with same shaders and the effect when looking down is the same, it's like there is a layer that swift the reflections when you look down....also this happens in 2D without 3Dmigoto (it's an ugly transition)...the second reflection (the one that replace the real reflection) seems to be a 2D image in the surface (similar to watch dog in some windows/glass)...i don't know if possible to fix....i'm still looking.


Also there is another effect i'm looking...is the water shine reflections in walls, roof, etc...when the water is moving (when you touch the water for example).

All others effect are cover :)

Man, that is looking terrific! Great stuff DHR!

I've dug into it further, and there is a problem with the 5b48 VS. The two PS are both OK now, but the VS is the one that causes the white water surface and changes when holding down the show-original key of F9. I think the code I gave above should fix this.


Edit: OK, I've finished my research on these 3 shaders, and damn if the problem isn't actually a bug in the fxc compiler. There are a lot of confusing optimizations both in our generated code, and the ASM, but the actual problem stems from fxc inverting the comparison of "r0.x = 0 < r1.z;" to be "r0.x = r1.z < 0;" For both the x and y params.

That normally would be OK, because it's is a GT, LT setup, except for the fact that one param is negated. Because of that the order does matter here, and it breaks. So... No fix needed for the Decompiler at the moment, although I'm thinking seriously about changing the LT, GT opcodes.

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

#53
Posted 07/25/2015 07:40 AM   
[quote="DHR"]I just send you a PM with the WIP version.[/quote] I'm afraid I wasn't able to have a look at this today, and I will be away for the next two weeks. I hope you are able to find a solution to the water - the game is looking really great now :) [quote]interaction between some shaders....you mean your fix with HIGH settings, or the issue in the screenshots attached (VERY HIGH)?[/quote]I was just thinking about what you said with the fix disabling after moving and never recovering - wondering if one of the shaders might be outputting something bad that breaks further rendering. The water is rendered using at least two passes, plus it takes into account the result from the previous frame so it is possible that some state carries over. But ultimately I don't know - I wasn't seeing it disable like you described (at least not once I fixed the second pair of shaders it switched to after touching the water and causing a ripple), so I'm not sure what the issue would be.
DHR said:I just send you a PM with the WIP version.

I'm afraid I wasn't able to have a look at this today, and I will be away for the next two weeks. I hope you are able to find a solution to the water - the game is looking really great now :)

interaction between some shaders....you mean your fix with HIGH settings, or the issue in the screenshots attached (VERY HIGH)?
I was just thinking about what you said with the fix disabling after moving and never recovering - wondering if one of the shaders might be outputting something bad that breaks further rendering. The water is rendered using at least two passes, plus it takes into account the result from the previous frame so it is possible that some state carries over. But ultimately I don't know - I wasn't seeing it disable like you described (at least not once I fixed the second pair of shaders it switched to after touching the water and causing a ripple), so I'm not sure what the issue would be.

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

#54
Posted 07/25/2015 05:02 PM   
Is there anything I can do in the meantime?
Is there anything I can do in the meantime?

Thanks to everybody using my assembler it warms my heart.
To have a critical piece of code that everyone can enjoy!
What more can you ask for?

donations: ulfjalmbrant@hotmail.com

#55
Posted 07/25/2015 09:41 PM   
I just look Water reflection with VERY HIGH and now works for me using DarkStarSword approach and the VS fixed by bo3b. There is still one type of reflection that is render in 2D (i think is just a 2D image...LOL). @DarkStarSword, also i remove 2 DS related i fix previously...so i suppose those 2 shaders are in part responsable of the disabled fix. This weekend i will upload a WIP....the game is looking very nice!!
I just look Water reflection with VERY HIGH and now works for me using DarkStarSword approach and the VS fixed by bo3b. There is still one type of reflection that is render in 2D (i think is just a 2D image...LOL).

@DarkStarSword, also i remove 2 DS related i fix previously...so i suppose those 2 shaders are in part responsable of the disabled fix.


This weekend i will upload a WIP....the game is looking very nice!!

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

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

#56
Posted 07/31/2015 01:41 AM   
Just popped online to see how you were doing. For the 2D reflection I was thinking you might try an infinite adjustment instead of the usual stereo correction... Maybe something like this (not sure if the maths are right): [code]float4 inf_adj_v5; inf_adj_v5.xyz = v5 + mul(ivp, float4(stereo.x * stereo.y, 0, 0, 0));[/code] Then experiment with using inf_adj_v5 in place of some of the v5/adj_v5/iadj_v5.
Just popped online to see how you were doing. For the 2D reflection I was thinking you might try an infinite adjustment instead of the usual stereo correction... Maybe something like this (not sure if the maths are right):

float4 inf_adj_v5;
inf_adj_v5.xyz = v5 + mul(ivp, float4(stereo.x * stereo.y, 0, 0, 0));


Then experiment with using inf_adj_v5 in place of some of the v5/adj_v5/iadj_v5.

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

#57
Posted 07/31/2015 08:27 AM   
[b]WIP version:[/b] [u]Fix:[/u] - Shadows - Lights - Sun Beams - Moon - Halos in effects (Water, Smoke, light, others) - Decals - Disappearing / flickering objects - Crosshair depth adjustable "x" iniparams (using texture separation) - Target icons depth adjustable "x" iniparams (using texture separation) - HUD (minimap and Gun info only) toggle on/off ("P" key) - HUD depth adjustable "y" iniparams (using texture separation) - Left trigger / Right Mouse buttom override convergence for aiming. [u]Presets:[/u] - "o" key for cycling through different depth for Crosshair and Target icons - "p" key for enable/disable HUD (minimap and Gun info) [u]Know issues:[/u] - Water Reflection: i'm still looking this. - Water shine reflections on walls, roof, others: i'm still looking this. Recommended settings: - Use VERY HIGH presets, i fix shaders with others settings, but i mainly focus on very high - Use this commands: [code] r_drawnearfov = 2 --> Removes weapon r_ChromaticAberration = 0 --> Disable this effect r_Sharpening = 1 --> Image more sharp[/code] Extract where the .exe is located....the wrapper disable fake3D and enable Nvidia automatic. [url]https://s3.amazonaws.com/dhr/Crysis3.WIP.zip[/url] Enjoy!!
WIP version:

Fix:
- Shadows
- Lights
- Sun Beams
- Moon
- Halos in effects (Water, Smoke, light, others)
- Decals
- Disappearing / flickering objects
- Crosshair depth adjustable "x" iniparams (using texture separation)
- Target icons depth adjustable "x" iniparams (using texture separation)
- HUD (minimap and Gun info only) toggle on/off ("P" key)
- HUD depth adjustable "y" iniparams (using texture separation)
- Left trigger / Right Mouse buttom override convergence for aiming.

Presets:
- "o" key for cycling through different depth for Crosshair and Target icons
- "p" key for enable/disable HUD (minimap and Gun info)

Know issues:
- Water Reflection: i'm still looking this.
- Water shine reflections on walls, roof, others: i'm still looking this.

Recommended settings:
- Use VERY HIGH presets, i fix shaders with others settings, but i mainly focus on very high
- Use this commands:
r_drawnearfov = 2 --> Removes weapon
r_ChromaticAberration = 0 --> Disable this effect
r_Sharpening = 1 --> Image more sharp



Extract where the .exe is located....the wrapper disable fake3D and enable Nvidia automatic.

https://s3.amazonaws.com/dhr/Crysis3.WIP.zip

Enjoy!!

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

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

#58
Posted 08/02/2015 09:51 AM   
Thanks DHR. I`m going to start new play through with it. Much appreciate your effort gents !
Thanks DHR. I`m going to start new play through with it. Much appreciate your effort gents !
DHR that broken water reflection suck big time. This game have lots of those watery areas and this issue disturb me so bad. Can we switch that off for now until you get this sorted or something ? Also i have no problem with guns or bow and i think i`ve put those commands lines in wrong place. Should they be added to c:\User\...\Save Games\Crysis3\game.cfg ? Other then that game looks stunning ! Such a Hugh improvement over previous 3D experience. Greatly appreciate your work. Thanks !
DHR that broken water reflection suck big time. This game have lots of those watery areas and this issue disturb me so bad. Can we switch that off for now until you get this sorted or something ?

Also i have no problem with guns or bow and i think i`ve put those commands lines in wrong place. Should they be added to c:\User\...\Save Games\Crysis3\game.cfg ?

Other then that game looks stunning ! Such a Hugh improvement over previous 3D experience. Greatly appreciate your work. Thanks !
  4 / 10    
Scroll To Top