Vapour
  1 / 2    
This game is Unity 5 with DirectX 11, I think. Does anybody have any idea why it is impossible to start this game in 3D Vision ?
This game is Unity 5 with DirectX 11, I think. Does anybody have any idea why it is impossible to start this game in 3D Vision ?

#1
Posted 07/04/2015 05:03 PM   
Most likely it's using borderless windowed mode (pretty common in Unity games because the engine's alt+tab handling is broken in DX11 exclusive full screen). Recent versions of 3DMigoto can force exclusive full screen to work around that - enable full_screen=1 in the d3dx.ini. Unity 5 looks a lot better than Unity 4 out of the box, but usually still needs a fair bit of work. I've got a template on my github for shadows, and most of the rest of it is just fixing halo type issues. Physical lighting effects (specular highlight, environmental reflections) currently cannot be fixed if the FOV can vary but that's not a deal breaker (and something I intend to address in 3DMigoto soon). Other effects depend on the game. The World of Diving fix is Unity 5 if you wanted to look at an example.
Most likely it's using borderless windowed mode (pretty common in Unity games because the engine's alt+tab handling is broken in DX11 exclusive full screen). Recent versions of 3DMigoto can force exclusive full screen to work around that - enable full_screen=1 in the d3dx.ini.

Unity 5 looks a lot better than Unity 4 out of the box, but usually still needs a fair bit of work. I've got a template on my github for shadows, and most of the rest of it is just fixing halo type issues. Physical lighting effects (specular highlight, environmental reflections) currently cannot be fixed if the FOV can vary but that's not a deal breaker (and something I intend to address in 3DMigoto soon). Other effects depend on the game.

The World of Diving fix is Unity 5 if you wanted to look at an example.

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

#2
Posted 07/04/2015 09:02 PM   
Thanks for the reply. I have tried all 3 settings of the 3D control panel (only full screen,3d programs and always) but none of them work in this case. How do I install 3DMigoto for the d3dx.ini to work ?
Thanks for the reply. I have tried all 3 settings of the 3D control panel (only full screen,3d programs and always) but none of them work in this case. How do I install 3DMigoto for the d3dx.ini to work ?

#3
Posted 07/05/2015 08:41 AM   
Use this zip file, and extract the 3Dmigoto dlls and d3dx.ini into your game directory: https://github.com/bo3b/3Dmigoto/releases/download/0.99.50-alpha/3Dmigoto-1.1.26.zip Use the x64 or x32 variant as needed. Edit the d3dx.ini file, and in the [Device] section, uncomment the line (remove the semicolon) for the full_screen=1. That should force the game to be full screen, and 3D should engage automatically.
Use this zip file, and extract the 3Dmigoto dlls and d3dx.ini into your game directory:


https://github.com/bo3b/3Dmigoto/releases/download/0.99.50-alpha/3Dmigoto-1.1.26.zip


Use the x64 or x32 variant as needed.

Edit the d3dx.ini file, and in the [Device] section, uncomment the line (remove the semicolon) for the full_screen=1.


That should force the game to be full screen, and 3D should engage automatically.

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

#4
Posted 07/05/2015 09:13 AM   
Thanks, game starts now in 3D vision using 3Dmigoto but is completely broken. Using compatibility mode is a great improvement but still some effects like fog and fire are broken. Maybe one of the experts could take a look at it.
Thanks, game starts now in 3D vision using 3Dmigoto but is completely broken. Using compatibility mode is a great improvement but still some effects like fog and fire are broken. Maybe one of the experts could take a look at it.

#5
Posted 07/05/2015 11:57 AM   
Ok, having done Bo3b's Shader School I thought that I would try and fix this game but have now come to the conclusion that it is too difficult for me especially since you must force full screen in 3Dmitogo and then alt-tab crashes the game which makes experimentation virtually impossible. Cannot switch to windowed because alt-enter has no effect unfortunately. Is there anybody who could look at this game and give an opinion on how difficult it is to fix it ? Thanks in advance.
Ok, having done Bo3b's Shader School I thought that I would try and fix this game but have now come to the conclusion that it is too difficult for me especially since you must force full screen in 3Dmitogo and then alt-tab crashes the game which makes experimentation virtually impossible. Cannot switch to windowed because alt-enter has no effect unfortunately.

Is there anybody who could look at this game and give an opinion on how difficult it is to fix it ?
Thanks in advance.

#6
Posted 11/16/2015 12:25 PM   
@tonka...if the game is unity 5 DX11 look here: [url]https://github.com/DarkStarSword/3d-fixes/tree/master/Unity5/DX11/ShaderFixes[/url] The patterns for fixing will be the same, so is almost copy/paste. The difficult part will be hunt the correct shader. If you have a notebook or another PC, you can share the game folder and do the changes in another PC/notebook...so you will not doing ATL-TAB. Also try using the 1.2.9 version of the wrapper, DarkStarSword fix some crash issues that may be related (worth trying)
@tonka...if the game is unity 5 DX11 look here:

https://github.com/DarkStarSword/3d-fixes/tree/master/Unity5/DX11/ShaderFixes

The patterns for fixing will be the same, so is almost copy/paste. The difficult part will be hunt the correct shader.


If you have a notebook or another PC, you can share the game folder and do the changes in another PC/notebook...so you will not doing ATL-TAB. Also try using the 1.2.9 version of the wrapper, DarkStarSword fix some crash issues that may be related (worth trying)

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

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

#7
Posted 11/16/2015 12:59 PM   
I get a lot of black artifacts looking like plants or tree branches all over the place. Are they shadows in the mist. I managed to hide a few of them but is there a better solution ?
I get a lot of black artifacts looking like plants or tree branches all over the place. Are they shadows in the mist. I managed to hide a few of them but is there a better solution ?

#8
Posted 11/16/2015 01:09 PM   
I fixed 10 vertex shaders and at the moment the game is looking good. Only the large flickering shadows by the fire cause black shapes on the rock wall. Here is the shader which causes this which I have disabled for now in the d3dx.ini. Setting o0 & o1 to 0 in the shader has no effect. [code]cbuffer cb1 : register(b1) { float4 cb1[16]; } cbuffer cb0 : register(b0) { float4 cb0[2]; } Texture2D<float4> StereoParams : register(t125); Texture1D<float4> IniParams : register(t120); void main( float4 v0 : POSITION0, float3 v1 : NORMAL0, float4 v2 : TEXCOORD0, out float3 o0 : TEXCOORD0, out float4 o1 : SV_POSITION0) { float4 r0; uint4 bitmask, uiDest; float4 fDest; r0.xyz = cb1[13].xyz * v0.yyy; r0.xyz = cb1[12].xyz * v0.xxx + r0.xyz; r0.xyz = cb1[14].xyz * v0.zzz + r0.xyz; r0.xyz = cb1[15].xyz * v0.www + r0.xyz; o0.xyz = -cb0[1].xyz + r0.xyz; r0.xyzw = cb1[1].xyzw * v0.yyyy; r0.xyzw = cb1[0].xyzw * v0.xxxx + r0.xyzw; r0.xyzw = cb1[2].xyzw * v0.zzzz + r0.xyzw; o1.xyzw = cb1[3].xyzw * v0.wwww + r0.xyzw; return; } [/code]
I fixed 10 vertex shaders and at the moment the game is looking good. Only the large flickering shadows by the fire cause black shapes on the rock wall. Here is the shader which causes this which I have disabled for now in the d3dx.ini. Setting o0 & o1 to 0 in the shader has no effect.

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

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


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

void main(
float4 v0 : POSITION0,
float3 v1 : NORMAL0,
float4 v2 : TEXCOORD0,
out float3 o0 : TEXCOORD0,
out float4 o1 : SV_POSITION0)
{
float4 r0;
uint4 bitmask, uiDest;
float4 fDest;

r0.xyz = cb1[13].xyz * v0.yyy;
r0.xyz = cb1[12].xyz * v0.xxx + r0.xyz;
r0.xyz = cb1[14].xyz * v0.zzz + r0.xyz;
r0.xyz = cb1[15].xyz * v0.www + r0.xyz;
o0.xyz = -cb0[1].xyz + r0.xyz;
r0.xyzw = cb1[1].xyzw * v0.yyyy;
r0.xyzw = cb1[0].xyzw * v0.xxxx + r0.xyzw;
r0.xyzw = cb1[2].xyzw * v0.zzzz + r0.xyzw;
o1.xyzw = cb1[3].xyzw * v0.wwww + r0.xyzw;

return;
}

#9
Posted 11/22/2015 02:07 PM   
Hmmm, doesn't quite look like the usual lighting shaders - what's the filename of that shader? I can use my scripts to extract the headers from Unity to get some more info about it.
Hmmm, doesn't quite look like the usual lighting shaders - what's the filename of that shader? I can use my scripts to extract the headers from Unity to get some more info about it.

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

#10
Posted 11/22/2015 05:32 PM   
Filename is 555175d5322c0d19.
Filename is 555175d5322c0d19.

#11
Posted 11/22/2015 05:54 PM   
ok, that's just a "vertex lit" shader, and I doubt it is the right place to adjust anything (I have never needed to fix any of these). From the headers I can guess that this shader is drawing an opaque object that casts a shadow, but this particular shader does not receive shadows. The reason it's made the black shapes disappear is because you have removed the object casting the shadow. There is likely to be a second shader contributing to the black shapes that you will need to find. Headers: [code] // 3DMigoto: 555175d5322c0d19 | Matched 2 variants of 2 shaders: Legacy Shaders/VertexLit, Mobile/VertexLit // // Unity headers extracted from Normal-VertexLit.shader // Shader "Legacy Shaders/VertexLit" { // Properties { // _Color ("Main Color", Color) = (1,1,1,1) // _SpecColor ("Spec Color", Color) = (1,1,1,1) // _Emission ("Emissive Color", Color) = (0,0,0,0) // _Shininess ("Shininess", Range(0.01,1)) = 0.7 // _MainTex ("Base (RGB)", 2D) = "white" { } // } // SubShader 1/1 { // LOD 100 // Tags { "RenderType"="Opaque" } // Pass 4/4 { // Name "SHADOWCASTER" // Tags { "LIGHTMODE"="SHADOWCASTER" "SHADOWSUPPORT"="true" "RenderType"="Opaque" } // GpuProgramID 33459 // Program "vp" { // SubProgram "d3d11 " { // Keywords { "SHADOWS_CUBE" } // Bind "vertex" Vertex // ConstBuffer "UnityLighting" 720 // Vector 16 [_LightPositionRange] // ConstBuffer "UnityPerDraw" 336 // Matrix 0 [glstate_matrix_mvp] // Matrix 192 [_Object2World] // BindCB "UnityLighting" 0 // BindCB "UnityPerDraw" 1 // } // } // } // } // } // // Unity headers extracted from Mobile-VertexLit.shader // Shader "Mobile/VertexLit" { // Properties { // _MainTex ("Base (RGB)", 2D) = "white" { } // } // SubShader 1/1 { // LOD 80 // Tags { "RenderType"="Opaque" } // Pass 4/4 { // Name "SHADOWCASTER" // Tags { "LIGHTMODE"="SHADOWCASTER" "SHADOWSUPPORT"="true" "RenderType"="Opaque" } // Cull Off // GpuProgramID 49029 // Program "vp" { // SubProgram "d3d11 " { // Keywords { "SHADOWS_CUBE" } // Bind "vertex" Vertex // ConstBuffer "UnityLighting" 720 // Vector 16 [_LightPositionRange] // ConstBuffer "UnityPerDraw" 336 // Matrix 0 [glstate_matrix_mvp] // Matrix 192 [_Object2World] // BindCB "UnityLighting" 0 // BindCB "UnityPerDraw" 1 // } // } // } // } // } // // Headers extracted with DarkStarSword's extract_unity_shaders.py // https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity_shaders.py // // Shader model vs_4_0 [/code] I extracted those headers with these commands (needs Python 3.4): [code] C:\...\Vapour>c:\Python34\python.exe c:\...\3d-fixes\unity_asset_extractor.py Vapour_Part1_Data\Resources\* Vapour_Part1_Data\*.assets C:\...\Vapour>cd extracted C:\...\Vapour\extracted>c:\Python34\python.exe c:\...\3d-fixes\extract_unity_shaders.py *\*.shader --type=d3d11 [/code]
ok, that's just a "vertex lit" shader, and I doubt it is the right place to adjust anything (I have never needed to fix any of these). From the headers I can guess that this shader is drawing an opaque object that casts a shadow, but this particular shader does not receive shadows. The reason it's made the black shapes disappear is because you have removed the object casting the shadow. There is likely to be a second shader contributing to the black shapes that you will need to find.

Headers:
// 3DMigoto: 555175d5322c0d19 | Matched 2 variants of 2 shaders: Legacy Shaders/VertexLit, Mobile/VertexLit
//
// Unity headers extracted from Normal-VertexLit.shader
// Shader "Legacy Shaders/VertexLit" {
// Properties {
// _Color ("Main Color", Color) = (1,1,1,1)
// _SpecColor ("Spec Color", Color) = (1,1,1,1)
// _Emission ("Emissive Color", Color) = (0,0,0,0)
// _Shininess ("Shininess", Range(0.01,1)) = 0.7
// _MainTex ("Base (RGB)", 2D) = "white" { }
// }
// SubShader 1/1 {
// LOD 100
// Tags { "RenderType"="Opaque" }
// Pass 4/4 {
// Name "SHADOWCASTER"
// Tags { "LIGHTMODE"="SHADOWCASTER" "SHADOWSUPPORT"="true" "RenderType"="Opaque" }
// GpuProgramID 33459
// Program "vp" {
// SubProgram "d3d11 " {
// Keywords { "SHADOWS_CUBE" }
// Bind "vertex" Vertex
// ConstBuffer "UnityLighting" 720
// Vector 16 [_LightPositionRange]
// ConstBuffer "UnityPerDraw" 336
// Matrix 0 [glstate_matrix_mvp]
// Matrix 192 [_Object2World]
// BindCB "UnityLighting" 0
// BindCB "UnityPerDraw" 1
// }
// }
// }
// }
// }
//
// Unity headers extracted from Mobile-VertexLit.shader
// Shader "Mobile/VertexLit" {
// Properties {
// _MainTex ("Base (RGB)", 2D) = "white" { }
// }
// SubShader 1/1 {
// LOD 80
// Tags { "RenderType"="Opaque" }
// Pass 4/4 {
// Name "SHADOWCASTER"
// Tags { "LIGHTMODE"="SHADOWCASTER" "SHADOWSUPPORT"="true" "RenderType"="Opaque" }
// Cull Off
// GpuProgramID 49029
// Program "vp" {
// SubProgram "d3d11 " {
// Keywords { "SHADOWS_CUBE" }
// Bind "vertex" Vertex
// ConstBuffer "UnityLighting" 720
// Vector 16 [_LightPositionRange]
// ConstBuffer "UnityPerDraw" 336
// Matrix 0 [glstate_matrix_mvp]
// Matrix 192 [_Object2World]
// BindCB "UnityLighting" 0
// BindCB "UnityPerDraw" 1
// }
// }
// }
// }
// }
//
// Headers extracted with DarkStarSword's extract_unity_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity_shaders.py
//
// Shader model vs_4_0


I extracted those headers with these commands (needs Python 3.4):
C:\...\Vapour>c:\Python34\python.exe c:\...\3d-fixes\unity_asset_extractor.py Vapour_Part1_Data\Resources\* Vapour_Part1_Data\*.assets

C:\...\Vapour>cd extracted

C:\...\Vapour\extracted>c:\Python34\python.exe c:\...\3d-fixes\extract_unity_shaders.py *\*.shader --type=d3d11

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

#12
Posted 11/23/2015 03:28 AM   
The problem seems to be gone now but after playing Vapour for a while I have given up on it because it is a bit too weird for me and it gets very difficult later on. BTW I wasted 2 hours when using Discover mode trying to find halos left and right of that tree by the fire which were caused by that mode and did not appear in normal stereo mode. As far as I can see the game is very playable now, I have been in caves and under water but since I haven't finished the game I can't be sure. Do you want my shaders and if so how can I pass them to you. I only needed to fix vs shaders, when is it necessary to fix ps shaders since the vs shaders pass through the coordinates of the textures ? You spoke about recognising patterns previously. Can you give me more information and examples about them perhaps. I still have a few games in my library that are broken and maybe I will practice on and there are games which I am interested in on steam so we will see what the next game that I try to fix is. Your python programs seem pretty useful so I might install them if I try to fix another Unity game. Thanks for all your help and information.
The problem seems to be gone now but after playing Vapour for a while I have given up on it because it is a bit too weird for me and it gets very difficult later on. BTW I wasted 2 hours when using Discover mode trying to find halos left and right of that tree by the fire which were caused by that mode and did not appear in normal stereo mode.

As far as I can see the game is very playable now, I have been in caves and under water but since I haven't finished the game I can't be sure. Do you want my shaders and if so how can I pass them to you.

I only needed to fix vs shaders, when is it necessary to fix ps shaders since the vs shaders pass through the coordinates of the textures ? You spoke about recognising patterns previously. Can you give me more information and examples about them perhaps.

I still have a few games in my library that are broken and maybe I will practice on and there are games which I am interested in on steam so we will see what the next game that I try to fix is. Your python programs seem pretty useful so I might install them if I try to fix another Unity game.

Thanks for all your help and information.

#13
Posted 11/23/2015 10:41 AM   
Whether you need to apply a fix in a vertex shader or a pixel shader depends on the effect you are trying to fix (and some can be fixed in either, and some need adjustments in both). Halos are often (but not always) possible to fix in either, but are almost always easier to fix in the vertex shader (the biggest exception where a halo fix has had to go in the pixel shader has been water, but only in a few games). Shadows almost always need a fix in the pixel shader. When we talk about patterns we're usually talking about fixing an effect in an engine that someone has already worked out how to fix. Generally games using the same engine will have effects broken in the same way, so studying how we have fixed another game using the same engine will show you the patterns to fix that engine. You can look at any of the fixes on the blog, or go through the history of my 3d-fixes repository to find these patterns - if you find the first time I fixed a given effect in the history I'll have included some extra notes in the commit message and usually have added the original shader in a separate commit so that the diff will show what I actually changed: https://github.com/DarkStarSword/3d-fixes/commits/master I also have a database of all DX9 shaders running on one of my servers - you can use the lookup_shader.py script in my 3d-fixes repository to look up any shader's CRC to see if it has been used in any fixes (DX9 games only for now) and show the difference between your local copy and any fixed versions. Asside from halos (which are an almost universal problem with an almost equally universal solution), here's a few other examples of patterns (some easy, some difficult, some insane): Move skybox to infinity (pattern applies to most, but not all games): https://github.com/DarkStarSword/3d-fixes/commit/7622a2940530d3a14b4bb1b556cdbbbfb0e3dec6 Shadows in Unreal Engine 3 (fairly simple): https://github.com/DarkStarSword/3d-fixes/commit/3cbebd0e4b5af11729fa9db6959acc71623ee3b7 However you will notice that any of my more recent DX9 UE3 fixes use a script (shadertool.py) that knows how to recognise the pattern and apply the fix automatically, including dealing with slight variations in registers/components selected by the compiler: https://github.com/DarkStarSword/3d-fixes/commit/82181b842fe6cf3e0d087a58d6a7309b0b5a134d God rays in Unreal Engine 3 (simple): https://github.com/DarkStarSword/3d-fixes/commit/ad6535c0534b68638dd2411a2ad770ccec3ba9f6 God rays in CryEngine 3 (simple): https://github.com/DarkStarSword/3d-fixes/commit/76af7b96a19723172520f61cd778a79fedf970cc God rays in Euro Truck Simulator 2 (moderate - no headers): https://github.com/DarkStarSword/3d-fixes/commit/67b31c856c08a4d563eebd0901cd91b67ff6de1a God rays in Unity 4 (simple once headers were extracted): https://github.com/DarkStarSword/3d-fixes/commit/54831b2f00a9912daa514ac6df384376eecc1f97 God rays + underwater crepuscular rays in Stranded Deep (also Unity, but more complex than the above): https://github.com/DarkStarSword/3d-fixes/commit/83d50b1eac65ebbb938a697ae4ef2e2882c2cfcb God rays in Witcher 3 (moderate - no headers): https://github.com/bo3b/3DMigoto/commit/dde106498b06455133af025afe21a9147efaae18 You might notice that the god ray pattern is similar for all the above engines... but things can get quite a bit more complicated: NVIDIA "Enhanced" god rays in Far Cry 4 (relatively simple for an approximation): https://github.com/bo3b/3DMigoto/commit/c713fad554177eca9d90c3f2840e0c05f326caa1 Regular god rays in Far Cry 4 (very difficult): https://github.com/bo3b/3DMigoto/commit/007e1a26eb68f12dbc5e7c1f3ad3b887160361bb God rays in Miasmata (insanely difficult): https://github.com/DarkStarSword/3d-fixes/commit/8c8f51d2e0b8e583b09c3fe12d64ebbf1c9fa7e5 https://github.com/DarkStarSword/3d-fixes/commit/d4a11aeae8bd69e04fa489f5acad80565e765f37 Alternate Unity 4 shadow fix for games where the usual technique in my template doesn't work: https://github.com/DarkStarSword/3d-fixes/commit/da1483c728398e9c355dfad42cb550e9434557bb CryEngine 3 point lights/shadows: https://github.com/DarkStarSword/3d-fixes/commit/d26e85d9461af07875021cef97e6627f326f5e0b CryEngine 3 directional lights/shadows: https://github.com/DarkStarSword/3d-fixes/commit/06805484e6b65d6c52380f9271346f36ae232a27 CryEngine 3 decales: https://github.com/DarkStarSword/3d-fixes/commit/8af18a481baffcf616bb0ea62f42135c51fd6cc4 Multipass fog in Unreal Engine 3 (needs adjustments to *four* shaders to fix accurately): https://github.com/DarkStarSword/3d-fixes/commit/d4d9f63f8fd30c1b4e7e44cda743e6d2483b0cb6 HBAO+ in Far Cry 4: https://forums.geforce.com/default/topic/897529/3d-vision/3d-hbao-normal-map-artefact-fix/ Far Cry 4 underwater caustics: https://github.com/bo3b/3DMigoto/commit/87e48ff8ff3831511c99ecbab17e8286873dda91 I could go on, but I think you get the idea.
Whether you need to apply a fix in a vertex shader or a pixel shader depends on the effect you are trying to fix (and some can be fixed in either, and some need adjustments in both).

Halos are often (but not always) possible to fix in either, but are almost always easier to fix in the vertex shader (the biggest exception where a halo fix has had to go in the pixel shader has been water, but only in a few games). Shadows almost always need a fix in the pixel shader.

When we talk about patterns we're usually talking about fixing an effect in an engine that someone has already worked out how to fix. Generally games using the same engine will have effects broken in the same way, so studying how we have fixed another game using the same engine will show you the patterns to fix that engine.

You can look at any of the fixes on the blog, or go through the history of my 3d-fixes repository to find these patterns - if you find the first time I fixed a given effect in the history I'll have included some extra notes in the commit message and usually have added the original shader in a separate commit so that the diff will show what I actually changed:

https://github.com/DarkStarSword/3d-fixes/commits/master

I also have a database of all DX9 shaders running on one of my servers - you can use the lookup_shader.py script in my 3d-fixes repository to look up any shader's CRC to see if it has been used in any fixes (DX9 games only for now) and show the difference between your local copy and any fixed versions.


Asside from halos (which are an almost universal problem with an almost equally universal solution), here's a few other examples of patterns (some easy, some difficult, some insane):


Move skybox to infinity (pattern applies to most, but not all games):
https://github.com/DarkStarSword/3d-fixes/commit/7622a2940530d3a14b4bb1b556cdbbbfb0e3dec6



Shadows in Unreal Engine 3 (fairly simple):
https://github.com/DarkStarSword/3d-fixes/commit/3cbebd0e4b5af11729fa9db6959acc71623ee3b7

However you will notice that any of my more recent DX9 UE3 fixes use a script (shadertool.py) that knows how to recognise the pattern and apply the fix automatically, including dealing with slight variations in registers/components selected by the compiler:
https://github.com/DarkStarSword/3d-fixes/commit/82181b842fe6cf3e0d087a58d6a7309b0b5a134d



God rays in Unreal Engine 3 (simple):
https://github.com/DarkStarSword/3d-fixes/commit/ad6535c0534b68638dd2411a2ad770ccec3ba9f6

God rays in CryEngine 3 (simple):
https://github.com/DarkStarSword/3d-fixes/commit/76af7b96a19723172520f61cd778a79fedf970cc

God rays in Euro Truck Simulator 2 (moderate - no headers):
https://github.com/DarkStarSword/3d-fixes/commit/67b31c856c08a4d563eebd0901cd91b67ff6de1a

God rays in Unity 4 (simple once headers were extracted):
https://github.com/DarkStarSword/3d-fixes/commit/54831b2f00a9912daa514ac6df384376eecc1f97

God rays + underwater crepuscular rays in Stranded Deep (also Unity, but more complex than the above):
https://github.com/DarkStarSword/3d-fixes/commit/83d50b1eac65ebbb938a697ae4ef2e2882c2cfcb

God rays in Witcher 3 (moderate - no headers):
https://github.com/bo3b/3DMigoto/commit/dde106498b06455133af025afe21a9147efaae18

You might notice that the god ray pattern is similar for all the above engines... but things can get quite a bit more complicated:

NVIDIA "Enhanced" god rays in Far Cry 4 (relatively simple for an approximation):
https://github.com/bo3b/3DMigoto/commit/c713fad554177eca9d90c3f2840e0c05f326caa1

Regular god rays in Far Cry 4 (very difficult):
https://github.com/bo3b/3DMigoto/commit/007e1a26eb68f12dbc5e7c1f3ad3b887160361bb

God rays in Miasmata (insanely difficult):
https://github.com/DarkStarSword/3d-fixes/commit/8c8f51d2e0b8e583b09c3fe12d64ebbf1c9fa7e5
https://github.com/DarkStarSword/3d-fixes/commit/d4a11aeae8bd69e04fa489f5acad80565e765f37




Alternate Unity 4 shadow fix for games where the usual technique in my template doesn't work:
https://github.com/DarkStarSword/3d-fixes/commit/da1483c728398e9c355dfad42cb550e9434557bb

CryEngine 3 point lights/shadows:
https://github.com/DarkStarSword/3d-fixes/commit/d26e85d9461af07875021cef97e6627f326f5e0b

CryEngine 3 directional lights/shadows:
https://github.com/DarkStarSword/3d-fixes/commit/06805484e6b65d6c52380f9271346f36ae232a27

CryEngine 3 decales:
https://github.com/DarkStarSword/3d-fixes/commit/8af18a481baffcf616bb0ea62f42135c51fd6cc4

Multipass fog in Unreal Engine 3 (needs adjustments to *four* shaders to fix accurately):
https://github.com/DarkStarSword/3d-fixes/commit/d4d9f63f8fd30c1b4e7e44cda743e6d2483b0cb6

HBAO+ in Far Cry 4:
https://forums.geforce.com/default/topic/897529/3d-vision/3d-hbao-normal-map-artefact-fix/

Far Cry 4 underwater caustics:
https://github.com/bo3b/3DMigoto/commit/87e48ff8ff3831511c99ecbab17e8286873dda91



I could go on, but I think you get the idea.

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

#14
Posted 11/23/2015 12:15 PM   
And these 2 patterns that you mentioned previously, I have seen them quite often - what are they doing and what are constant buffers ? matrix multiply as a sequence of four dot products or a mul/mad/mad/add sequence with consecutive constant registers I have a lot of the games that you fixed so I can always look how you fixed them. I have one last question - when does as far as you know the resolution and screen rate override in the d3dx.ini work and when not. Vapour used always the desktop resolution and although changing it is in the options it didn't work and using the override had no effect. Also I can't play Dying Light on the projector with 3DTV Play because my projector is 120hz and Dying Light always uses the highest possible refresh rate with no option to change it - overriding it with d3dx.ini also didn't work. I had the same problem with Lichdom Battlemage but I didn't know about the override possibility and have now discovered that it works perfectly for the refresh rate - great.
And these 2 patterns that you mentioned previously, I have seen them quite often - what are they doing and what are constant buffers ?

matrix multiply as a sequence of four dot products or a mul/mad/mad/add sequence with consecutive constant registers

I have a lot of the games that you fixed so I can always look how you fixed them. I have one last question - when does as far as you know the resolution and screen rate override in the d3dx.ini work and when not. Vapour used always the desktop resolution and although changing it is in the options it didn't work and using the override had no effect. Also I can't play Dying Light on the projector with 3DTV Play because my projector is 120hz and Dying Light always uses the highest possible refresh rate with no option to change it - overriding it with d3dx.ini also didn't work. I had the same problem with Lichdom Battlemage but I didn't know about the override possibility and have now discovered that it works perfectly for the refresh rate - great.

#15
Posted 11/23/2015 12:38 PM   
  1 / 2    
Scroll To Top