I am currently experimenting with fix 1.4 and replacing content of the ini file that differs from the 1.3 version with the old content, or removing stuff that has been added. So far it seems that when I remove all sections starting with [ShaderRegexDecalPS*, 3D will be somewhat broken (but better than without fix), and no crash occurs.
Will try narrowing that down further.
Edit:
Removing all [ShaderRegexDecalPS.*} sections and leaving only this one will crash the game:
[ShaderRegexDecalPS]
shader_model = ps_5_0
temps = stereo tmp1 tmp2
ps-cb3 = ResourceCommonMatrices
post ps-cb3 = null
x1 = res_width
Since I do not understand what I am doing here (I only do a brute force approach), maybe that helps some of you 3D gurus?
Edit 2:
OK, I do not know what shader_models there are, but I experimented with setting that option to
shader_model = ps_4_0 and shader_model = ps_4_5
There is no crash with either 4_0 and 4_5. 3D wise, all lighting and shadows seem correct, but there is some white painting at the first building that you reach, which is of-depth and will vanish/flicker depending on the distance and angle you are watching it. Apart from that, it seems OK and is definitely better than 2D or some 3D games with graphical problems that I played before.
I think there was one crash during game loading with ps_4_0, but not in-game. I will try the game with that setting now and see how it plays out...
Note: the only change I am applying now is setting shader_model = ps_4_0. Everything else (game and fix) are the most current versions.
I am currently experimenting with fix 1.4 and replacing content of the ini file that differs from the 1.3 version with the old content, or removing stuff that has been added. So far it seems that when I remove all sections starting with [ShaderRegexDecalPS*, 3D will be somewhat broken (but better than without fix), and no crash occurs.
Will try narrowing that down further.
Edit:
Removing all [ShaderRegexDecalPS.*} sections and leaving only this one will crash the game:
[ShaderRegexDecalPS]
shader_model = ps_5_0
temps = stereo tmp1 tmp2
ps-cb3 = ResourceCommonMatrices
post ps-cb3 = null
x1 = res_width
Since I do not understand what I am doing here (I only do a brute force approach), maybe that helps some of you 3D gurus?
Edit 2:
OK, I do not know what shader_models there are, but I experimented with setting that option to
shader_model = ps_4_0 and shader_model = ps_4_5
There is no crash with either 4_0 and 4_5. 3D wise, all lighting and shadows seem correct, but there is some white painting at the first building that you reach, which is of-depth and will vanish/flicker depending on the distance and angle you are watching it. Apart from that, it seems OK and is definitely better than 2D or some 3D games with graphical problems that I played before.
I think there was one crash during game loading with ps_4_0, but not in-game. I will try the game with that setting now and see how it plays out...
Note: the only change I am applying now is setting shader_model = ps_4_0. Everything else (game and fix) are the most current versions.
@skr68
That was the second step in testing to found the issue (delete ShaderRegex's in the d3dx.ini)....but i think you already found it.
I was betting for the [ShaderRegexPointLightCS] have an issue...Compute Shaders are very "special" with all those loops and stuff.
Can you test using this in the [ShaderRegexDecalPS], include both models:
[code]shader_model = ps_4_0 ps_5_0[/code]
@skr68
That was the second step in testing to found the issue (delete ShaderRegex's in the d3dx.ini)....but i think you already found it.
I was betting for the [ShaderRegexPointLightCS] have an issue...Compute Shaders are very "special" with all those loops and stuff.
Can you test using this in the [ShaderRegexDecalPS], include both models:
So this is the result of all of this:
Most current game version 1.0.2955.0 plus most current 3D fix 1.4 with modified d3dx.ini (shader_model = ps_4_0 instead of ps_5_0) is working for two hours of gameplay without a single crash.
Only issue is that some textures (painting on walls, blood, dirt on ground etc.) are a bit off and flickering. Not perfect, but will do for now.
Thanks for the support, guys! And the fix of course ;)
Edit: DHR, you are doing this on purpose, right? Giving the next tip just a minute before I come up with the result... I will try your suggestion next ;)
Most current game version 1.0.2955.0 plus most current 3D fix 1.4 with modified d3dx.ini (shader_model = ps_4_0 instead of ps_5_0) is working for two hours of gameplay without a single crash.
Only issue is that some textures (painting on walls, blood, dirt on ground etc.) are a bit off and flickering. Not perfect, but will do for now.
Thanks for the support, guys! And the fix of course ;)
Edit: DHR, you are doing this on purpose, right? Giving the next tip just a minute before I come up with the result... I will try your suggestion next ;)
@skr68
I think we posted in the same time....test my suggestion, may work for the flickering in decals.
*EDIT: yep :) on purpose...i was waiting you publish the post....jejeje
When you add ps_4_0, you are skipping all the ShaderRegex for decals, because all PS are ps_5, so you don't have a crash.
I think the Resourse is a bit wrong, can you replace this line in the [ShaderRegexDecalPS] section:
(Don't delete the ps_5_0)
[code]ps-cb3 = ResourceCommonMatrices[/code]
for this one:
[code]ps-cb3 = copy ResourceCommonMatrices[/code]
skr68 (and of course everyone who tries to help) thank you so much for your efforts trying to solve this!
Could you possibly upload your modified ini please?
I'd rather have flickering decals than play this game in 2D.
Just open the ini file and replace the line 887 in section [ShaderRegexDecalPS]
shader_model = ps_5_0
with
shader_model = ps_4_0
It's just one character changed, no need to upload it, really.
Ah ok, I thought you modified other things as well.
I just played around a bitand honestly it isn't that bad. Sure as hell it is still better than playing the game in 2D.
If this is the best solution I'm totally fine! (but lets hope theres a 100% workaround eventually hehe)
thanks again!
Ah ok, I thought you modified other things as well.
I just played around a bitand honestly it isn't that bad. Sure as hell it is still better than playing the game in 2D.
If this is the best solution I'm totally fine! (but lets hope theres a 100% workaround eventually hehe)
@skr68
Ok, i saw you edited post and still crash...mmmh
without testing directly is kind of difficult to track down....but clearly that [ShaderRegexDecalPS] is the one responsable for the crash.
using "shader_model = ps_4_0" is the same to disable that ShaderRegex...so no crash...same as disable.
Maybe mx-2 can take a deep look at that ShaderRegex to see if can be improved.
Only for testing purpose and to locate the origin of the issue, can you replace the entire [ShaderRegexDecalPS] for this one:
This will only search and replace the same....not put any fixing code, so decals will be broken. i'm trying to isolate the issue.
[code][ShaderRegexDecalPS]
shader_model = ps_5_0
temps = stereo tmp1 tmp2
ps-cb3 = ResourceCommonMatrices
post ps-cb3 = null
x1 = res_width
[ShaderRegexDecalPS.Pattern]
(?s)
(?P<part1>
ld_indexable\(texture2d\)\(float,float,float,float\)\s
(?P<reg_depth>r\d+)\.(?P<reg_depth_sw>[xyzw]), r\d+\.[xyzw]{4}, t0\.[xyzw]{4}\n
imul null, r\d+\.[xyzw], v1\.x, l\(10\)\n
div r\d+\.z, l\(1\.000000, 1\.000000, 1\.000000, 1\.000000\), r\d+\.[xyzw]\n
mov (?<reg_pos>r\d+)\.xy, v2\.xyxx\n
mov r\d+\.w, l\(1\.000000\)\n
)
(?P<part2>
dp4 r\d+\.x, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?4\]\.xyzw\n
dp4 r\d+\.y, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?5\]\.xyzw\n
dp4 r\d+\.z, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?6\]\.xyzw\n
dp4 r\d+\.[xyzw], r\d+\.xyzw, cb1\[r1\.y\s?\+\s?7\]\.xyzw\n
.*?
discard_nz r\d+\.[xyzw]\n
)
(?P<part3>
.*?
dp4 r\d+\.x, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?4\]\.xyzw\n
dp4 r\d+\.y, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?5\]\.xyzw\n
dp4 r\d+\.[xyzw], r\d+\.xyzw, cb1\[r1\.y\s?\+\s?7\]\.xyzw\n
div r\d+\.[xyzw]{2}, r\d+\.[xyzw]{4}, r\d+\.[xyzw]{4}\n
add r\d+\.[xyzw]{2,4}, -r\d+\.[xyzw]{4}, r\d+\.[xyzw]{4}\n
)
[ShaderRegexDecalPS.Pattern.Replace]
${part1}
${part2}
${part3}
[ShaderRegexDecalPS.InsertDeclarations]
dcl_constantbuffer cb3[47], immediateIndexed
dcl_resource_texture1d (float,float,float,float) t120
dcl_resource_texture2d (float,float,float,float) t125[/code]
@skr68
Ok, i saw you edited post and still crash...mmmh
without testing directly is kind of difficult to track down....but clearly that [ShaderRegexDecalPS] is the one responsable for the crash.
using "shader_model = ps_4_0" is the same to disable that ShaderRegex...so no crash...same as disable.
Maybe mx-2 can take a deep look at that ShaderRegex to see if can be improved.
Only for testing purpose and to locate the origin of the issue, can you replace the entire [ShaderRegexDecalPS] for this one:
This will only search and replace the same....not put any fixing code, so decals will be broken. i'm trying to isolate the issue.
[ShaderRegexDecalPS]
shader_model = ps_5_0
temps = stereo tmp1 tmp2
ps-cb3 = ResourceCommonMatrices
post ps-cb3 = null
x1 = res_width
Those changes are only for isolate the issue....that's strange that crashes...can you replace with this one.
BTW, you new to replace all the [ShaderRegexDecalPS.*], there are 4 of them...if works now, maybe there is something with that cb3 (already used by the shader or the resource used)
[code][ShaderRegexDecalPS]
shader_model = ps_5_0
temps = stereo tmp1 tmp2
[ShaderRegexDecalPS.Pattern]
(?s)
(?P<part1>
ld_indexable\(texture2d\)\(float,float,float,float\)\s
(?P<reg_depth>r\d+)\.(?P<reg_depth_sw>[xyzw]), r\d+\.[xyzw]{4}, t0\.[xyzw]{4}\n
imul null, r\d+\.[xyzw], v1\.x, l\(10\)\n
div r\d+\.z, l\(1\.000000, 1\.000000, 1\.000000, 1\.000000\), r\d+\.[xyzw]\n
mov (?<reg_pos>r\d+)\.xy, v2\.xyxx\n
mov r\d+\.w, l\(1\.000000\)\n
)
(?P<part2>
dp4 r\d+\.x, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?4\]\.xyzw\n
dp4 r\d+\.y, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?5\]\.xyzw\n
dp4 r\d+\.z, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?6\]\.xyzw\n
dp4 r\d+\.[xyzw], r\d+\.xyzw, cb1\[r1\.y\s?\+\s?7\]\.xyzw\n
.*?
discard_nz r\d+\.[xyzw]\n
)
(?P<part3>
.*?
dp4 r\d+\.x, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?4\]\.xyzw\n
dp4 r\d+\.y, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?5\]\.xyzw\n
dp4 r\d+\.[xyzw], r\d+\.xyzw, cb1\[r1\.y\s?\+\s?7\]\.xyzw\n
div r\d+\.[xyzw]{2}, r\d+\.[xyzw]{4}, r\d+\.[xyzw]{4}\n
add r\d+\.[xyzw]{2,4}, -r\d+\.[xyzw]{4}, r\d+\.[xyzw]{4}\n
)
[ShaderRegexDecalPS.Pattern.Replace]
${part1}
${part2}
${part3}
[ShaderRegexDecalPS.InsertDeclarations]
dcl_resource_texture2d (float,float,float,float) t125[/code]
Those changes are only for isolate the issue....that's strange that crashes...can you replace with this one.
BTW, you new to replace all the [ShaderRegexDecalPS.*], there are 4 of them...if works now, maybe there is something with that cb3 (already used by the shader or the resource used)
[ShaderRegexDecalPS]
shader_model = ps_5_0
temps = stereo tmp1 tmp2
Yes sure, I replaced all those sections.
Now I replaced it with your new coding and played for an hour -> no crash! But still those textures slightly off.
That ShaderRegex was only to isolate the issue, not fixing Decals....but since now you don't have a crash i can say that the crash is related to the cb3 and/or Resource used. So we need mx-2 take a look.
This is the last test, can you use this sets of ShaderRegex for Decals. I made a little tweak in the ShaderRegex:
[code][ShaderRegexDecalPS]
shader_model = ps_5_0
temps = stereo tmp1 tmp2 temp3
ps-cb3 = ResourceCommonMatrices
post ps-cb3 = null
x1 = res_width
[ShaderRegexDecalPS.Pattern]
(?s)
(?P<part1>
ld_indexable\(texture2d\)\(float,float,float,float\)\s
(?P<reg_depth>r\d+)\.(?P<reg_depth_sw>[xyzw]), r\d+\.[xyzw]{4}, t0\.[xyzw]{4}\n
imul null, r\d+\.[xyzw], v1\.x, l\(10\)\n
div r\d+\.z, l\(1\.000000, 1\.000000, 1\.000000, 1\.000000\), r\d+\.[xyzw]\n
mov (?<reg_pos>r\d+)\.xy, v2\.xyxx\n
mov r\d+\.w, l\(1\.000000\)\n
)
(?P<part2>
dp4 r\d+\.x, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?4\]\.xyzw\n
dp4 r\d+\.y, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?5\]\.xyzw\n
dp4 r\d+\.z, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?6\]\.xyzw\n
dp4 r\d+\.[xyzw], r\d+\.xyzw, cb1\[r1\.y\s?\+\s?7\]\.xyzw\n
.*?
discard_nz r\d+\.[xyzw]\n
)
(?P<part3>
.*?
dp4 r\d+\.x, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?4\]\.xyzw\n
dp4 r\d+\.y, r\d+\.xyzw, cb1\[r1\.y\s?\+\s?5\]\.xyzw\n
dp4 r\d+\.[xyzw], r\d+\.xyzw, cb1\[r1\.y\s?\+\s?7\]\.xyzw\n
div r\d+\.[xyzw]{2}, r\d+\.[xyzw]{4}, r\d+\.[xyzw]{4}\n
add r\d+\.[xyzw]{2,4}, -r\d+\.[xyzw]{4}, r\d+\.[xyzw]{4}\n
)
[ShaderRegexDecalPS.Pattern.Replace]
${part1}\n
ld_indexable(texture2d)(float,float,float,float) ${stereo}.xyzw, l(0, 0, 0, 0), t125.xyzw\n
ld_indexable(texture1d)(float,float,float,float) ${temp3}.z, l(1, 0, 0, 0), t120.zwxy\n
; Fix clipping, save unfixed r2 for use later
; pos.x -= stereo.x * (1 - stereo.y / m_fFar / depth) * res_x/2;
mov ${tmp1}.xyzw, ${reg_pos}.xyzw\n
div ${stereo}.w, ${stereo}.y, cb3[34].w\n
div ${stereo}.w, ${stereo}.w, ${reg_depth}.${reg_depth_sw}\n
add ${stereo}.w, l(1.0), -${stereo}.w\n
mul ${stereo}.w, ${stereo}.w, ${stereo}.x\n
mul ${stereo}.w, ${stereo}.w, ${temp3}.z\n
mul ${stereo}.w, ${stereo}.w, l(0.5)\n
add ${reg_pos}.x, ${reg_pos}.x, -${stereo}.w\n
\n${part2}\n
; Calculate transformed unfixed r2.
dp4 ${tmp2}.x, ${tmp1}.xyzw, cb1[r1.y+4].xyzw\n
dp4 ${tmp2}.y, ${tmp1}.xyzw, cb1[r1.y+5].xyzw\n
dp4 ${tmp2}.z, ${tmp1}.xyzw, cb1[r1.y+6].xyzw\n
dp4 ${tmp2}.w, ${tmp1}.xyzw, cb1[r1.y+7].xyzw\n
div ${tmp2}.xyzw, ${tmp2}.xyzw, ${tmp2}.wwww\n
; Fixed transformed r2 is required later to fix texcoord.
mov ${tmp1}.xyzw, ${reg_pos}.xyzw\n
; Unfix transformed r2 to avoid texture blur in code below.
mov ${reg_pos}.xyz, ${tmp2}.xyz\n
\n${part3}\n
; Adjust texcoord
mov ${reg_pos}.xy, ${tmp1}.xy\n\n
[ShaderRegexDecalPS.InsertDeclarations]
dcl_constantbuffer cb3[47], immediateIndexed
dcl_resource_texture1d (float,float,float,float) t120
dcl_resource_texture2d (float,float,float,float) t125[/code]
@mx-2:
if you look the test in the previous post, you will see that [ShaderRegexDecalPS] is the one causing the crashes...so there is something there that is causing it.
Make sure that cb3 is not used by the shader, you need to use Frame Analysis. Probably cb3 is not declared in the shader, but is used anyways....with Frame Analysis you will see that. recommended to use cb13 (in shadows ShaderRegex the Resource is send to cb1, use cb13 also there)
That ShaderRegex was only to isolate the issue, not fixing Decals....but since now you don't have a crash i can say that the crash is related to the cb3 and/or Resource used. So we need mx-2 take a look.
This is the last test, can you use this sets of ShaderRegex for Decals. I made a little tweak in the ShaderRegex:
[ShaderRegexDecalPS]
shader_model = ps_5_0
temps = stereo tmp1 tmp2 temp3
ps-cb3 = ResourceCommonMatrices
post ps-cb3 = null
x1 = res_width
@mx-2:
if you look the test in the previous post, you will see that [ShaderRegexDecalPS] is the one causing the crashes...so there is something there that is causing it.
Make sure that cb3 is not used by the shader, you need to use Frame Analysis. Probably cb3 is not declared in the shader, but is used anyways....with Frame Analysis you will see that. recommended to use cb13 (in shadows ShaderRegex the Resource is send to cb1, use cb13 also there)
Will try narrowing that down further.
Edit:
Removing all [ShaderRegexDecalPS.*} sections and leaving only this one will crash the game:
[ShaderRegexDecalPS]
shader_model = ps_5_0
temps = stereo tmp1 tmp2
ps-cb3 = ResourceCommonMatrices
post ps-cb3 = null
x1 = res_width
Since I do not understand what I am doing here (I only do a brute force approach), maybe that helps some of you 3D gurus?
Edit 2:
OK, I do not know what shader_models there are, but I experimented with setting that option to
shader_model = ps_4_0 and shader_model = ps_4_5
There is no crash with either 4_0 and 4_5. 3D wise, all lighting and shadows seem correct, but there is some white painting at the first building that you reach, which is of-depth and will vanish/flicker depending on the distance and angle you are watching it. Apart from that, it seems OK and is definitely better than 2D or some 3D games with graphical problems that I played before.
I think there was one crash during game loading with ps_4_0, but not in-game. I will try the game with that setting now and see how it plays out...
Note: the only change I am applying now is setting shader_model = ps_4_0. Everything else (game and fix) are the most current versions.
That was the second step in testing to found the issue (delete ShaderRegex's in the d3dx.ini)....but i think you already found it.
I was betting for the [ShaderRegexPointLightCS] have an issue...Compute Shaders are very "special" with all those loops and stuff.
Can you test using this in the [ShaderRegexDecalPS], include both models:
MY WEB
Helix Mod - Making 3D Better
My 3D Screenshot Gallery
Like my fixes? you can donate to Paypal: dhr.donation@gmail.com
Most current game version 1.0.2955.0 plus most current 3D fix 1.4 with modified d3dx.ini (shader_model = ps_4_0 instead of ps_5_0) is working for two hours of gameplay without a single crash.
Only issue is that some textures (painting on walls, blood, dirt on ground etc.) are a bit off and flickering. Not perfect, but will do for now.
Thanks for the support, guys! And the fix of course ;)
Edit: DHR, you are doing this on purpose, right? Giving the next tip just a minute before I come up with the result... I will try your suggestion next ;)
I think we posted in the same time....test my suggestion, may work for the flickering in decals.
*EDIT: yep :) on purpose...i was waiting you publish the post....jejeje
MY WEB
Helix Mod - Making 3D Better
My 3D Screenshot Gallery
Like my fixes? you can donate to Paypal: dhr.donation@gmail.com
Yes, the flickering is gone. Until crash.
I think the Resourse is a bit wrong, can you replace this line in the [ShaderRegexDecalPS] section:
(Don't delete the ps_5_0)
for this one:
MY WEB
Helix Mod - Making 3D Better
My 3D Screenshot Gallery
Like my fixes? you can donate to Paypal: dhr.donation@gmail.com
shader_model = ps_4_0 ps_5_0
and
ps-cb3 = copy ResourceCommonMatrices
Nope, crash again :(
Could you possibly upload your modified ini please?
I'd rather have flickering decals than play this game in 2D.
shader_model = ps_5_0
with
shader_model = ps_4_0
It's just one character changed, no need to upload it, really.
I just played around a bitand honestly it isn't that bad. Sure as hell it is still better than playing the game in 2D.
If this is the best solution I'm totally fine! (but lets hope theres a 100% workaround eventually hehe)
thanks again!
Ok, i saw you edited post and still crash...mmmh
without testing directly is kind of difficult to track down....but clearly that [ShaderRegexDecalPS] is the one responsable for the crash.
using "shader_model = ps_4_0" is the same to disable that ShaderRegex...so no crash...same as disable.
Maybe mx-2 can take a deep look at that ShaderRegex to see if can be improved.
Only for testing purpose and to locate the origin of the issue, can you replace the entire [ShaderRegexDecalPS] for this one:
This will only search and replace the same....not put any fixing code, so decals will be broken. i'm trying to isolate the issue.
MY WEB
Helix Mod - Making 3D Better
My 3D Screenshot Gallery
Like my fixes? you can donate to Paypal: dhr.donation@gmail.com
BTW, you new to replace all the [ShaderRegexDecalPS.*], there are 4 of them...if works now, maybe there is something with that cb3 (already used by the shader or the resource used)
MY WEB
Helix Mod - Making 3D Better
My 3D Screenshot Gallery
Like my fixes? you can donate to Paypal: dhr.donation@gmail.com
Now I replaced it with your new coding and played for an hour -> no crash! But still those textures slightly off.
This is the last test, can you use this sets of ShaderRegex for Decals. I made a little tweak in the ShaderRegex:
@mx-2:
if you look the test in the previous post, you will see that [ShaderRegexDecalPS] is the one causing the crashes...so there is something there that is causing it.
Make sure that cb3 is not used by the shader, you need to use Frame Analysis. Probably cb3 is not declared in the shader, but is used anyways....with Frame Analysis you will see that. recommended to use cb13 (in shadows ShaderRegex the Resource is send to cb1, use cb13 also there)
MY WEB
Helix Mod - Making 3D Better
My 3D Screenshot Gallery
Like my fixes? you can donate to Paypal: dhr.donation@gmail.com