Thief 4 3d vision
  13 / 13    
http://lists.bo3b.net/wish/index.php

Posted 05/12/2014 10:07 AM   
[quote="Pirateguybrush"]http://lists.bo3b.net/wish/index.php[/quote]I want to emphasize that this is more of a working list, not a mandate. There are a lot of other factors that go into which gets attention, including our own interest in a specific game (it's a lot of personal time for each one), and also how hard we think it might be. It's better for all of us if we work on easier but still popular games. Watch Dogs is a complete unknown, and we might judge it too hard for now. No way to know until we see it. However, I'm going to keep emphasizing anything in the top 20 as being higher priority. Right now, Arma 3 and World of Tanks are at the top of the list. World of Tanks is in detention for bad behavior, so we won't be looking at it until we get others done. Arma 3 I've looked at just briefly, and I'm not sure that we can fix it. The problems it has don't seem to be exactly shader related, more like texture loading bugs or something unclear. Never seen this sort of problem. Watch Dogs is #3, so it's definitely good priority, and I think interesting to all of us. Until the release, I will share that the next one we are looking at is Saint's Row IV. No guarantees of course, right now 3Dmigoto can't do shader hunting for some completely unclear reason.
Pirateguybrush said:http://lists.bo3b.net/wish/index.php
I want to emphasize that this is more of a working list, not a mandate. There are a lot of other factors that go into which gets attention, including our own interest in a specific game (it's a lot of personal time for each one), and also how hard we think it might be. It's better for all of us if we work on easier but still popular games. Watch Dogs is a complete unknown, and we might judge it too hard for now. No way to know until we see it.

However, I'm going to keep emphasizing anything in the top 20 as being higher priority.

Right now, Arma 3 and World of Tanks are at the top of the list. World of Tanks is in detention for bad behavior, so we won't be looking at it until we get others done.

Arma 3 I've looked at just briefly, and I'm not sure that we can fix it. The problems it has don't seem to be exactly shader related, more like texture loading bugs or something unclear. Never seen this sort of problem.

Watch Dogs is #3, so it's definitely good priority, and I think interesting to all of us.

Until the release, I will share that the next one we are looking at is Saint's Row IV. No guarantees of course, right now 3Dmigoto can't do shader hunting for some completely unclear reason.

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 05/12/2014 12:40 PM   
Oooh, that's exciting! I've been waiting for a fix for that, best of luck! Given how similar it is to SR3, hopefully it might be somewhat backwards compatible too. If it's of use to you, I tried SR4 with 3dmigoto a while back, and I seemed to be able to hunt shaders just fine. I could cycle through them at least. Might be worth trying with an earlier version?
Oooh, that's exciting! I've been waiting for a fix for that, best of luck! Given how similar it is to SR3, hopefully it might be somewhat backwards compatible too.

If it's of use to you, I tried SR4 with 3dmigoto a while back, and I seemed to be able to hunt shaders just fine. I could cycle through them at least. Might be worth trying with an earlier version?

Posted 05/12/2014 12:53 PM   
@Pirateguybrush: Hey, thanks for remembering that and reminding me. I did look again, and with SR4, I can do shader hunting with the xbox controller, but not with keyboard. I've mostly switched to keyboard for convenience, but that at least makes it viable while I work out what's up with the keyboard.
@Pirateguybrush: Hey, thanks for remembering that and reminding me.

I did look again, and with SR4, I can do shader hunting with the xbox controller, but not with keyboard. I've mostly switched to keyboard for convenience, but that at least makes it viable while I work out what's up with the keyboard.

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 05/13/2014 02:29 AM   
Funnily enough, I believe I was only able to do it with the keyboard.
Funnily enough, I believe I was only able to do it with the keyboard.

Posted 05/13/2014 03:29 AM   
[quote="Pirateguybrush"]http://lists.bo3b.net/wish/index.php[/quote] Vote added. Thanks
Pirateguybrush said:http://lists.bo3b.net/wish/index.php


Vote added. Thanks

Geforce 560ti
BENQ XL2420T

Posted 05/17/2014 01:21 PM   
[quote="Pirateguybrush"]http://lists.bo3b.net/wish/index.php[/quote] Good poll! Vote added. Cheers!
Pirateguybrush said:http://lists.bo3b.net/wish/index.php


Good poll! Vote added.
Cheers!

Helixmod fixes for 3Dvision / 3Dtvplay
My 3D stereo screenshots
Skyrim Natural Realizm - The 3Dvision Immersive ENB Hub page on Nexus
Skyrim Natural Realizm - The 3Dvision Immersive ENB Gallery
CPU: i7 @ 3.40
GhzRAM: 8Go DDR3
GPU(s): GTX980ti
Display(s): HTC Vive and OptomaHD33 projector with 3D-RF system (3DTVplay)
Result: Gorgious 3D gaming and VR experiences! :D

Posted 06/13/2014 12:56 AM   
My desktop internet is down so I can't access The Crew (online only). So I'm having a go at fixing this in 3dmigoto. Not having much success yet. One of the problem areas is a godray-fog combo. They mostly look good but there's one element (an animated fog) that is at screen depth. It looks a bit shitty. Sorry no screenshot (writing this on my phone). Vs Shader below. Looking at the vs reveals that the effect is comprised of multiple parts. The offending part is o8. Disabling it works, but stuffs up the rest of the god rays. It's as if the other elements use o8 as a sort of alpha channel or filter. I've tried moving it, but doing so seems to move it left/right instead of in depth (I guess that means it's moving it the same direction for both eyes? Could it have something to do with the pre-existing stereoParams in the code? How should I deal with that? Also, when I move the fog left or right, it creates a halo image of the furniture in the room. Evidently, the fog is drawn over the top of everything, with a furniture - shaped hole cut into it so that it appears that the furniture is in front of the fog. Hope you get what I mean. I tried placing the code further up to see if it could make the fog render without this hole, but I got out of my depth pretty quick. Any suggestions on how to tackle this? Particularly, how to deal with the pre-existing stereoParams code? The game has inbuilt 3d options, but they don't seem to do anything 3dvision doesn't already do, and it automatically turns on in the options when 3dvision is enabled. There are "depth" and "separation" sliders which work. [code] //godrays in opening room - part of the fog is at screendepth cbuffer cb1 : register(b1) { float4 cb1[4]; } cbuffer cb0 : register(b0) { float4 cb0[53]; } Texture2D<float4> StereoParams : register(t125); Texture1D<float4> IniParams : register(t120); void main( float4 v0 : POSITION0, float3 v1 : TANGENT0, float4 v2 : NORMAL0, float4 v3 : COLOR1, float2 v4 : TEXCOORD0, out float4 o0 : COLOR0, out float3 o1 : TEXCOORD0, out float4 o2 : TEXCOORD1, out float4 o3 : TEXCOORD2, out float3 o4 : TEXCOORD6, out float4 o5 : TEXCOORD7, out float4 o6 : TEXCOORD10, out float4 o7 : TEXCOORD8, out float2 o8 : TEXCOORD9, out float4 o9 : SV_Position0) { float4 r0,r1,r2; uint4 bitmask, uiDest; float4 fDest; o0.xyzw = v3.zyxw; r0.xyz = v1.xyz * float3(2.000000e+000,2.000000e+000,2.000000e+000) + float3(-1.000000e+000,-1.000000e+000,-1.000000e+000); r1.xyz = cb0[31].xyz * r0.yyy; r0.xyw = cb0[30].xyz * r0.xxx + r1.xyz; o1.xyz = cb0[32].xyz * r0.zzz + r0.xyw; r0.xyzw = v2.xyzw * float4(2.000000e+000,2.000000e+000,2.000000e+000,2.000000e+000) + float4(-1.000000e+000,-1.000000e+000,-1.000000e+000,-1.000000e+000); r1.xyz = cb0[31].xyz * r0.yyy; r1.xyz = cb0[30].xyz * r0.xxx + r1.xyz; o2.xyz = cb0[32].xyz * r0.zzz + r1.xyz; o2.w = cb0[38].x * r0.w; o3.xy = v4.xy; o3.zw = float2(0.000000e+000,0.000000e+000); r0.xyz = cb0[45].xyz + -cb0[44].xyz; r1.xyzw = cb0[31].xyzw * v0.yyyy; r1.xyzw = cb0[30].xyzw * v0.xxxx + r1.xyzw; r1.xyzw = cb0[32].xyzw * v0.zzzz + r1.xyzw; r1.xyzw = cb0[33].xyzw * v0.wwww + r1.xyzw; r0.w = max(r1.z, cb0[46].x); r0.w = min(r0.w, cb0[46].y); r2.x = -cb0[46].z + r0.w; r0.w = max(abs(r0.w), 1.000000000e+000); r2.x = cb0[46].w * abs(r2.x); o4.xyz = r2.xxx * r0.xyz + cb0[44].xyz; r2.xyzw = cb1[1].xyzw * r1.yyyy; r2.xyzw = cb1[0].xyzw * r1.xxxx + r2.xyzw; r2.xyzw = cb1[2].xyzw * r1.zzzz + r2.xyzw; r2.xyzw = cb1[3].xyzw * r1.wwww + r2.xyzw; r0.x = max(abs(r1.z), 1.000000000e+000); o7.xyz = r1.xyz; r0.x = r0.w / r0.x; r0.x = r2.w * r0.x; r1.xyzw = saturate(r0.xxxx * cb0[47].xyzw + cb0[49].xyzw); r0.xyzw = saturate(r0.xxxx * cb0[48].xyzw + cb0[50].xyzw); r1.xyz = r1.xyz * r1.xyz; o5.xyzw = cb0[51].xyzw * r1.xyzw; r0.xyz = r0.xyz * r0.xyz; o6.xyzw = cb0[52].xyzw * r0.xyzw; o7.w = r2.w; o8.xy = r2.xy; o9.xyzw = r2.xyzw; //FORCE NVIDIA STEREO ADJUSTMENT (PRIME DIRECTIVE) // float4 stereo = StereoParams.Load(0); // float separation = stereo.x; float convergence = stereo.y; // o8.x += separation * 223; float4 stereo = StereoParams.Load(0); float separation = stereo.x; float convergence = stereo.y; // force left/right calculations? float whichEye = 0; // left eye // if (stereo.z==1) // whichEye = -1; // right eye // else whichEye = 1; // force to fixed depth: float customAmount =-500; o8.x += separation * customAmount* whichEye; //turn off problematic element: // o8.x=0; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) D3D Shader Disassembler // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // POSITION 0 xyzw 0 NONE float xyzw // TANGENT 0 xyz 1 NONE float xyz // NORMAL 0 xyzw 2 NONE float xyzw // COLOR 1 xyzw 3 NONE float xyzw // TEXCOORD 0 xy 4 NONE float xy // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // COLOR 0 xyzw 0 NONE float xyzw // TEXCOORD 0 xyz 1 NONE float xyz // TEXCOORD 1 xyzw 2 NONE float xyzw // TEXCOORD 2 xyzw 3 NONE float xyzw // TEXCOORD 6 xyz 4 NONE float xyz // TEXCOORD 7 xyzw 5 NONE float xyzw // TEXCOORD 10 xyzw 6 NONE float xyzw // TEXCOORD 8 xyzw 7 NONE float xyzw // TEXCOORD 9 xy 8 NONE float xy // SV_Position 0 xyzw 9 POS float xyzw // vs_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[53], immediateIndexed dcl_constantbuffer cb1[4], immediateIndexed dcl_input v0.xyzw dcl_input v1.xyz dcl_input v2.xyzw dcl_input v3.xyzw dcl_input v4.xy dcl_output o0.xyzw dcl_output o1.xyz dcl_output o2.xyzw dcl_output o3.xyzw dcl_output o4.xyz dcl_output o5.xyzw dcl_output o6.xyzw dcl_output o7.xyzw dcl_output o8.xy dcl_output_siv o9.xyzw, position dcl_temps 3 mov o0.xyzw, v3.zyxw mad r0.xyz, v1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000) mul r1.xyz, r0.yyyy, cb0[31].xyzx mad r0.xyw, cb0[30].xyxz, r0.xxxx, r1.xyxz mad o1.xyz, cb0[32].xyzx, r0.zzzz, r0.xywx mad r0.xyzw, v2.xyzw, l(2.000000, 2.000000, 2.000000, 2.000000), l(-1.000000, -1.000000, -1.000000, -1.000000) mul r1.xyz, r0.yyyy, cb0[31].xyzx mad r1.xyz, cb0[30].xyzx, r0.xxxx, r1.xyzx mad o2.xyz, cb0[32].xyzx, r0.zzzz, r1.xyzx mul o2.w, r0.w, cb0[38].x mov o3.xy, v4.xyxx mov o3.zw, l(0,0,0,0) add r0.xyz, -cb0[44].xyzx, cb0[45].xyzx mul r1.xyzw, v0.yyyy, cb0[31].xyzw mad r1.xyzw, cb0[30].xyzw, v0.xxxx, r1.xyzw mad r1.xyzw, cb0[32].xyzw, v0.zzzz, r1.xyzw mad r1.xyzw, cb0[33].xyzw, v0.wwww, r1.xyzw max r0.w, r1.z, cb0[46].x min r0.w, r0.w, cb0[46].y add r2.x, r0.w, -cb0[46].z max r0.w, |r0.w|, l(1.000000) mul r2.x, |r2.x|, cb0[46].w mad o4.xyz, r2.xxxx, r0.xyzx, cb0[44].xyzx mul r2.xyzw, r1.yyyy, cb1[1].xyzw mad r2.xyzw, cb1[0].xyzw, r1.xxxx, r2.xyzw mad r2.xyzw, cb1[2].xyzw, r1.zzzz, r2.xyzw mad r2.xyzw, cb1[3].xyzw, r1.wwww, r2.xyzw max r0.x, |r1.z|, l(1.000000) mov o7.xyz, r1.xyzx div r0.x, r0.w, r0.x mul r0.x, r0.x, r2.w mad_sat r1.xyzw, r0.xxxx, cb0[47].xyzw, cb0[49].xyzw mad_sat r0.xyzw, r0.xxxx, cb0[48].xyzw, cb0[50].xyzw mul r1.xyz, r1.xyzx, r1.xyzx mul o5.xyzw, r1.xyzw, cb0[51].xyzw mul r0.xyz, r0.xyzx, r0.xyzx mul o6.xyzw, r0.xyzw, cb0[52].xyzw mov o7.w, r2.w mov o8.xy, r2.xyxx mov o9.xyzw, r2.xyzw ret // Approximately 0 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code]
My desktop internet is down so I can't access The Crew (online only). So I'm having a go at fixing this in 3dmigoto. Not having much success yet.

One of the problem areas is a godray-fog combo. They mostly look good but there's one element (an animated fog) that is at screen depth. It looks a bit shitty. Sorry no screenshot (writing this on my phone). Vs Shader below.

Looking at the vs reveals that the effect is comprised of multiple parts. The offending part is o8. Disabling it works, but stuffs up the rest of the god rays. It's as if the other elements use o8 as a sort of alpha channel or filter.

I've tried moving it, but doing so seems to move it left/right instead of in depth (I guess that means it's moving it the same direction for both eyes?

Could it have something to do with the pre-existing stereoParams in the code? How should I deal with that?

Also, when I move the fog left or right, it creates a halo image of the furniture in the room. Evidently, the fog is drawn over the top of everything, with a furniture - shaped hole cut into it so that it appears that the furniture is in front of the fog. Hope you get what I mean.

I tried placing the code further up to see if it could make the fog render without this hole, but I got out of my depth pretty quick.

Any suggestions on how to tackle this? Particularly, how to deal with the pre-existing stereoParams code?

The game has inbuilt 3d options, but they don't seem to do anything 3dvision doesn't already do, and it automatically turns on in the options when 3dvision is enabled. There are "depth" and "separation" sliders which work.


//godrays in opening room - part of the fog is at screendepth

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

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


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

void main(
float4 v0 : POSITION0,
float3 v1 : TANGENT0,
float4 v2 : NORMAL0,
float4 v3 : COLOR1,
float2 v4 : TEXCOORD0,
out float4 o0 : COLOR0,
out float3 o1 : TEXCOORD0,
out float4 o2 : TEXCOORD1,
out float4 o3 : TEXCOORD2,
out float3 o4 : TEXCOORD6,
out float4 o5 : TEXCOORD7,
out float4 o6 : TEXCOORD10,
out float4 o7 : TEXCOORD8,
out float2 o8 : TEXCOORD9,
out float4 o9 : SV_Position0)
{
float4 r0,r1,r2;
uint4 bitmask, uiDest;
float4 fDest;

o0.xyzw = v3.zyxw;
r0.xyz = v1.xyz * float3(2.000000e+000,2.000000e+000,2.000000e+000) + float3(-1.000000e+000,-1.000000e+000,-1.000000e+000);
r1.xyz = cb0[31].xyz * r0.yyy;
r0.xyw = cb0[30].xyz * r0.xxx + r1.xyz;
o1.xyz = cb0[32].xyz * r0.zzz + r0.xyw;
r0.xyzw = v2.xyzw * float4(2.000000e+000,2.000000e+000,2.000000e+000,2.000000e+000) + float4(-1.000000e+000,-1.000000e+000,-1.000000e+000,-1.000000e+000);
r1.xyz = cb0[31].xyz * r0.yyy;
r1.xyz = cb0[30].xyz * r0.xxx + r1.xyz;
o2.xyz = cb0[32].xyz * r0.zzz + r1.xyz;
o2.w = cb0[38].x * r0.w;
o3.xy = v4.xy;
o3.zw = float2(0.000000e+000,0.000000e+000);
r0.xyz = cb0[45].xyz + -cb0[44].xyz;
r1.xyzw = cb0[31].xyzw * v0.yyyy;
r1.xyzw = cb0[30].xyzw * v0.xxxx + r1.xyzw;
r1.xyzw = cb0[32].xyzw * v0.zzzz + r1.xyzw;
r1.xyzw = cb0[33].xyzw * v0.wwww + r1.xyzw;
r0.w = max(r1.z, cb0[46].x);
r0.w = min(r0.w, cb0[46].y);
r2.x = -cb0[46].z + r0.w;
r0.w = max(abs(r0.w), 1.000000000e+000);
r2.x = cb0[46].w * abs(r2.x);
o4.xyz = r2.xxx * r0.xyz + cb0[44].xyz;
r2.xyzw = cb1[1].xyzw * r1.yyyy;
r2.xyzw = cb1[0].xyzw * r1.xxxx + r2.xyzw;
r2.xyzw = cb1[2].xyzw * r1.zzzz + r2.xyzw;
r2.xyzw = cb1[3].xyzw * r1.wwww + r2.xyzw;
r0.x = max(abs(r1.z), 1.000000000e+000);
o7.xyz = r1.xyz;
r0.x = r0.w / r0.x;
r0.x = r2.w * r0.x;
r1.xyzw = saturate(r0.xxxx * cb0[47].xyzw + cb0[49].xyzw);
r0.xyzw = saturate(r0.xxxx * cb0[48].xyzw + cb0[50].xyzw);
r1.xyz = r1.xyz * r1.xyz;
o5.xyzw = cb0[51].xyzw * r1.xyzw;
r0.xyz = r0.xyz * r0.xyz;
o6.xyzw = cb0[52].xyzw * r0.xyzw;
o7.w = r2.w;
o8.xy = r2.xy;
o9.xyzw = r2.xyzw;




//FORCE NVIDIA STEREO ADJUSTMENT (PRIME DIRECTIVE)

// float4 stereo = StereoParams.Load(0);
// float separation = stereo.x; float convergence = stereo.y;
// o8.x += separation * 223;

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


// force left/right calculations?
float whichEye = 0;
// left eye
// if (stereo.z==1)
// whichEye = -1;
// right eye
// else
whichEye = 1;


// force to fixed depth:



float customAmount =-500;

o8.x += separation * customAmount* whichEye;



//turn off problematic element:
// o8.x=0;


return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 xyzw 0 NONE float xyzw
// TANGENT 0 xyz 1 NONE float xyz
// NORMAL 0 xyzw 2 NONE float xyzw
// COLOR 1 xyzw 3 NONE float xyzw
// TEXCOORD 0 xy 4 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xyz 1 NONE float xyz
// TEXCOORD 1 xyzw 2 NONE float xyzw
// TEXCOORD 2 xyzw 3 NONE float xyzw
// TEXCOORD 6 xyz 4 NONE float xyz
// TEXCOORD 7 xyzw 5 NONE float xyzw
// TEXCOORD 10 xyzw 6 NONE float xyzw
// TEXCOORD 8 xyzw 7 NONE float xyzw
// TEXCOORD 9 xy 8 NONE float xy
// SV_Position 0 xyzw 9 POS float xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[53], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_input v3.xyzw
dcl_input v4.xy
dcl_output o0.xyzw
dcl_output o1.xyz
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyz
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
dcl_output o8.xy
dcl_output_siv o9.xyzw, position
dcl_temps 3
mov o0.xyzw, v3.zyxw
mad r0.xyz, v1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mul r1.xyz, r0.yyyy, cb0[31].xyzx
mad r0.xyw, cb0[30].xyxz, r0.xxxx, r1.xyxz
mad o1.xyz, cb0[32].xyzx, r0.zzzz, r0.xywx
mad r0.xyzw, v2.xyzw, l(2.000000, 2.000000, 2.000000, 2.000000), l(-1.000000, -1.000000, -1.000000, -1.000000)
mul r1.xyz, r0.yyyy, cb0[31].xyzx
mad r1.xyz, cb0[30].xyzx, r0.xxxx, r1.xyzx
mad o2.xyz, cb0[32].xyzx, r0.zzzz, r1.xyzx
mul o2.w, r0.w, cb0[38].x
mov o3.xy, v4.xyxx
mov o3.zw, l(0,0,0,0)
add r0.xyz, -cb0[44].xyzx, cb0[45].xyzx
mul r1.xyzw, v0.yyyy, cb0[31].xyzw
mad r1.xyzw, cb0[30].xyzw, v0.xxxx, r1.xyzw
mad r1.xyzw, cb0[32].xyzw, v0.zzzz, r1.xyzw
mad r1.xyzw, cb0[33].xyzw, v0.wwww, r1.xyzw
max r0.w, r1.z, cb0[46].x
min r0.w, r0.w, cb0[46].y
add r2.x, r0.w, -cb0[46].z
max r0.w, |r0.w|, l(1.000000)
mul r2.x, |r2.x|, cb0[46].w
mad o4.xyz, r2.xxxx, r0.xyzx, cb0[44].xyzx
mul r2.xyzw, r1.yyyy, cb1[1].xyzw
mad r2.xyzw, cb1[0].xyzw, r1.xxxx, r2.xyzw
mad r2.xyzw, cb1[2].xyzw, r1.zzzz, r2.xyzw
mad r2.xyzw, cb1[3].xyzw, r1.wwww, r2.xyzw
max r0.x, |r1.z|, l(1.000000)
mov o7.xyz, r1.xyzx
div r0.x, r0.w, r0.x
mul r0.x, r0.x, r2.w
mad_sat r1.xyzw, r0.xxxx, cb0[47].xyzw, cb0[49].xyzw
mad_sat r0.xyzw, r0.xxxx, cb0[48].xyzw, cb0[50].xyzw
mul r1.xyz, r1.xyzx, r1.xyzx
mul o5.xyzw, r1.xyzw, cb0[51].xyzw
mul r0.xyz, r0.xyzx, r0.xyzx
mul o6.xyzw, r0.xyzw, cb0[52].xyzw
mov o7.w, r2.w
mov o8.xy, r2.xyxx
mov o9.xyzw, r2.xyzw
ret
// Approximately 0 instruction slots used

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

ImageVolnaPC.com - Tips, tweaks, performance comparisons (PhysX card, SLI scaling, etc)

Posted 03/24/2015 09:53 AM   
Hmm.. it seems the shader misses some of the header information... I bet cb0[] or cb1[] is the MVP matrix or maybe it's inverse ?!?! Now, I am not the best person for this;)) but! if you look closely: // This is the fog o8.xy = r2.xy; // this is the position. o9.xyzw = r2.xyzw; Now from what I understand the position is corrected (o9) and is in stereo while the fog (o8) is not ? It is a bit funny since both of them are using r2.xy components... So, again I might be wrong but I think you need to find the pixel shader that uses that TexCood o8 and see what is happening there and make the correction there. At least this is my idea at the moment from what I see ...
Hmm.. it seems the shader misses some of the header information... I bet cb0[] or cb1[] is the MVP matrix or maybe it's inverse ?!?!

Now, I am not the best person for this;)) but! if you look closely:

// This is the fog
o8.xy = r2.xy;
// this is the position.
o9.xyzw = r2.xyzw;

Now from what I understand the position is corrected (o9) and is in stereo while the fog (o8) is not ? It is a bit funny since both of them are using r2.xy components...

So, again I might be wrong but I think you need to find the pixel shader that uses that TexCood o8 and see what is happening there and make the correction there.

At least this is my idea at the moment from what I see ...

1x Palit RTX 2080Ti Pro Gaming OC(watercooled and overclocked to hell)
3x 3D Vision Ready Asus VG278HE monitors (5760x1080).
Intel i9 9900K (overclocked to 5.3 and watercooled ofc).
Asus Maximus XI Hero Mobo.
16 GB Team Group T-Force Dark Pro DDR4 @ 3600.
Lots of Disks:
- Raid 0 - 256GB Sandisk Extreme SSD.
- Raid 0 - WD Black - 2TB.
- SanDisk SSD PLUS 480 GB.
- Intel 760p 256GB M.2 PCIe NVMe SSD.
Creative Sound Blaster Z.
Windows 10 x64 Pro.
etc


My website with my fixes and OpenGL to 3D Vision wrapper:
http://3dsurroundgaming.com

(If you like some of the stuff that I've done and want to donate something, you can do it with PayPal at tavyhome@gmail.com)

Posted 03/24/2015 10:50 AM   
Yeah, unfortunately I'm seeing more and more games where they have stripped the headers out of the shaders, as a shipping optimization. Makes it harder for us for sure. Closer to assembly. I'm not sure I understand your comment about the stereoParams? The two lines for StereoParams and IniParms are injected by 3Dmigoto into every shader, and are there because otherwise the human would have to put in those lines to be able to fetch the stereo information. If they aren't used, they don't cause any effect to the shaders. For this one, it's pretty likely that you'll need to fix it in the Pixel Shader instead. Fog effects are pretty often using deferred rendering, and generate their own location in the Pixel Shader. Grab that one and post it, and we'll be able to tell.
Yeah, unfortunately I'm seeing more and more games where they have stripped the headers out of the shaders, as a shipping optimization. Makes it harder for us for sure. Closer to assembly.

I'm not sure I understand your comment about the stereoParams? The two lines for StereoParams and IniParms are injected by 3Dmigoto into every shader, and are there because otherwise the human would have to put in those lines to be able to fetch the stereo information. If they aren't used, they don't cause any effect to the shaders.


For this one, it's pretty likely that you'll need to fix it in the Pixel Shader instead. Fog effects are pretty often using deferred rendering, and generate their own location in the Pixel Shader. Grab that one and post it, and we'll be able to tell.

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 03/24/2015 01:18 PM   
ok, I had already tried various stabs in the dark on the PS shader, without success, which you can see in the commented out code: [code]//godrays in first room and fan room Texture2D<float4> t3 : register(t3); Texture2D<float4> t2 : register(t2); Texture2D<float4> t1 : register(t1); Texture2D<float4> t0 : register(t0); SamplerState s3_s : register(s3); SamplerState s2_s : register(s2); SamplerState s1_s : register(s1); SamplerState s0_s : register(s0); cbuffer cb2 : register(b2) { float4 cb2[3]; } cbuffer cb0 : register(b0) { float4 cb0[30]; } Texture2D<float4> StereoParams : register(t125); Texture1D<float4> IniParams : register(t120); void main( float4 v0 : COLOR0, float3 v1 : TEXCOORD0, float4 v2 : TEXCOORD1, float4 v3 : TEXCOORD2, float3 v4 : TEXCOORD6, float4 v5 : TEXCOORD7, float4 v6 : TEXCOORD10, float4 v7 : TEXCOORD8, float2 v8 : TEXCOORD9, uint v9 : SV_IsFrontFace0, out float4 o0 : SV_Target0) { float4 r0,r1,r2,r3; uint4 bitmask, uiDest; float4 fDest; //volnaiskra's edited code: // float4 stereo = StereoParams.Load(0); // float separation = stereo.x; float convergence = stereo.y; // v7.x += separation * (v7.w - convergence); r0.x = dot(v2.xyz, v2.xyz); r0.x = rsqrt(r0.x); r0.xyz = v2.xyz * r0.xxx; r0.w = v9.x ? 1.000000000e+000 : -1.000000000e+000; r0.xyz = r0.www * r0.xyz; r0.w = dot(v7.xyz, v7.xyz); r0.w = rsqrt(r0.w); r1.xyz = v7.xyz * r0.www; r0.x = saturate(dot(-r1.xyz, r0.xyz)); r0.y = log2(r0.x); r0.x = r0.x < 9.999999975e-007; r0.y = cb0[29].z * r0.y; r0.y = exp2(r0.y); r0.zw = -cb0[28].xw + v7.ww; r1.xy = cb0[28].yz + -cb0[28].xw; r0.zw = saturate(r0.zw / r1.xy); r0.z = r0.z * r0.w; r0.w = v3.x * 2.000000000e+000 + -1.000000000e+000; r0.w = r0.w / v3.y; r0.w = 1.000000000e+000 + -abs(r0.w); r0.w = max(r0.w, 0.000000000e+000); r0.w = 1.250000000e+000 * r0.w; r0.w = min(r0.w, 1.000000000e+000); r0.zw = r0.zw * r0.zw; r1.xy = v3.xy * float2(2.000000e+000,1.000000e+000) + float2(-1.000000e+000,0.000000e+000); r1.x = dot(r1.xy, r1.xy); r1.x = 1.000000000e+000 + -r1.x; r1.x = max(r1.x, 0.000000000e+000); r1.x = r1.x * r1.x; r0.w = r1.x * r0.w; r1.x = 1.000000000e+000 + -cb2[2].y; //volnaiskra's edited code: // v7.x += separation * (v7.w - convergence); // float4 stereo = StereoParams.Load(0); // float separation = stereo.x; float convergence = stereo.y; // v8+=50; // v8.xy=133; // v8=separation* convergence; // v8=separation* convergence; // r2.xy = v0.xy / v7.ww; r2.xy = v8.xy / v7.ww; r1.yz = r2.xy * cb2[0].xy + cb2[0].wz; r1.w = t1.Sample(s0_s, r1.yz).x; r1.w = saturate(-cb0[8].w + r1.w); r1.x = r1.w + -r1.x; r1.x = min(r1.x, -9.999999960e-013); r1.x = -cb2[2].x / r1.x; r1.x = -v7.w + r1.x; r1.x = saturate(r1.x / cb0[27].x); r0.w = r1.x * r0.w; r0.z = r0.w * r0.z; r0.y = r0.y * r0.z; r0.x = r0.x ? 0.000000000e+000 : r0.y; r2.z = -r2.y; r2.w = 1.000000000e+000; r3.x = dot(cb0[9].xyzw, r2.xzww); r3.y = dot(cb0[10].xyzw, r2.xzww); r2.y = cb0[29].y * cb0[29].x; r2.x = cb0[29].x; r0.yz = r2.xy * float2(0.000000e+000,1.000000e-001) + r3.xy; r0.yzw = t0.Sample(s1_s, r0.yz).xyz; r2.xyz = cb0[26].www * cb0[26].xyz; r0.yzw = r2.xyz * r0.yzw; r0.xyz = r0.yzw * r0.xxx + cb0[25].xyz; r2.xyz = t2.Sample(s2_s, r1.yz).xyz; r1.xyzw = t3.Sample(s3_s, r1.yz).xyzw; r0.w = dot(v6.xyzw, r1.xyzw); r1.x = dot(v5.xyz, r2.xyz); r0.w = r1.x + r0.w; r1.x = 1.000000000e+000 + r0.w; r0.w = r0.w / r1.x; r0.w = 1.000000000e+000 + -r0.w; r0.xyz = r0.xyz * r0.www; r1.xyz = cb0[6].xyz + v7.xyz; r1.xyz = cb0[7].xyz + -r1.xyz; r0.w = dot(r1.xyz, r1.xyz); r1.x = -1.000000000e+002 + cb0[27].y; r1.x = max(r1.x, 0.000000000e+000); r0.w = -r1.x * r1.x + r0.w; r1.x = r1.x * r1.x; r1.x = cb0[27].y * cb0[27].y + -r1.x; r1.x = 1.000000e+000 / r1.x; r0.w = saturate(r1.x * r0.w); r1.x = r0.w * -2.000000000e+000 + 3.000000000e+000; r0.w = r0.w * r0.w; r0.w = r1.x * r0.w; o0.xyz = r0.xyz * r0.www; o0.w = 0.000000000e+000; // o0=0; // r2.xyz=220; // v7=0; // float4 stereo = StereoParams.Load(0); // float separation = stereo.x; float convergence = stereo.y; // o0.x += separation * (o0.w - convergence); // r0=0; // o0.xyz=-1; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) D3D Shader Disassembler // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // COLOR 0 xyzw 0 NONE float // TEXCOORD 0 xyz 1 NONE float // TEXCOORD 1 xyzw 2 NONE float xyz // TEXCOORD 2 xyzw 3 NONE float xy // TEXCOORD 6 xyz 4 NONE float // TEXCOORD 7 xyzw 5 NONE float xyz // TEXCOORD 10 xyzw 6 NONE float xyzw // TEXCOORD 8 xyzw 7 NONE float xyzw // TEXCOORD 9 xy 8 NONE float xy // SV_IsFrontFace 0 x 9 FFACE uint x // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Target 0 xyzw 0 TARGET float xyzw // ps_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[30], immediateIndexed dcl_constantbuffer cb2[3], immediateIndexed dcl_sampler s0, mode_default dcl_sampler s1, mode_default dcl_sampler s2, mode_default dcl_sampler s3, 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_input_ps linear v2.xyz dcl_input_ps linear v3.xy dcl_input_ps linear v5.xyz dcl_input_ps linear v6.xyzw dcl_input_ps linear v7.xyzw dcl_input_ps linear v8.xy dcl_input_ps_sgv v9.x, is_front_face dcl_output o0.xyzw dcl_temps 4 dp3 r0.x, v2.xyzx, v2.xyzx rsq r0.x, r0.x mul r0.xyz, r0.xxxx, v2.xyzx movc r0.w, v9.x, l(1.000000), l(-1.000000) mul r0.xyz, r0.xyzx, r0.wwww dp3 r0.w, v7.xyzx, v7.xyzx rsq r0.w, r0.w mul r1.xyz, r0.wwww, v7.xyzx dp3_sat r0.x, -r1.xyzx, r0.xyzx log r0.y, r0.x lt r0.x, r0.x, l(0.000001) mul r0.y, r0.y, cb0[29].z exp r0.y, r0.y add r0.zw, v7.wwww, -cb0[28].xxxw add r1.xy, -cb0[28].xwxx, cb0[28].yzyy div_sat r0.zw, r0.zzzw, r1.xxxy mul r0.z, r0.w, r0.z mad r0.w, v3.x, l(2.000000), l(-1.000000) div r0.w, r0.w, v3.y add r0.w, -|r0.w|, l(1.000000) max r0.w, r0.w, l(0.000000) mul r0.w, r0.w, l(1.250000) min r0.w, r0.w, l(1.000000) mul r0.zw, r0.zzzw, r0.zzzw mad r1.xy, v3.xyxx, l(2.000000, 1.000000, 0.000000, 0.000000), l(-1.000000, 0.000000, 0.000000, 0.000000) dp2 r1.x, r1.xyxx, r1.xyxx add r1.x, -r1.x, l(1.000000) max r1.x, r1.x, l(0.000000) mul r1.x, r1.x, r1.x mul r0.w, r0.w, r1.x add r1.x, -cb2[2].y, l(1.000000) div r2.xy, v8.xyxx, v7.wwww mad r1.yz, r2.xxyx, cb2[0].xxyx, cb2[0].wwzw sample_indexable(texture2d)(float,float,float,float) r1.w, r1.yzyy, t1.yzwx, s0 add_sat r1.w, r1.w, -cb0[8].w add r1.x, -r1.x, r1.w min r1.x, r1.x, l(-0.000000) div r1.x, -cb2[2].x, r1.x add r1.x, r1.x, -v7.w div_sat r1.x, r1.x, cb0[27].x mul r0.w, r0.w, r1.x mul r0.z, r0.z, r0.w mul r0.y, r0.z, r0.y movc r0.x, r0.x, l(0), r0.y mov r2.z, -r2.y mov r2.w, l(1.000000) dp4 r3.x, cb0[9].xyzw, r2.xzww dp4 r3.y, cb0[10].xyzw, r2.xzww mul r2.y, cb0[29].x, cb0[29].y mov r2.x, cb0[29].x mad r0.yz, r2.xxyx, l(0.000000, 0.000000, 0.100000, 0.000000), r3.xxyx sample_indexable(texture2d)(float,float,float,float) r0.yzw, r0.yzyy, t0.wxyz, s1 mul r2.xyz, cb0[26].xyzx, cb0[26].wwww mul r0.yzw, r0.yyzw, r2.xxyz mad r0.xyz, r0.yzwy, r0.xxxx, cb0[25].xyzx sample_indexable(texture2d)(float,float,float,float) r2.xyz, r1.yzyy, t2.xyzw, s2 sample_indexable(texture2d)(float,float,float,float) r1.xyzw, r1.yzyy, t3.xyzw, s3 dp4 r0.w, v6.xyzw, r1.xyzw dp3 r1.x, v5.xyzx, r2.xyzx add r0.w, r0.w, r1.x add r1.x, r0.w, l(1.000000) div r0.w, r0.w, r1.x add r0.w, -r0.w, l(1.000000) mul r0.xyz, r0.wwww, r0.xyzx add r1.xyz, v7.xyzx, cb0[6].xyzx add r1.xyz, -r1.xyzx, cb0[7].xyzx dp3 r0.w, r1.xyzx, r1.xyzx add r1.x, cb0[27].y, l(-100.000000) max r1.x, r1.x, l(0.000000) mad r0.w, -r1.x, r1.x, r0.w mul r1.x, r1.x, r1.x mad r1.x, cb0[27].y, cb0[27].y, -r1.x div r1.x, l(1.000000, 1.000000, 1.000000, 1.000000), r1.x mul_sat r0.w, r0.w, r1.x mad r1.x, r0.w, l(-2.000000), l(3.000000) mul r0.w, r0.w, r0.w mul r0.w, r0.w, r1.x mul o0.xyz, r0.wwww, r0.xyzx mov o0.w, l(0) ret // Approximately 0 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code]
ok, I had already tried various stabs in the dark on the PS shader, without success, which you can see in the commented out code:

//godrays in first room and fan room

Texture2D<float4> t3 : register(t3);

Texture2D<float4> t2 : register(t2);

Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s3_s : register(s3);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

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

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


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

void main(
float4 v0 : COLOR0,
float3 v1 : TEXCOORD0,
float4 v2 : TEXCOORD1,
float4 v3 : TEXCOORD2,
float3 v4 : TEXCOORD6,
float4 v5 : TEXCOORD7,
float4 v6 : TEXCOORD10,
float4 v7 : TEXCOORD8,
float2 v8 : TEXCOORD9,
uint v9 : SV_IsFrontFace0,
out float4 o0 : SV_Target0)
{
float4 r0,r1,r2,r3;
uint4 bitmask, uiDest;
float4 fDest;


//volnaiskra's edited code:
// float4 stereo = StereoParams.Load(0);
// float separation = stereo.x; float convergence = stereo.y;
// v7.x += separation * (v7.w - convergence);


r0.x = dot(v2.xyz, v2.xyz);
r0.x = rsqrt(r0.x);
r0.xyz = v2.xyz * r0.xxx;
r0.w = v9.x ? 1.000000000e+000 : -1.000000000e+000;
r0.xyz = r0.www * r0.xyz;
r0.w = dot(v7.xyz, v7.xyz);
r0.w = rsqrt(r0.w);
r1.xyz = v7.xyz * r0.www;
r0.x = saturate(dot(-r1.xyz, r0.xyz));
r0.y = log2(r0.x);
r0.x = r0.x < 9.999999975e-007;
r0.y = cb0[29].z * r0.y;
r0.y = exp2(r0.y);
r0.zw = -cb0[28].xw + v7.ww;
r1.xy = cb0[28].yz + -cb0[28].xw;
r0.zw = saturate(r0.zw / r1.xy);
r0.z = r0.z * r0.w;
r0.w = v3.x * 2.000000000e+000 + -1.000000000e+000;
r0.w = r0.w / v3.y;
r0.w = 1.000000000e+000 + -abs(r0.w);
r0.w = max(r0.w, 0.000000000e+000);
r0.w = 1.250000000e+000 * r0.w;
r0.w = min(r0.w, 1.000000000e+000);
r0.zw = r0.zw * r0.zw;
r1.xy = v3.xy * float2(2.000000e+000,1.000000e+000) + float2(-1.000000e+000,0.000000e+000);
r1.x = dot(r1.xy, r1.xy);
r1.x = 1.000000000e+000 + -r1.x;
r1.x = max(r1.x, 0.000000000e+000);
r1.x = r1.x * r1.x;
r0.w = r1.x * r0.w;
r1.x = 1.000000000e+000 + -cb2[2].y;





//volnaiskra's edited code:
// v7.x += separation * (v7.w - convergence);
// float4 stereo = StereoParams.Load(0);
// float separation = stereo.x; float convergence = stereo.y;
// v8+=50;
// v8.xy=133;
// v8=separation* convergence;
// v8=separation* convergence;
// r2.xy = v0.xy / v7.ww;



r2.xy = v8.xy / v7.ww;

r1.yz = r2.xy * cb2[0].xy + cb2[0].wz;
r1.w = t1.Sample(s0_s, r1.yz).x;
r1.w = saturate(-cb0[8].w + r1.w);
r1.x = r1.w + -r1.x;
r1.x = min(r1.x, -9.999999960e-013);
r1.x = -cb2[2].x / r1.x;
r1.x = -v7.w + r1.x;
r1.x = saturate(r1.x / cb0[27].x);
r0.w = r1.x * r0.w;
r0.z = r0.w * r0.z;
r0.y = r0.y * r0.z;
r0.x = r0.x ? 0.000000000e+000 : r0.y;
r2.z = -r2.y;
r2.w = 1.000000000e+000;
r3.x = dot(cb0[9].xyzw, r2.xzww);
r3.y = dot(cb0[10].xyzw, r2.xzww);
r2.y = cb0[29].y * cb0[29].x;
r2.x = cb0[29].x;
r0.yz = r2.xy * float2(0.000000e+000,1.000000e-001) + r3.xy;
r0.yzw = t0.Sample(s1_s, r0.yz).xyz;
r2.xyz = cb0[26].www * cb0[26].xyz;
r0.yzw = r2.xyz * r0.yzw;
r0.xyz = r0.yzw * r0.xxx + cb0[25].xyz;
r2.xyz = t2.Sample(s2_s, r1.yz).xyz;
r1.xyzw = t3.Sample(s3_s, r1.yz).xyzw;
r0.w = dot(v6.xyzw, r1.xyzw);
r1.x = dot(v5.xyz, r2.xyz);
r0.w = r1.x + r0.w;
r1.x = 1.000000000e+000 + r0.w;
r0.w = r0.w / r1.x;
r0.w = 1.000000000e+000 + -r0.w;
r0.xyz = r0.xyz * r0.www;
r1.xyz = cb0[6].xyz + v7.xyz;
r1.xyz = cb0[7].xyz + -r1.xyz;
r0.w = dot(r1.xyz, r1.xyz);
r1.x = -1.000000000e+002 + cb0[27].y;
r1.x = max(r1.x, 0.000000000e+000);
r0.w = -r1.x * r1.x + r0.w;
r1.x = r1.x * r1.x;
r1.x = cb0[27].y * cb0[27].y + -r1.x;
r1.x = 1.000000e+000 / r1.x;
r0.w = saturate(r1.x * r0.w);
r1.x = r0.w * -2.000000000e+000 + 3.000000000e+000;
r0.w = r0.w * r0.w;
r0.w = r1.x * r0.w;
o0.xyz = r0.xyz * r0.www;
o0.w = 0.000000000e+000;

// o0=0;
// r2.xyz=220;
// v7=0;
// float4 stereo = StereoParams.Load(0);
// float separation = stereo.x; float convergence = stereo.y;
// o0.x += separation * (o0.w - convergence);
// r0=0;
// o0.xyz=-1;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float
// TEXCOORD 0 xyz 1 NONE float
// TEXCOORD 1 xyzw 2 NONE float xyz
// TEXCOORD 2 xyzw 3 NONE float xy
// TEXCOORD 6 xyz 4 NONE float
// TEXCOORD 7 xyzw 5 NONE float xyz
// TEXCOORD 10 xyzw 6 NONE float xyzw
// TEXCOORD 8 xyzw 7 NONE float xyzw
// TEXCOORD 9 xy 8 NONE float xy
// SV_IsFrontFace 0 x 9 FFACE uint x
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[30], immediateIndexed
dcl_constantbuffer cb2[3], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, 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_input_ps linear v2.xyz
dcl_input_ps linear v3.xy
dcl_input_ps linear v5.xyz
dcl_input_ps linear v6.xyzw
dcl_input_ps linear v7.xyzw
dcl_input_ps linear v8.xy
dcl_input_ps_sgv v9.x, is_front_face
dcl_output o0.xyzw
dcl_temps 4
dp3 r0.x, v2.xyzx, v2.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, v2.xyzx
movc r0.w, v9.x, l(1.000000), l(-1.000000)
mul r0.xyz, r0.xyzx, r0.wwww
dp3 r0.w, v7.xyzx, v7.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, v7.xyzx
dp3_sat r0.x, -r1.xyzx, r0.xyzx
log r0.y, r0.x
lt r0.x, r0.x, l(0.000001)
mul r0.y, r0.y, cb0[29].z
exp r0.y, r0.y
add r0.zw, v7.wwww, -cb0[28].xxxw
add r1.xy, -cb0[28].xwxx, cb0[28].yzyy
div_sat r0.zw, r0.zzzw, r1.xxxy
mul r0.z, r0.w, r0.z
mad r0.w, v3.x, l(2.000000), l(-1.000000)
div r0.w, r0.w, v3.y
add r0.w, -|r0.w|, l(1.000000)
max r0.w, r0.w, l(0.000000)
mul r0.w, r0.w, l(1.250000)
min r0.w, r0.w, l(1.000000)
mul r0.zw, r0.zzzw, r0.zzzw
mad r1.xy, v3.xyxx, l(2.000000, 1.000000, 0.000000, 0.000000), l(-1.000000, 0.000000, 0.000000, 0.000000)
dp2 r1.x, r1.xyxx, r1.xyxx
add r1.x, -r1.x, l(1.000000)
max r1.x, r1.x, l(0.000000)
mul r1.x, r1.x, r1.x
mul r0.w, r0.w, r1.x
add r1.x, -cb2[2].y, l(1.000000)
div r2.xy, v8.xyxx, v7.wwww
mad r1.yz, r2.xxyx, cb2[0].xxyx, cb2[0].wwzw
sample_indexable(texture2d)(float,float,float,float) r1.w, r1.yzyy, t1.yzwx, s0
add_sat r1.w, r1.w, -cb0[8].w
add r1.x, -r1.x, r1.w
min r1.x, r1.x, l(-0.000000)
div r1.x, -cb2[2].x, r1.x
add r1.x, r1.x, -v7.w
div_sat r1.x, r1.x, cb0[27].x
mul r0.w, r0.w, r1.x
mul r0.z, r0.z, r0.w
mul r0.y, r0.z, r0.y
movc r0.x, r0.x, l(0), r0.y
mov r2.z, -r2.y
mov r2.w, l(1.000000)
dp4 r3.x, cb0[9].xyzw, r2.xzww
dp4 r3.y, cb0[10].xyzw, r2.xzww
mul r2.y, cb0[29].x, cb0[29].y
mov r2.x, cb0[29].x
mad r0.yz, r2.xxyx, l(0.000000, 0.000000, 0.100000, 0.000000), r3.xxyx
sample_indexable(texture2d)(float,float,float,float) r0.yzw, r0.yzyy, t0.wxyz, s1
mul r2.xyz, cb0[26].xyzx, cb0[26].wwww
mul r0.yzw, r0.yyzw, r2.xxyz
mad r0.xyz, r0.yzwy, r0.xxxx, cb0[25].xyzx
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r1.yzyy, t2.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, r1.yzyy, t3.xyzw, s3
dp4 r0.w, v6.xyzw, r1.xyzw
dp3 r1.x, v5.xyzx, r2.xyzx
add r0.w, r0.w, r1.x
add r1.x, r0.w, l(1.000000)
div r0.w, r0.w, r1.x
add r0.w, -r0.w, l(1.000000)
mul r0.xyz, r0.wwww, r0.xyzx
add r1.xyz, v7.xyzx, cb0[6].xyzx
add r1.xyz, -r1.xyzx, cb0[7].xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
add r1.x, cb0[27].y, l(-100.000000)
max r1.x, r1.x, l(0.000000)
mad r0.w, -r1.x, r1.x, r0.w
mul r1.x, r1.x, r1.x
mad r1.x, cb0[27].y, cb0[27].y, -r1.x
div r1.x, l(1.000000, 1.000000, 1.000000, 1.000000), r1.x
mul_sat r0.w, r0.w, r1.x
mad r1.x, r0.w, l(-2.000000), l(3.000000)
mul r0.w, r0.w, r0.w
mul r0.w, r0.w, r1.x
mul o0.xyz, r0.wwww, r0.xyzx
mov o0.w, l(0)
ret
// Approximately 0 instruction slots used

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

ImageVolnaPC.com - Tips, tweaks, performance comparisons (PhysX card, SLI scaling, etc)

Posted 03/29/2015 12:40 AM   
[quote="Volnaiskra"]Looking at the vs reveals that the effect is comprised of multiple parts. The offending part is o8. Disabling it works, but stuffs up the rest of the god rays. It's as if the other elements use o8 as a sort of alpha channel or filter.[/quote]In my experience it's also pretty common for god rays to be rendered in several stages and as such there may be more shaders to find. ShaderUsage.txt is the place to look to try to determine if there are any other related shaders - look for a render target of one shader being used as a register to another to try to determine the relationships. Compare by handle as it will tell you if it is the same render target, while the hash just means it has the same properties. [quote]I've tried moving it, but doing so seems to move it left/right instead of in depth (I guess that means it's moving it the same direction for both eyes?[/quote]Could be that you are adjusting it in the wrong shader and need to find a later one that copies it to the screen. Another possibility is that an intermediate render target is mono and needs to be forced to stereo with a TextureOverride section (the only time I've come across this for light shafts was in Dreamfall - and those are not fixable for various reasons). [quote]Also, when I move the fog left or right, it creates a halo image of the furniture in the room. Evidently, the fog is drawn over the top of everything, with a furniture - shaped hole cut into it so that it appears that the furniture is in front of the fog. Hope you get what I mean.[/quote]Somewhere it will be checking the depth buffer at the old coordinates and this will need to be adjusted. It might be another texcoord, or it could be in a different shader. [quote]The game has inbuilt 3d options, but they don't seem to do anything 3dvision doesn't already do, and it automatically turns on in the options when 3dvision is enabled. There are "depth" and "separation" sliders which work.[/quote]It's been a while since I played it but I got the impression that they supported 3D Vision properly - doing much the same things we do to fix games, but having the advantage that they had access to the source code. I can't recall what the god rays looked like, but I assume they gave up on it as being too hard, which doesn't bode well for fixing them -- especially without the shader headers to provide clues. I think my biggest complaint about the game was the lack of depth even at 100% Here's a few different patterns of god rays I've fixed to give you an idea of some of the possibilities, but there's a lot of variations and these can range from moderate (Unreal Engine, Unity) to difficult (Miasmata, Far Cry 4) to impossible (Dreamfall), and I'm sure there are other patterns I have not seen yet: 1. Unreal Engine light shafts. These blur the shafts radially outwards from a central point passed to the shader via a constant which needs to be adjusted. Only a single shader is responsible for the shafts, though there are several additional shaders following the same pattern that are responsible for related layers (such as the glow around the sun). I've added this pattern to shadertool.py to automatically fix these: https://github.com/DarkStarSword/3d-fixes/commit/f4e6474aecf3b0ac1aa2f9b5bff662e5354894bc 2. Unity light shafts. These follow a similar pattern to Unreal Engine where a constant is passed into the shader that needs to be adjusted: https://github.com/DarkStarSword/3d-fixes/commit/54831b2f00a9912daa514ac6df384376eecc1f97 2.A. Stranded Deep. This is a Unity game that uses custom shaders for light shafts & underwater crepuscular rays. The pattern was similar, but required several adjustments in different places to make everything work together: https://github.com/DarkStarSword/3d-fixes/commit/cc28cae2f858b9fa9354a4b939e2e7fbe7343da9 https://github.com/DarkStarSword/3d-fixes/commit/af2cab4eab0d4f4aba9698d43c45b6994c612d55 https://github.com/DarkStarSword/3d-fixes/commit/51ce259b0dadf1a1f410b2857b440c1ea9107615 3. Far Cry 4 Regular God Rays. This was a difficult effect to fix - if memory serves these rays are generated in four pairs of shaders, of which only the pixel shaders were of interest. Early on I tried adjusting the first and fourth pixel shaders and was able to reposition them so they came from the correct position, but they did not occlude correctly. I later determined (by purposefully breaking the effect at various points) that the correct place to fix them was in the second and third pixel shaders which were responsible for propagating the rays towards the camera. The fourth and final pixel shader copied the completed ray to the screen. ShaderUsage.txt was instrumental to understanding the relationships between the four shaders, then experimentation to determine what exactly each shader was doing: https://github.com/bo3b/3Dmigoto/commit/007e1a26eb68f12dbc5e7c1f3ad3b887160361bb 4. Far Cry 4 Enhanced God Rays. This was actually an easier effect to fix (this may not be 100% accurate, but it was close enough). Unlike the regular god rays these are indirect, so they will appear even while not looking at the sun and it is possible to see them strike the ground, correctly lining up with the shadows. This effect used three pairs of shaders - I adjusted the position in the third vertex shader, but doing so created a halo in the fog, which could only be resolved by performing another adjustment in the first vertex shader (which used pixels rather than percentages, so the fix had to be scaled by the render target width): https://github.com/bo3b/3Dmigoto/commit/c713fad554177eca9d90c3f2840e0c05f326caa1 https://github.com/bo3b/3Dmigoto/commit/38cdd1e532626753495b39df7258c4fa570097b9 5. Miasmata. This is probably the hardest that I've successfully fixed. Like the enhanced god rays in Far Cry 4 this is indirect and the shafts can be traced from the sun to where they strike the ground. If memory serves I think this game used six pairs of shaders for the light shafts. The main adjustment was in the final vertex shader that copied the shafts from their intermediate radial coordinate system onto the screen. All the previous examples were adjusted in projection space, but this one used world-space coordinates, but did not provide the necessary matrices to allow a correction in world-space. All I had was the world-view-projection matrix copied from an unrelated effect (the water), but I was able to use it to translate two coordinates and use the difference between them to determine which way the camera was oriented and apply the adjustment in that direction: https://github.com/DarkStarSword/3d-fixes/commit/8c8f51d2e0b8e583b09c3fe12d64ebbf1c9fa7e5 But that wasn't the end of it - that adjustment broke the fog on the edge of the screen, which looked very jarring and eye-bleeding. Eventually I came up with a solution to hide it by using the original uncorrected light shafts at the edge of the screen, and interpolating between the corrected and uncorrected versions to hide the fact that I was hiding the broken fog: https://github.com/DarkStarSword/3d-fixes/commit/94a0cf6024f7a01435de590fc9c5b9917dc298fe https://github.com/DarkStarSword/3d-fixes/commit/d4a11aeae8bd69e04fa489f5acad80565e765f37 6. Dreamfall Chapters. After spending several weekends on this I gave up. I am convinced that fixing these properly would need changes to the C# code (which is open source - if it's possible to replace the version in the game with a modified one this might be fixable yet). Unlike all the above games these shafts do not come from the sun, rather they are a volumetric ray-marched light shaft cast from another source (such as a window) using epipolar geometry to map them from the camera into the light shaft coordinate system. The biggest obstacle is that the shaders do not have access to the three dimensional coordinates of the light - they only have the XY screen coordinates and lack the necessary depth information to perform the adjustment (and this is where a one line change to the C# might make these fixable - that damn line that throws away the W component when it sets the shader variable!), and no approximation is good enough for all of these :(
Volnaiskra said:Looking at the vs reveals that the effect is comprised of multiple parts. The offending part is o8. Disabling it works, but stuffs up the rest of the god rays. It's as if the other elements use o8 as a sort of alpha channel or filter.
In my experience it's also pretty common for god rays to be rendered in several stages and as such there may be more shaders to find. ShaderUsage.txt is the place to look to try to determine if there are any other related shaders - look for a render target of one shader being used as a register to another to try to determine the relationships. Compare by handle as it will tell you if it is the same render target, while the hash just means it has the same properties.

I've tried moving it, but doing so seems to move it left/right instead of in depth (I guess that means it's moving it the same direction for both eyes?
Could be that you are adjusting it in the wrong shader and need to find a later one that copies it to the screen. Another possibility is that an intermediate render target is mono and needs to be forced to stereo with a TextureOverride section (the only time I've come across this for light shafts was in Dreamfall - and those are not fixable for various reasons).

Also, when I move the fog left or right, it creates a halo image of the furniture in the room. Evidently, the fog is drawn over the top of everything, with a furniture - shaped hole cut into it so that it appears that the furniture is in front of the fog. Hope you get what I mean.
Somewhere it will be checking the depth buffer at the old coordinates and this will need to be adjusted. It might be another texcoord, or it could be in a different shader.

The game has inbuilt 3d options, but they don't seem to do anything 3dvision doesn't already do, and it automatically turns on in the options when 3dvision is enabled. There are "depth" and "separation" sliders which work.
It's been a while since I played it but I got the impression that they supported 3D Vision properly - doing much the same things we do to fix games, but having the advantage that they had access to the source code. I can't recall what the god rays looked like, but I assume they gave up on it as being too hard, which doesn't bode well for fixing them -- especially without the shader headers to provide clues. I think my biggest complaint about the game was the lack of depth even at 100%


Here's a few different patterns of god rays I've fixed to give you an idea of some of the possibilities, but there's a lot of variations and these can range from moderate (Unreal Engine, Unity) to difficult (Miasmata, Far Cry 4) to impossible (Dreamfall), and I'm sure there are other patterns I have not seen yet:

1. Unreal Engine light shafts. These blur the shafts radially outwards from a central point passed to the shader via a constant which needs to be adjusted. Only a single shader is responsible for the shafts, though there are several additional shaders following the same pattern that are responsible for related layers (such as the glow around the sun). I've added this pattern to shadertool.py to automatically fix these:
https://github.com/DarkStarSword/3d-fixes/commit/f4e6474aecf3b0ac1aa2f9b5bff662e5354894bc

2. Unity light shafts. These follow a similar pattern to Unreal Engine where a constant is passed into the shader that needs to be adjusted:
https://github.com/DarkStarSword/3d-fixes/commit/54831b2f00a9912daa514ac6df384376eecc1f97

2.A. Stranded Deep. This is a Unity game that uses custom shaders for light shafts & underwater crepuscular rays. The pattern was similar, but required several adjustments in different places to make everything work together:
https://github.com/DarkStarSword/3d-fixes/commit/cc28cae2f858b9fa9354a4b939e2e7fbe7343da9
https://github.com/DarkStarSword/3d-fixes/commit/af2cab4eab0d4f4aba9698d43c45b6994c612d55
https://github.com/DarkStarSword/3d-fixes/commit/51ce259b0dadf1a1f410b2857b440c1ea9107615

3. Far Cry 4 Regular God Rays. This was a difficult effect to fix - if memory serves these rays are generated in four pairs of shaders, of which only the pixel shaders were of interest. Early on I tried adjusting the first and fourth pixel shaders and was able to reposition them so they came from the correct position, but they did not occlude correctly. I later determined (by purposefully breaking the effect at various points) that the correct place to fix them was in the second and third pixel shaders which were responsible for propagating the rays towards the camera. The fourth and final pixel shader copied the completed ray to the screen. ShaderUsage.txt was instrumental to understanding the relationships between the four shaders, then experimentation to determine what exactly each shader was doing:
https://github.com/bo3b/3Dmigoto/commit/007e1a26eb68f12dbc5e7c1f3ad3b887160361bb

4. Far Cry 4 Enhanced God Rays. This was actually an easier effect to fix (this may not be 100% accurate, but it was close enough). Unlike the regular god rays these are indirect, so they will appear even while not looking at the sun and it is possible to see them strike the ground, correctly lining up with the shadows. This effect used three pairs of shaders - I adjusted the position in the third vertex shader, but doing so created a halo in the fog, which could only be resolved by performing another adjustment in the first vertex shader (which used pixels rather than percentages, so the fix had to be scaled by the render target width):
https://github.com/bo3b/3Dmigoto/commit/c713fad554177eca9d90c3f2840e0c05f326caa1
https://github.com/bo3b/3Dmigoto/commit/38cdd1e532626753495b39df7258c4fa570097b9

5. Miasmata. This is probably the hardest that I've successfully fixed. Like the enhanced god rays in Far Cry 4 this is indirect and the shafts can be traced from the sun to where they strike the ground. If memory serves I think this game used six pairs of shaders for the light shafts. The main adjustment was in the final vertex shader that copied the shafts from their intermediate radial coordinate system onto the screen. All the previous examples were adjusted in projection space, but this one used world-space coordinates, but did not provide the necessary matrices to allow a correction in world-space. All I had was the world-view-projection matrix copied from an unrelated effect (the water), but I was able to use it to translate two coordinates and use the difference between them to determine which way the camera was oriented and apply the adjustment in that direction:
https://github.com/DarkStarSword/3d-fixes/commit/8c8f51d2e0b8e583b09c3fe12d64ebbf1c9fa7e5

But that wasn't the end of it - that adjustment broke the fog on the edge of the screen, which looked very jarring and eye-bleeding. Eventually I came up with a solution to hide it by using the original uncorrected light shafts at the edge of the screen, and interpolating between the corrected and uncorrected versions to hide the fact that I was hiding the broken fog:
https://github.com/DarkStarSword/3d-fixes/commit/94a0cf6024f7a01435de590fc9c5b9917dc298fe
https://github.com/DarkStarSword/3d-fixes/commit/d4a11aeae8bd69e04fa489f5acad80565e765f37

6. Dreamfall Chapters. After spending several weekends on this I gave up. I am convinced that fixing these properly would need changes to the C# code (which is open source - if it's possible to replace the version in the game with a modified one this might be fixable yet). Unlike all the above games these shafts do not come from the sun, rather they are a volumetric ray-marched light shaft cast from another source (such as a window) using epipolar geometry to map them from the camera into the light shaft coordinate system. The biggest obstacle is that the shaders do not have access to the three dimensional coordinates of the light - they only have the XY screen coordinates and lack the necessary depth information to perform the adjustment (and this is where a one line change to the C# might make these fixable - that damn line that throws away the W component when it sets the shader variable!), and no approximation is good enough for all of these :(

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

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

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

Posted 03/29/2015 02:27 PM   
  13 / 13    
Scroll To Top