How to fix/disable shaders in games(DLL,guide and fixes).
  163 / 167    
Are there any youtube tutorials about getting Started with Helix modding? Or is it quite intuitive once You go through trail and error?
Are there any youtube tutorials about getting Started with Helix modding? Or is it quite intuitive once You go through trail and error?

Posted 02/25/2015 03:23 PM   
Depending upon what you looked at, and how far along you are, you might want to look at Bo3b's School for ShaderHackers, for some background. [url]http://wiki.bo3b.net[/url] With regard to the changing FOV, I don't think that usually causes a problem with 3D by itself. FOV doesn't usually directly impact the convergence or separation. The shadows are typically a problem in a lot of games. As a first effort, it usually worthwhile to try to disable the shadows first, and try to actually fix them later. Disabling shadows can often take a game from unplayable to OK.
Depending upon what you looked at, and how far along you are, you might want to look at Bo3b's School for ShaderHackers, for some background. http://wiki.bo3b.net


With regard to the changing FOV, I don't think that usually causes a problem with 3D by itself. FOV doesn't usually directly impact the convergence or separation.

The shadows are typically a problem in a lot of games. As a first effort, it usually worthwhile to try to disable the shadows first, and try to actually fix them later. Disabling shadows can often take a game from unplayable to OK.

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 02/26/2015 08:02 AM   
thanks a million for the link :) the glasses are being shipped right now, can't wait to test them and tweak the settings :) BTW, why are you reffering to your school in the third person? :D
thanks a million for the link :)
the glasses are being shipped right now, can't wait to test them and tweak the settings :)

BTW, why are you reffering to your school in the third person? :D

Posted 02/26/2015 01:28 PM   
No idea if this will help in any way, but I came across this http://www.andrewhazelden.com/blog/2013/09/mental-ray-syntax-highlighter/ While looking at a new release from Nvidia "New version of Alembic import shader" http://blog.mentalray.com/ EDIT: seems like this is used primarily for GCI and pre-rendered scenes. Capcom/Blue Castle used it in Dead Rising games and Devil May Cry 4. http://developer.download.nvidia.com/presentations/2009/GDC/GDC09_PlatformIndepShaderDev.pdf
No idea if this will help in any way, but I came across this
http://www.andrewhazelden.com/blog/2013/09/mental-ray-syntax-highlighter/

While looking at a new release from Nvidia "New version of Alembic import shader" http://blog.mentalray.com/

EDIT: seems like this is used primarily for GCI and pre-rendered scenes. Capcom/Blue Castle used it in Dead Rising games and Devil May Cry 4.
http://developer.download.nvidia.com/presentations/2009/GDC/GDC09_PlatformIndepShaderDev.pdf

Posted 03/02/2015 02:08 PM   
I would like to toggle the hud in a game. I started testing with one file. When I run the game, the shader is disabled, but I did not edit the shader. What am I missing? I previously converted it from vs_2_0 to vs_3_0. I have the same problem with both shader versions. Shader code: [code] vs_3_0 dcl_position o10 dcl_texcoord o0.xy dcl_color o8 dcl_color1 o9 dcl_position v0 dcl_color v1 dcl_color1 v2 dp4 o10.x, v0, c0 dp4 o10.y, v0, c1 dp4 o0.x, v0, c2 dp4 o0.y, v0, c3 mov o10.zw, v0 mov o8, v1.zyxw mov o9, v2.zyxw[/code]
I would like to toggle the hud in a game. I started testing with one file. When I run the game, the shader is disabled, but I did not edit the shader. What am I missing?

I previously converted it from vs_2_0 to vs_3_0. I have the same problem with both shader versions.

Shader code:
vs_3_0
dcl_position o10
dcl_texcoord o0.xy
dcl_color o8
dcl_color1 o9
dcl_position v0
dcl_color v1
dcl_color1 v2
dp4 o10.x, v0, c0
dp4 o10.y, v0, c1
dp4 o0.x, v0, c2
dp4 o0.y, v0, c3
mov o10.zw, v0
mov o8, v1.zyxw
mov o9, v2.zyxw

Posted 03/22/2015 02:37 AM   
If you're using the original unedited code it shouldn't be disabled when it starts even if it's not converted to vs_3_0, usually that only happens if there's an error in the shader code. I've run games with all(1000s) the shaders being loaded from the ShaderOverride folder, unconverted, without issue. Like DarkStarSword mentioned in the other thread you can search the LOG.txt for the CRC to see if there are any errors and you can also try disabling the HUD via a Pixel Shader if you can find one ... so what game is this on? and what CRC is it? If I have the game I can see if I'm getting the same results as you.
If you're using the original unedited code it shouldn't be disabled when it starts even if it's not converted to vs_3_0, usually that only happens if there's an error in the shader code. I've run games with all(1000s) the shaders being loaded from the ShaderOverride folder, unconverted, without issue.

Like DarkStarSword mentioned in the other thread you can search the LOG.txt for the CRC to see if there are any errors and you can also try disabling the HUD via a Pixel Shader if you can find one ... so what game is this on? and what CRC is it? If I have the game I can see if I'm getting the same results as you.
Posted 03/22/2015 03:45 AM   
The game is Fear 2. Using the dumps from Helix mod, every unedited shader I test disables it's effect in game whether v2 or converted to v3, pixel or vertex shader, using debug dll or release dll. I want to disable every hud element in Fear 2 and the expansion: Reborn. But, disabling the hud also removes the game menus. My goal: toggle the hud on/off. That way I can remove the hud in game but enable the menus when I need them. The above code was for this vertex shader: 0B3F4AB7.txt The other vertex shaders used for the hud are: 7AFF53E5.txt 869395BE.txt B9A5B8A0.txt C7560C0A.txt And one Pixel shader (which removes the boxes around items in game. I'd just leave this off): 2CB1EC9F.txt The LOG.txt file has LOTS of errors. Examples: Start CreateVertexShader luaL_loadfile cannot open VSscript.lua: No such file or directory CreateVertexShader CRC: 0x60B16452 luaL_openlibs luaL_loadfile cannot open PSscript.lua: No such file or directory CreatePixelShader CRC: 0xAC99D535
The game is Fear 2. Using the dumps from Helix mod, every unedited shader I test disables it's effect in game whether v2 or converted to v3, pixel or vertex shader, using debug dll or release dll.

I want to disable every hud element in Fear 2 and the expansion: Reborn. But, disabling the hud also removes the game menus.

My goal: toggle the hud on/off. That way I can remove the hud in game but enable the menus when I need them.

The above code was for this vertex shader:
0B3F4AB7.txt

The other vertex shaders used for the hud are:
7AFF53E5.txt
869395BE.txt
B9A5B8A0.txt
C7560C0A.txt

And one Pixel shader (which removes the boxes around items in game. I'd just leave this off):
2CB1EC9F.txt


The LOG.txt file has LOTS of errors. Examples:

Start CreateVertexShader

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

CreateVertexShader CRC: 0x60B16452

luaL_openlibs

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

CreatePixelShader CRC: 0xAC99D535

Posted 03/22/2015 04:36 AM   
No need to worry about the PSscript.lua errors - those are normal. It seems that some of those CRCs were used in eqzitara's fix for that game - do the versions from the fix work for you? (Oh by the way - I think I've mentioned it a few times, but I wrote a shader database a while back, and the server is live so feel free to use it. If you give it the filename of a shader it will show the difference between your version and any fixed versions, otherwise you can just give it CRCs to see the fixed version(s)) [code] ~/3d-fixes/__shader_database__/lookup_db.py 2CB1EC9F 0B3F4AB7 7AFF53E5 869395BE B9A5B8A0 C7560C0A Sending request to shader database server... Retrieving result... Done [/code] [code] // /=============================================================================== // | // >-+----------------------------------------------------------------------------- // | | 0B3F4AB7: Fix 1/1 // | >-+--------------------------------------------------------------------------- // | | | "FEAR 2 - Project Origin" - eqzitara // | | | Post URL: http://helixmod.blogspot.com/2014/01/fear-2-project-origin.html // | | \-+------------------------------------------------------------------------- // | | | Download: https://s3.amazonaws.com/eqznew/fear2/shaderoverride.zip // | | | -> shaderoverride/vertexshaders/0B3F4AB7.txt // | | \------------------------------------------------------------------------- //HUD B // Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656 // // Parameters: // // row_major float4x4 k_mGFxTransform; // float4 k_vGFxTexGen1x; // float4 k_vGFxTexGen1y; // // // Registers: // // Name Reg Size // --------------- ----- ---- // k_mGFxTransform c0 2 // k_vGFxTexGen1x c2 1 // k_vGFxTexGen1y c3 1 // // // Default values: // // k_mGFxTransform // c0 = { 0, 0, 0, 0 }; // c1 = { 0, 0, 0, 0 }; // // k_vGFxTexGen1x // c2 = { 0, 0, 0, 0 }; // // k_vGFxTexGen1y // c3 = { 0, 0, 0, 0 }; // vs_3_0 def c200, 0.30, 0, 0.0625, 0.0 def c220, 0.30, 0, 0.0625, 1 dcl_2d s0 dcl_position o10 dcl_texcoord o0.xy dcl_color o8 dcl_color1 o9 dcl_position v0 dcl_color v1 dcl_color1 v2 dp4 r3.x, v0, c0 dp4 r3.y, v0, c1 dp4 o0.x, v0, c2 dp4 o0.y, v0, c3 mov r3.zw, v0 texldl r1, c220.z, s0 if_eq r3.w, c220.w mul r1.x, r1.x, -c220.x add r3.x, r3.x, -r1.x endif mov o10, r3 mov o8, v1.zyxw mov o9, v2.zyxw // approximately 7 instruction slots used [/code] [code] // /=============================================================================== // | // >-+----------------------------------------------------------------------------- // | | 7AFF53E5: Fix 1/1 // | >-+--------------------------------------------------------------------------- // | | | "FEAR 2 - Project Origin" - eqzitara // | | | Post URL: http://helixmod.blogspot.com/2014/01/fear-2-project-origin.html // | | \-+------------------------------------------------------------------------- // | | | Download: https://s3.amazonaws.com/eqznew/fear2/shaderoverride.zip // | | | -> shaderoverride/vertexshaders/7AFF53E5.txt // | | \------------------------------------------------------------------------- // // Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656 // // Parameters: // // row_major float4x4 k_mGFxTransform; // // // Registers: // // Name Reg Size // --------------- ----- ---- // k_mGFxTransform c0 2 // // // Default values: // // k_mGFxTransform // c0 = { 0, 0, 0, 0 }; // c1 = { 0, 0, 0, 0 }; // vs_3_0 def c200, 0, 0, 0, 0 def c220, 0.30, 0, 0.0625, 1 def c227, -.05, .05, -.05, .05 dcl_2d s0 dcl_position v0 dcl_color v1 dcl_color1 v2 dcl_color o0 dcl_color1 o1 dcl_position o10 dp4 r3.x, v0, c0 dp4 r3.y, v0, c1 mov r3.zw, v0 texldl r1, c220.z, s0 if_eq r3.w, c220.w mul r1.x, r1.x, -c220.x add r3.x, r3.x, -r1.x endif mov r15.x, c251.x mov o10, r3 mov o0, v1.zyxw mov o1, v2.zyxw // approximately 5 instruction slots used [/code] [code] // /=============================================================================== // | // >-+----------------------------------------------------------------------------- // | | 869395BE: Fix 1/1 // | >-+--------------------------------------------------------------------------- // | | | "FEAR 2 - Project Origin" - eqzitara // | | | Post URL: http://helixmod.blogspot.com/2014/01/fear-2-project-origin.html // | | \-+------------------------------------------------------------------------- // | | | Download: https://s3.amazonaws.com/eqznew/fear2/shaderoverride.zip // | | | -> shaderoverride/vertexshaders/869395BE.txt // | | \------------------------------------------------------------------------- // // Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656 // // Parameters: // // row_major float4x4 k_mGFxTransform; // // // Registers: // // Name Reg Size // --------------- ----- ---- // k_mGFxTransform c0 2 // // // Default values: // // k_mGFxTransform // c0 = { 0, 0, 0, 0 }; // c1 = { 0, 0, 0, 0 }; // vs_3_0 def c200, 0, 0, 0, 0 def c220, 0.30, 0, 0.0625, 1 def c227, -.05, .05, -.05, .05 dcl_2d s0 dcl_position o10 dcl_color o8 dcl_position v0 dcl_color v1 dp4 r3.x, v0, c0 dp4 r3.y, v0, c1 mov r3.zw, v0 texldl r1, c220.z, s0 if_eq r3.w, c220.w mul r1.x, r1.x, -c220.x add r3.x, r3.x, -r1.x endif mov r15.x, c251.x mov o10, r3 mov o8, v1.zyxw // approximately 4 instruction slots used [/code] [code] // /=============================================================================== // | // >-+----------------------------------------------------------------------------- // | | B9A5B8A0: Fix 1/1 // | >-+--------------------------------------------------------------------------- // | | | "FEAR 2 - Project Origin" - eqzitara // | | | Post URL: http://helixmod.blogspot.com/2014/01/fear-2-project-origin.html // | | \-+------------------------------------------------------------------------- // | | | Download: https://s3.amazonaws.com/eqznew/fear2/shaderoverride.zip // | | | -> shaderoverride/vertexshaders/B9A5B8A0.txt // | | \------------------------------------------------------------------------- //HUD C // Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656 // // Parameters: // // row_major float4x4 k_mGFxTransform; // float4 k_vGFxTexGen1x; // float4 k_vGFxTexGen1y; // float4 k_vGFxTexGen2x; // float4 k_vGFxTexGen2y; // // // Registers: // // Name Reg Size // --------------- ----- ---- // k_mGFxTransform c0 2 // k_vGFxTexGen1x c2 1 // k_vGFxTexGen1y c3 1 // k_vGFxTexGen2x c4 1 // k_vGFxTexGen2y c5 1 // // // Default values: // // k_mGFxTransform // c0 = { 0, 0, 0, 0 }; // c1 = { 0, 0, 0, 0 }; // // k_vGFxTexGen1x // c2 = { 0, 0, 0, 0 }; // // k_vGFxTexGen1y // c3 = { 0, 0, 0, 0 }; // // k_vGFxTexGen2x // c4 = { 0, 0, 0, 0 }; // // k_vGFxTexGen2y // c5 = { 0, 0, 0, 0 }; // vs_3_0 def c200, 0.30, 0, 0.0625, 0.0 def c220, 0.30, 0, 0.0625, 1 dcl_2d s0 dcl_position o10 dcl_texcoord o0.xy dcl_texcoord1 o1.xy dcl_color o8 dcl_color1 o9 dcl_position v0 dcl_color v1 dcl_color1 v2 dp4 r3.x, v0, c0 dp4 r3.y, v0, c1 dp4 o0.x, v0, c2 dp4 o0.y, v0, c3 dp4 o1.x, v0, c4 dp4 o1.y, v0, c5 mov r3.zw, v0 texldl r1, c220.z, s0 if_eq r3.w, c220.w mul r1.x, r1.x, -c220.x add r3.x, r3.x, -r1.x endif mov o10, r3 mov o8, v1.zyxw mov o9, v2.zyxw // approximately 9 instruction slots used [/code] [code] // /=============================================================================== // | // >-+----------------------------------------------------------------------------- // | | C7560C0A: Fix 1/1 // | >-+--------------------------------------------------------------------------- // | | | "FEAR 2 - Project Origin" - eqzitara // | | | Post URL: http://helixmod.blogspot.com/2014/01/fear-2-project-origin.html // | | \-+------------------------------------------------------------------------- // | | | Download: https://s3.amazonaws.com/eqznew/fear2/shaderoverride.zip // | | | -> shaderoverride/vertexshaders/C7560C0A.txt // | | \------------------------------------------------------------------------- //HUD A // Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656 // // Parameters: // // row_major float4x4 k_mGFxTransform; // // // Registers: // // Name Reg Size // --------------- ----- ---- // k_mGFxTransform c0 2 // // // Default values: // // k_mGFxTransform // c0 = { 0, 0, 0, 0 }; // c1 = { 0, 0, 0, 0 }; // vs_3_0 def c200, 0.30, 0, 0.0625, 0.0 def c220, 0.30, 0, 0.0625, 1 dcl_2d s0 dcl_position o10 dcl_texcoord o0.xy dcl_color o8 dcl_position v0 dcl_texcoord v1 dcl_color v2 dp4 r3.x, v0, c0 dp4 r3.y, v0, c1 mov r3.zw, v0 texldl r1, c220.z, s0 if_eq r3.w, c220.w mul r1.x, r1.x, -c220.x add r3.x, r3.x, -r1.x endif mov o10, r3 mov o0.xy, v1 mov o8, v2 // approximately 5 instruction slots used [/code]
No need to worry about the PSscript.lua errors - those are normal.

It seems that some of those CRCs were used in eqzitara's fix for that game - do the versions from the fix work for you?

(Oh by the way - I think I've mentioned it a few times, but I wrote a shader database a while back, and the server is live so feel free to use it. If you give it the filename of a shader it will show the difference between your version and any fixed versions, otherwise you can just give it CRCs to see the fixed version(s))
~/3d-fixes/__shader_database__/lookup_db.py 2CB1EC9F 0B3F4AB7 7AFF53E5 869395BE B9A5B8A0 C7560C0A

Sending request to shader database server...
Retrieving result...
Done

// /===============================================================================
// |
// >-+-----------------------------------------------------------------------------
// | | 0B3F4AB7: Fix 1/1
// | >-+---------------------------------------------------------------------------
// | | | "FEAR 2 - Project Origin" - eqzitara
// | | | Post URL: http://helixmod.blogspot.com/2014/01/fear-2-project-origin.html
// | | \-+-------------------------------------------------------------------------
// | | | Download: https://s3.amazonaws.com/eqznew/fear2/shaderoverride.zip
// | | | -> shaderoverride/vertexshaders/0B3F4AB7.txt
// | | \-------------------------------------------------------------------------
//HUD B
// Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656
//
// Parameters:
//
// row_major float4x4 k_mGFxTransform;
// float4 k_vGFxTexGen1x;
// float4 k_vGFxTexGen1y;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// k_mGFxTransform c0 2
// k_vGFxTexGen1x c2 1
// k_vGFxTexGen1y c3 1
//
//
// Default values:
//
// k_mGFxTransform
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
//
// k_vGFxTexGen1x
// c2 = { 0, 0, 0, 0 };
//
// k_vGFxTexGen1y
// c3 = { 0, 0, 0, 0 };
//

vs_3_0
def c200, 0.30, 0, 0.0625, 0.0
def c220, 0.30, 0, 0.0625, 1
dcl_2d s0
dcl_position o10
dcl_texcoord o0.xy
dcl_color o8
dcl_color1 o9
dcl_position v0
dcl_color v1
dcl_color1 v2
dp4 r3.x, v0, c0
dp4 r3.y, v0, c1
dp4 o0.x, v0, c2
dp4 o0.y, v0, c3
mov r3.zw, v0
texldl r1, c220.z, s0
if_eq r3.w, c220.w
mul r1.x, r1.x, -c220.x
add r3.x, r3.x, -r1.x
endif
mov o10, r3
mov o8, v1.zyxw
mov o9, v2.zyxw

// approximately 7 instruction slots used

// /===============================================================================
// |
// >-+-----------------------------------------------------------------------------
// | | 7AFF53E5: Fix 1/1
// | >-+---------------------------------------------------------------------------
// | | | "FEAR 2 - Project Origin" - eqzitara
// | | | Post URL: http://helixmod.blogspot.com/2014/01/fear-2-project-origin.html
// | | \-+-------------------------------------------------------------------------
// | | | Download: https://s3.amazonaws.com/eqznew/fear2/shaderoverride.zip
// | | | -> shaderoverride/vertexshaders/7AFF53E5.txt
// | | \-------------------------------------------------------------------------
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656
//
// Parameters:
//
// row_major float4x4 k_mGFxTransform;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// k_mGFxTransform c0 2
//
//
// Default values:
//
// k_mGFxTransform
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
//

vs_3_0
def c200, 0, 0, 0, 0
def c220, 0.30, 0, 0.0625, 1
def c227, -.05, .05, -.05, .05
dcl_2d s0
dcl_position v0
dcl_color v1
dcl_color1 v2
dcl_color o0
dcl_color1 o1
dcl_position o10
dp4 r3.x, v0, c0
dp4 r3.y, v0, c1
mov r3.zw, v0
texldl r1, c220.z, s0
if_eq r3.w, c220.w
mul r1.x, r1.x, -c220.x
add r3.x, r3.x, -r1.x
endif
mov r15.x, c251.x
mov o10, r3
mov o0, v1.zyxw
mov o1, v2.zyxw

// approximately 5 instruction slots used

// /===============================================================================
// |
// >-+-----------------------------------------------------------------------------
// | | 869395BE: Fix 1/1
// | >-+---------------------------------------------------------------------------
// | | | "FEAR 2 - Project Origin" - eqzitara
// | | | Post URL: http://helixmod.blogspot.com/2014/01/fear-2-project-origin.html
// | | \-+-------------------------------------------------------------------------
// | | | Download: https://s3.amazonaws.com/eqznew/fear2/shaderoverride.zip
// | | | -> shaderoverride/vertexshaders/869395BE.txt
// | | \-------------------------------------------------------------------------
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656
//
// Parameters:
//
// row_major float4x4 k_mGFxTransform;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// k_mGFxTransform c0 2
//
//
// Default values:
//
// k_mGFxTransform
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
//

vs_3_0
def c200, 0, 0, 0, 0
def c220, 0.30, 0, 0.0625, 1
def c227, -.05, .05, -.05, .05
dcl_2d s0
dcl_position o10
dcl_color o8
dcl_position v0
dcl_color v1
dp4 r3.x, v0, c0
dp4 r3.y, v0, c1
mov r3.zw, v0
texldl r1, c220.z, s0
if_eq r3.w, c220.w
mul r1.x, r1.x, -c220.x
add r3.x, r3.x, -r1.x
endif
mov r15.x, c251.x
mov o10, r3
mov o8, v1.zyxw

// approximately 4 instruction slots used

// /===============================================================================
// |
// >-+-----------------------------------------------------------------------------
// | | B9A5B8A0: Fix 1/1
// | >-+---------------------------------------------------------------------------
// | | | "FEAR 2 - Project Origin" - eqzitara
// | | | Post URL: http://helixmod.blogspot.com/2014/01/fear-2-project-origin.html
// | | \-+-------------------------------------------------------------------------
// | | | Download: https://s3.amazonaws.com/eqznew/fear2/shaderoverride.zip
// | | | -> shaderoverride/vertexshaders/B9A5B8A0.txt
// | | \-------------------------------------------------------------------------
//HUD C
// Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656
//
// Parameters:
//
// row_major float4x4 k_mGFxTransform;
// float4 k_vGFxTexGen1x;
// float4 k_vGFxTexGen1y;
// float4 k_vGFxTexGen2x;
// float4 k_vGFxTexGen2y;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// k_mGFxTransform c0 2
// k_vGFxTexGen1x c2 1
// k_vGFxTexGen1y c3 1
// k_vGFxTexGen2x c4 1
// k_vGFxTexGen2y c5 1
//
//
// Default values:
//
// k_mGFxTransform
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
//
// k_vGFxTexGen1x
// c2 = { 0, 0, 0, 0 };
//
// k_vGFxTexGen1y
// c3 = { 0, 0, 0, 0 };
//
// k_vGFxTexGen2x
// c4 = { 0, 0, 0, 0 };
//
// k_vGFxTexGen2y
// c5 = { 0, 0, 0, 0 };
//

vs_3_0
def c200, 0.30, 0, 0.0625, 0.0
def c220, 0.30, 0, 0.0625, 1
dcl_2d s0
dcl_position o10
dcl_texcoord o0.xy
dcl_texcoord1 o1.xy
dcl_color o8
dcl_color1 o9
dcl_position v0
dcl_color v1
dcl_color1 v2
dp4 r3.x, v0, c0
dp4 r3.y, v0, c1
dp4 o0.x, v0, c2
dp4 o0.y, v0, c3
dp4 o1.x, v0, c4
dp4 o1.y, v0, c5
mov r3.zw, v0
texldl r1, c220.z, s0
if_eq r3.w, c220.w
mul r1.x, r1.x, -c220.x
add r3.x, r3.x, -r1.x
endif
mov o10, r3
mov o8, v1.zyxw
mov o9, v2.zyxw

// approximately 9 instruction slots used

// /===============================================================================
// |
// >-+-----------------------------------------------------------------------------
// | | C7560C0A: Fix 1/1
// | >-+---------------------------------------------------------------------------
// | | | "FEAR 2 - Project Origin" - eqzitara
// | | | Post URL: http://helixmod.blogspot.com/2014/01/fear-2-project-origin.html
// | | \-+-------------------------------------------------------------------------
// | | | Download: https://s3.amazonaws.com/eqznew/fear2/shaderoverride.zip
// | | | -> shaderoverride/vertexshaders/C7560C0A.txt
// | | \-------------------------------------------------------------------------
//HUD A
// Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656
//
// Parameters:
//
// row_major float4x4 k_mGFxTransform;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// k_mGFxTransform c0 2
//
//
// Default values:
//
// k_mGFxTransform
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
//

vs_3_0
def c200, 0.30, 0, 0.0625, 0.0
def c220, 0.30, 0, 0.0625, 1
dcl_2d s0
dcl_position o10
dcl_texcoord o0.xy
dcl_color o8
dcl_position v0
dcl_texcoord v1
dcl_color v2
dp4 r3.x, v0, c0
dp4 r3.y, v0, c1
mov r3.zw, v0
texldl r1, c220.z, s0
if_eq r3.w, c220.w
mul r1.x, r1.x, -c220.x
add r3.x, r3.x, -r1.x
endif
mov o10, r3
mov o0.xy, v1
mov o8, v2

// approximately 5 instruction slots used

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/22/2015 05:15 AM   
I tried those CRCs - no difference. Using the included DX9settings.ini file makes the CRC files work though (with both the included CRC files and my old CRC files). So, the shaders finally show up in the game. But, now I don't know how to properly disable them. I tried following this guide: [url]http://wiki.bo3b.net/index.php?title=Lesson_2_-_disable_effect[/url] The guide says to add a line like this to the shader file: mov oC0.xyzw, c1.wwww But, that doesn't have any effect. That guide doesn't provide before / after code comparisons, so I don't have a clue what would work. Could someone create an example of how to properly disable a shader with one of the above CRC files?
I tried those CRCs - no difference. Using the included DX9settings.ini file makes the CRC files work though (with both the included CRC files and my old CRC files).

So, the shaders finally show up in the game. But, now I don't know how to properly disable them. I tried following this guide:

http://wiki.bo3b.net/index.php?title=Lesson_2_-_disable_effect

The guide says to add a line like this to the shader file:
mov oC0.xyzw, c1.wwww

But, that doesn't have any effect. That guide doesn't provide before / after code comparisons, so I don't have a clue what would work.

Could someone create an example of how to properly disable a shader with one of the above CRC files?

Posted 03/22/2015 06:56 AM   
[quote="hudfreegamer"]Using the included DX9settings.ini file makes the CRC files work though (with both the included CRC files and my old CRC files).[/quote]Curious. I wonder if it was the OverrideMethod=2 that did the trick? [quote]The guide says to add a line like this to the shader file: mov oC0.xyzw, c1.wwww[/quote]oC0 is for pixel shaders - since this is a vertex shader you need to use whichever output register corresponds to the position - in this case it's o10. Here's an example - this is the shader you originally posted (I figured that would be a bit clearer than showing one with a depth adjustment as well): [code] vs_3_0 dcl_position o10 dcl_texcoord o0.xy dcl_color o8 dcl_color1 o9 dcl_position v0 dcl_color v1 dcl_color1 v2 def c220, 0, 1, 0.0625, 0.5 // New (only using the first value for now) dp4 o10.x, v0, c0 dp4 o10.y, v0, c1 dp4 o0.x, v0, c2 dp4 o0.y, v0, c3 mov o10.zw, v0 mov o8, v1.zyxw mov o9, v2.zyxw // Disable output position: mov o10.xyzw, c220.xxxx [/code] Then you should be able to work through Bo3b's lesson to add a key binding to toggle that on and off.
hudfreegamer said:Using the included DX9settings.ini file makes the CRC files work though (with both the included CRC files and my old CRC files).
Curious. I wonder if it was the OverrideMethod=2 that did the trick?

The guide says to add a line like this to the shader file:
mov oC0.xyzw, c1.wwww
oC0 is for pixel shaders - since this is a vertex shader you need to use whichever output register corresponds to the position - in this case it's o10. Here's an example - this is the shader you originally posted (I figured that would be a bit clearer than showing one with a depth adjustment as well):

vs_3_0
dcl_position o10
dcl_texcoord o0.xy
dcl_color o8
dcl_color1 o9
dcl_position v0
dcl_color v1
dcl_color1 v2

def c220, 0, 1, 0.0625, 0.5 // New (only using the first value for now)

dp4 o10.x, v0, c0
dp4 o10.y, v0, c1
dp4 o0.x, v0, c2
dp4 o0.y, v0, c3
mov o10.zw, v0
mov o8, v1.zyxw
mov o9, v2.zyxw

// Disable output position:
mov o10.xyzw, c220.xxxx


Then you should be able to work through Bo3b's lesson to add a key binding to toggle that on and off.

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/22/2015 08:05 AM   
Yes, I think it was the OverrideMethod=2 that did it. Good news, mov o10.xyzw, c220.xxxx worked to disable the vertex shader. I've been trying to figure out how to toggle the shader on/off all day without luck. My dx9settings.ini file has: [code]General] SkipSetScissorRect = true OverrideMethod = 2 UseRenderedShaders=true DumpAll=false DefVSConst1 = 220 DefPSConst1 = 220 PresetsKeysList = 1; // Type=1 is toggle, Type=2 is momentary. [KEY1] Key = 48 // 0 (zero key) Presets = 1;2; Type = 1 [PRES1] Const1 = 0x3f800000 [PRES2] Const1 = 0x00000000 UseByDef=True[/code] I've been experimenting with two examples I found that are supposed to let me toggle an effect on/off with the 0 (zero) key. Toggle does not work though, they just turn the effect off. // this line same in both def c200, 0, 1, 0.0625, 0 // x=0 for comparison to Const1 1. Bo3b's example, modified with correct vertex shader reference. [code]mov r30.x, c220.x if_eq r30.x, c200.x mov o10.xyzw, c200.xxxx endif[/code] 2. Another example with else statement. [code] mov r30.x, c220.x if_eq r30.x, c200.x mov r30, c200.xxxx // disable else mov r30, v0 // enable endif[/code] ----- I tried lots of variations. Here's an example with comments. Am I understanding what's going on?: [code]// enable - disable hud mov r30.x, c220.x // set temporary r30.x register to 0 if_eq r30.x, c200.x // if r30.x value is same as c200.x mov o10.xyzw, c200.xxxx // then disable hud else mov r30.x, v0 // set r30.x to v0 default - v0 another name for o10 endif [/code] Is any of that correct? This feels a lot like assembly. I'm a little rusty though. I only took an hour long class about programming in assembly 13 years ago.
Yes, I think it was the OverrideMethod=2 that did it.

Good news, mov o10.xyzw, c220.xxxx worked to disable the vertex shader.

I've been trying to figure out how to toggle the shader on/off all day without luck.

My dx9settings.ini file has:
General]
SkipSetScissorRect = true
OverrideMethod = 2

UseRenderedShaders=true
DumpAll=false

DefVSConst1 = 220
DefPSConst1 = 220

PresetsKeysList = 1;


// Type=1 is toggle, Type=2 is momentary.
[KEY1]
Key = 48 // 0 (zero key)
Presets = 1;2;
Type = 1

[PRES1]
Const1 = 0x3f800000

[PRES2]
Const1 = 0x00000000
UseByDef=True



I've been experimenting with two examples I found that are supposed to let me toggle an effect on/off with the 0 (zero) key. Toggle does not work though, they just turn the effect off.

// this line same in both
def c200, 0, 1, 0.0625, 0 // x=0 for comparison to Const1

1. Bo3b's example, modified with correct vertex shader reference.
mov r30.x, c220.x
if_eq r30.x, c200.x
mov o10.xyzw, c200.xxxx
endif



2. Another example with else statement.
mov r30.x, c220.x
if_eq r30.x, c200.x
mov r30, c200.xxxx // disable
else
mov r30, v0 // enable
endif



-----
I tried lots of variations. Here's an example with comments. Am I understanding what's going on?:
// enable - disable hud
mov r30.x, c220.x // set temporary r30.x register to 0
if_eq r30.x, c200.x // if r30.x value is same as c200.x
mov o10.xyzw, c200.xxxx // then disable hud
else
mov r30.x, v0 // set r30.x to v0 default - v0 another name for o10
endif



Is any of that correct? This feels a lot like assembly. I'm a little rusty though. I only took an hour long class about programming in assembly 13 years ago.

Posted 03/22/2015 10:15 PM   
Could be a couple of things going on there. First off, please post your whole shader and dx9settings.ini files, snippets are typically not enough. For your .ini file there- I'd remove the comment from any lines in the file. HelixMod does not support comments after commands, comments must be on lines by themselves, otherwise you get inscrutable failures. [url]http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#Gotchas[/url] Comments are OK inline in the ASM file itself. And yes, it's assembly. GPU assembly, but definitely low level. For reference, 3Dmigoto only uses HLSL which is like C. For the last part there though, it looks to me like you are confusing v0 and o10. Even though both have a dcl_position semantic, one is for input, and one is for output. So your last line of 'mov r30.x, v0' is questionable because of your comment that 'v0 another name for o10'. Depends on the rest of your code. You have the right idea for the comparisons and using the constants, and passing in constants from dx9settings.
Could be a couple of things going on there.

First off, please post your whole shader and dx9settings.ini files, snippets are typically not enough.

For your .ini file there- I'd remove the comment from any lines in the file. HelixMod does not support comments after commands, comments must be on lines by themselves, otherwise you get inscrutable failures.

http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#Gotchas


Comments are OK inline in the ASM file itself. And yes, it's assembly. GPU assembly, but definitely low level. For reference, 3Dmigoto only uses HLSL which is like C.

For the last part there though, it looks to me like you are confusing v0 and o10. Even though both have a dcl_position semantic, one is for input, and one is for output.

So your last line of 'mov r30.x, v0' is questionable because of your comment that 'v0 another name for o10'.

Depends on the rest of your code.


You have the right idea for the comparisons and using the constants, and passing in constants from dx9settings.

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/22/2015 11:59 PM   
After a week of trying to figure this out, it's time to admit that I don't know what I'm doing. I really need a simple working example of how to toggle an effect. Could someone edit this shader code and dx9settings.ini file and show me how to toggle the shader on / off? Then I can use that as a jumping off point. Here's the unedited shader file (I just added the game and crc comment at the top): [code]// // Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656 // Game - Fear 2 // CRC of Vertex Shader - 0B3F4AB7.txt // // Parameters: // // row_major float4x4 k_mGFxTransform; // float4 k_vGFxTexGen1x; // float4 k_vGFxTexGen1y; // // // Registers: // // Name Reg Size // --------------- ----- ---- // k_mGFxTransform c0 2 // k_vGFxTexGen1x c2 1 // k_vGFxTexGen1y c3 1 // // // Default values: // // k_mGFxTransform // c0 = { 0, 0, 0, 0 }; // c1 = { 0, 0, 0, 0 }; // // k_vGFxTexGen1x // c2 = { 0, 0, 0, 0 }; // // k_vGFxTexGen1y // c3 = { 0, 0, 0, 0 }; // vs_3_0 dcl_position o10 dcl_texcoord o0.xy dcl_color o8 dcl_color1 o9 dcl_position v0 dcl_color v1 dcl_color1 v2 dp4 o10.x, v0, c0 dp4 o10.y, v0, c1 dp4 o0.x, v0, c2 dp4 o0.y, v0, c3 mov o10.zw, v0 mov o8, v1.zyxw mov o9, v2.zyxw // approximately 7 instruction slots used [/code] And here's my complete dx9settings.ini: [code] [General] SkipSetScissorRect = true OverrideMethod = 2 UseRenderedShaders = true DumpAll = false DefVSConst1 = 220 DefPSConst1 = 220 PresetsKeysList = 1; [KEY1] Key = 48 Presets = 1;2; Type = 1 [PRES1] // 0.0 in hex Const1 = 0x00000000 [PRES2] // 1.0 in hex Const1 = 0x3f800000[/code] I'm guessing the disable command DarkStarSword mentioned will need to be used: mov o10.xyzw, c220.xxxx _
After a week of trying to figure this out, it's time to admit that I don't know what I'm doing. I really need a simple working example of how to toggle an effect.


Could someone edit this shader code and dx9settings.ini file and show me how to toggle the shader on / off? Then I can use that as a jumping off point.

Here's the unedited shader file (I just added the game and crc comment at the top):
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656
// Game - Fear 2
// CRC of Vertex Shader - 0B3F4AB7.txt
//
// Parameters:
//
// row_major float4x4 k_mGFxTransform;
// float4 k_vGFxTexGen1x;
// float4 k_vGFxTexGen1y;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// k_mGFxTransform c0 2
// k_vGFxTexGen1x c2 1
// k_vGFxTexGen1y c3 1
//
//
// Default values:
//
// k_mGFxTransform
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
//
// k_vGFxTexGen1x
// c2 = { 0, 0, 0, 0 };
//
// k_vGFxTexGen1y
// c3 = { 0, 0, 0, 0 };
//

vs_3_0
dcl_position o10
dcl_texcoord o0.xy
dcl_color o8
dcl_color1 o9
dcl_position v0
dcl_color v1
dcl_color1 v2

dp4 o10.x, v0, c0
dp4 o10.y, v0, c1
dp4 o0.x, v0, c2
dp4 o0.y, v0, c3
mov o10.zw, v0
mov o8, v1.zyxw
mov o9, v2.zyxw


// approximately 7 instruction slots used



And here's my complete dx9settings.ini:
[General]
SkipSetScissorRect = true
OverrideMethod = 2
UseRenderedShaders = true
DumpAll = false

DefVSConst1 = 220
DefPSConst1 = 220
PresetsKeysList = 1;


[KEY1]
Key = 48
Presets = 1;2;
Type = 1


[PRES1]
// 0.0 in hex
Const1 = 0x00000000

[PRES2]
// 1.0 in hex
Const1 = 0x3f800000



I'm guessing the disable command DarkStarSword mentioned will need to be used:
mov o10.xyzw, c220.xxxx


_

Posted 03/23/2015 03:39 AM   
Keep the dx9settings.ini file the same & try this code: [code]// // Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656 // // Parameters: // // row_major float4x4 k_mGFxTransform; // float4 k_vGFxTexGen1x; // float4 k_vGFxTexGen1y; // // // Registers: // // Name Reg Size // --------------- ----- ---- // k_mGFxTransform c0 2 // k_vGFxTexGen1x c2 1 // k_vGFxTexGen1y c3 1 // // // Default values: // // k_mGFxTransform // c0 = { 0, 0, 0, 0 }; // c1 = { 0, 0, 0, 0 }; // // k_vGFxTexGen1x // c2 = { 0, 0, 0, 0 }; // // k_vGFxTexGen1y // c3 = { 0, 0, 0, 0 }; // vs_3_0 def c247, 1, 0, 0.0625, 0 //new line dcl_position o10 dcl_texcoord o0.xy dcl_color o8 dcl_color1 o9 dcl_position v0 dcl_color v1 dcl_color1 v2 dp4 r10.x, v0, c0 // o10 changed to r10 dp4 r10.y, v0, c1 // o10 changed to r10 dp4 o0.x, v0, c2 dp4 o0.y, v0, c3 mov r10.zw, v0 // o10 changed to r10 mov o8, v1.zyxw mov o9, v2.zyxw mov r14.x, c220.x // move the value of Const1 (in Dx9settings.ini) into r14.x if_eq r14.x, c247.x // if Const1 equals 1 mov r10.xyzw, c247.wwww // disable shader endif mov o10, r10 // approximately 7 instruction slots used [/code] Let me know if this works or not.
Keep the dx9settings.ini file the same & try this code:

//
// Generated by Microsoft (R) HLSL Shader Compiler 9.24.950.2656
//
// Parameters:
//
// row_major float4x4 k_mGFxTransform;
// float4 k_vGFxTexGen1x;
// float4 k_vGFxTexGen1y;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// k_mGFxTransform c0 2
// k_vGFxTexGen1x c2 1
// k_vGFxTexGen1y c3 1
//
//
// Default values:
//
// k_mGFxTransform
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
//
// k_vGFxTexGen1x
// c2 = { 0, 0, 0, 0 };
//
// k_vGFxTexGen1y
// c3 = { 0, 0, 0, 0 };
//

vs_3_0
def c247, 1, 0, 0.0625, 0 //new line
dcl_position o10
dcl_texcoord o0.xy
dcl_color o8
dcl_color1 o9
dcl_position v0
dcl_color v1
dcl_color1 v2

dp4 r10.x, v0, c0 // o10 changed to r10
dp4 r10.y, v0, c1 // o10 changed to r10
dp4 o0.x, v0, c2
dp4 o0.y, v0, c3
mov r10.zw, v0 // o10 changed to r10
mov o8, v1.zyxw
mov o9, v2.zyxw

mov r14.x, c220.x // move the value of Const1 (in Dx9settings.ini) into r14.x
if_eq r14.x, c247.x // if Const1 equals 1
mov r10.xyzw, c247.wwww // disable shader
endif
mov o10, r10

// approximately 7 instruction slots used


Let me know if this works or not.

Dual boot Win 7 x64 & Win 10 (1809) | Geforce Drivers 417.35

Posted 03/23/2015 04:00 AM   
Has anyone come across issues with SkipSetScissorRect=true? It seems an update to Life Is Strange has broken fog (e.g. in the school hallway in chapter 1) with this enabled, but I need it enabled to fix clipping on decals :-/ When I say broken it looks like it is using scissor clipping - it looks like it is trying to set it around something, but it flickers to different places around the screen as the camera moves. I'll probably just have to disable the effect...
Has anyone come across issues with SkipSetScissorRect=true?

It seems an update to Life Is Strange has broken fog (e.g. in the school hallway in chapter 1) with this enabled, but I need it enabled to fix clipping on decals :-/

When I say broken it looks like it is using scissor clipping - it looks like it is trying to set it around something, but it flickers to different places around the screen as the camera moves. I'll probably just have to disable the effect...

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/24/2015 11:04 AM   
  163 / 167    
Scroll To Top