Fallout 3 GOTY Shaderhacking
  1 / 3    
Here is the (new) Helixmod fix for Fallout3 : - dynamic Crosshair - Water shader fixed - sky depth fixed (moon, sun, stars clouds) - Convergence presets for PIP-boy and VATS [url=https://abload.de/img/fallout3_megaton.jps80pk2.jpg][img]https://abload.de/thumb/fallout3_megaton.jps80pk2.jpg[/img][/url][url=https://abload.de/img/fallout3_vats.jpsk9o02.jpg][img]https://abload.de/thumb/fallout3_vats.jpsk9o02.jpg[/img][/url][url=https://abload.de/img/fallout3_water_bridgebuqll.jpg][img]https://abload.de/thumb/fallout3_water_bridgebuqll.jpg[/img][/url][url=https://abload.de/img/fallout3_water_memoripeoyi.jpg][img]https://abload.de/thumb/fallout3_water_memoripeoyi.jpg[/img][/url] [url=http://www.xup.in/dl,20177765/Fo3_3DVisionFix_v1_2.7z/]Fo3_3DVisionFix_v1_2.7z[/url] Be sure, you updated the game to the latest version (1.7). To get the dynamic crosshair working you need to install and enable a DOF-mod like "PyDOF_FO3"(included) or "DYNAVISION"(FOSE needed!!!). If you load an older savegame, you have to enable DOF in the Pip-boy clothing menu. This is needed to get the DepthMap working all the time. I disabled DOF in the shader so you don't need to care about the unsharpness. Keys: P - Toggles DOF on/off O - Toggles HUD depth TAB - Toggles PIP-Boy Convergence V - set VATS state and Convergence E - unset VATS state and Convergence RMB - unset VATS state but can be used to set a separate Convergence for aiming too (maybe useable for an iron sight mod?) Have some fun :) History: 3DvisionFix v1.0: - dynamic crosshair - convergence presets for PIPboy and VATS - first try to fix the water (some reflections still bad) 3DvisionFix v1.1: - fixed the water - fixed a different water surface in Megaton water processing unit 3DvisionFix v1.2: - converted all modified shaders to VS_3_0/PS_3_0 for better performance (didn't make a difference at all)
Here is the (new) Helixmod fix for Fallout3 :

- dynamic Crosshair
- Water shader fixed
- sky depth fixed (moon, sun, stars clouds)
- Convergence presets for PIP-boy and VATS

ImageImageImageImage

Fo3_3DVisionFix_v1_2.7z

Be sure, you updated the game to the latest version (1.7).

To get the dynamic crosshair working you need to install and enable a DOF-mod like "PyDOF_FO3"(included) or "DYNAVISION"(FOSE needed!!!).
If you load an older savegame, you have to enable DOF in the Pip-boy clothing menu.
This is needed to get the DepthMap working all the time.
I disabled DOF in the shader so you don't need to care about the unsharpness.

Keys:

P - Toggles DOF on/off
O - Toggles HUD depth
TAB - Toggles PIP-Boy Convergence
V - set VATS state and Convergence
E - unset VATS state and Convergence
RMB - unset VATS state but can be used to set a separate Convergence for aiming too (maybe useable for an iron sight mod?)


Have some fun :)


History:
3DvisionFix v1.0:
- dynamic crosshair
- convergence presets for PIPboy and VATS
- first try to fix the water (some reflections still bad)

3DvisionFix v1.1:
- fixed the water
- fixed a different water surface in Megaton water processing unit

3DvisionFix v1.2:
- converted all modified shaders to VS_3_0/PS_3_0 for better performance (didn't make a difference at all)

Desktop-PC

i7 870 @ 3.8GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

#1
Posted 06/04/2017 08:55 AM   
The only things that were fixed were HUD/UI Elements, the Clouds and Auto-Convergence Presets were added... it looks like the CRC changed for the clouds, pretty sure all the other things are working as expected though... Rename 631420C4.txt to B29124B1.txt Also try setting Screen Effects to None, not sure if this is what fixed the LaserSight but the NVIDIA LaserSight was working just fine for me but it fixed/disabled bloom. Disabling Water Refractions in the Options(Launcher) gets rid of the weird/broken edges... I'll try messing with it more later.
The only things that were fixed were HUD/UI Elements, the Clouds and Auto-Convergence Presets were added... it looks like the CRC changed for the clouds, pretty sure all the other things are working as expected though...

Rename 631420C4.txt to B29124B1.txt

Also try setting Screen Effects to None, not sure if this is what fixed the LaserSight but the NVIDIA LaserSight was working just fine for me but it fixed/disabled bloom.

Disabling Water Refractions in the Options(Launcher) gets rid of the weird/broken edges... I'll try messing with it more later.
#2
Posted 06/05/2017 03:21 PM   
ScreenEffects to None doesn't affect LaserSight for me. :( A useable dynamic crosshair would be really nice. But the UI shader is driving me crazy. I thought, I could isolate the crosshair but it seems not possible. :( Yes, WaterReflections break the water. iWaterMultisamples=4 does some diffuse ghosting too, so it's better set to 1 . Clouds-shader is still 631420C4 for me. But Helixmod version messes up colors. It is a vs_3_0 and thats strange. I get dumped a vs_2_0 . I changed it now like you did with 75.0 multiplied. And it works for the clouds. [code] vs_2_0 def c200, 75.0, 0, -100, 0 def c2, 0.0588235296, 0, 1, 0.999899983 dcl_position v0 dcl_texcoord v1 dcl_color v2 dp4 r3.x, c0, v0 dp4 r3.y, c1, v0 mul r0.xyz, v2.y, c5 mad r0.xyz, c4, v2.x, r0 mad oD0.xyz, c6, v2.z, r0 mul oD0.w, v2.w, c4.w dp4 r0.x, c10, v0 add r0.x, r0.x, -c7.z mul r0.x, r0.x, c2.x max r0.x, r0.x, c2.y min oT2.x, r0.x, c2.z dp4 r0.x, c3, v0 mul r3.zw, r0.x, c2.xywz mul r3.xyzw, r3, c200.x mov oPos, r3 add r0.y, v1.y, c12.x mov r0.x, v1.x mov oT0.xy, r0 mov oT1.xy, r0 [/code] Lets see, if I can do this for the stars, the moon and maybe the sun. EDIT: Yes, I did. 631420C4 - Clouds - correction value 75.0 B29124B1 - Nightclouds - correction value 75.0 C62D6DBA - Sun and Moon - correction value 100.0 11C7D824 - Stars - correction value 3000.0 [url=https://abload.de/img/fallout304_99.jpswvowh.jpg][img]https://abload.de/thumb/fallout304_99.jpswvowh.jpg[/img][/url] [url=https://abload.de/img/fallout314_99.jps80pxl.jpg][img]https://abload.de/thumb/fallout314_99.jps80pxl.jpg[/img][/url] So water and crosshair remains. :'(
ScreenEffects to None doesn't affect LaserSight for me. :( A useable dynamic crosshair would be really nice. But the UI shader is driving me crazy. I thought, I could isolate the crosshair but it seems not possible. :(

Yes, WaterReflections break the water. iWaterMultisamples=4 does some diffuse ghosting too, so it's better set to 1 .

Clouds-shader is still 631420C4 for me. But Helixmod version messes up colors. It is a vs_3_0 and thats strange.
I get dumped a vs_2_0 . I changed it now like you did with 75.0 multiplied. And it works for the clouds.
vs_2_0
def c200, 75.0, 0, -100, 0
def c2, 0.0588235296, 0, 1, 0.999899983
dcl_position v0
dcl_texcoord v1
dcl_color v2
dp4 r3.x, c0, v0
dp4 r3.y, c1, v0
mul r0.xyz, v2.y, c5
mad r0.xyz, c4, v2.x, r0
mad oD0.xyz, c6, v2.z, r0
mul oD0.w, v2.w, c4.w
dp4 r0.x, c10, v0
add r0.x, r0.x, -c7.z
mul r0.x, r0.x, c2.x
max r0.x, r0.x, c2.y
min oT2.x, r0.x, c2.z
dp4 r0.x, c3, v0
mul r3.zw, r0.x, c2.xywz
mul r3.xyzw, r3, c200.x
mov oPos, r3
add r0.y, v1.y, c12.x
mov r0.x, v1.x
mov oT0.xy, r0
mov oT1.xy, r0

Lets see, if I can do this for the stars, the moon and maybe the sun.

EDIT: Yes, I did.
631420C4 - Clouds - correction value 75.0
B29124B1 - Nightclouds - correction value 75.0
C62D6DBA - Sun and Moon - correction value 100.0
11C7D824 - Stars - correction value 3000.0

Image
Image

So water and crosshair remains. :'(

Desktop-PC

i7 870 @ 3.8GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

#3
Posted 06/05/2017 08:59 PM   
Not sure why the LaserSight is working fine here, I have it enabled in the Control Panel/Registry and enable it in-game with F12 and it just works... although I'd probably just play without it and use VATS instead... You can try using: [General] bCalcTexCRCatStart = true :in the DX9Settings.ini and Up/Down to cycle through the Texture CRCs, to isolate the Crosshair but it kept crashing at start for me... [url]http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#Texture_Hunting_and_Filtering[/url] The other way is a bit more complicated... [url]http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#SaveTextureLogKey[/url] Hmm, interesting... I always thought you needed to [url=http://helixmod.blogspot.com/2017/03/converting-shaders-to-sm30.html]convert[/url] them in order to fix them in Stereo, I knew you could edit them... just not fix them. Yeah I played a bit longer and the stars are messed up here as well... not sure if the CRCs match, they might though because it looks like you're using B29124B1 as well.
Not sure why the LaserSight is working fine here, I have it enabled in the Control Panel/Registry and enable it in-game with F12 and it just works... although I'd probably just play without it and use VATS instead...

You can try using:

[General]
bCalcTexCRCatStart = true

:in the DX9Settings.ini and Up/Down to cycle through the Texture CRCs, to isolate the Crosshair but it kept crashing at start for me...

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

The other way is a bit more complicated...

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

Hmm, interesting... I always thought you needed to convert them in order to fix them in Stereo, I knew you could edit them... just not fix them.

Yeah I played a bit longer and the stars are messed up here as well... not sure if the CRCs match, they might though because it looks like you're using B29124B1 as well.
#4
Posted 06/06/2017 12:28 AM   
bCalcTexCRCatStart = true crashes for me too. The second way didn't work, because in the Textureslog the offsets for the crosshair(and other stuff) texture is always zero. I know it from Dishonored, there were a lot different offsets for one texture. In Dishonored helixmod, there is code to get the depth from the screen center for a dynamic crosshair. I tried to adopt this, but had no luck yesterday. But I'm still on it. B29124B1 seems to be for nightclouds. Or maybe just different cloud layers. I fixed that yesterday plus the stars and moon/sun. I can send you the Shader files, if you wish. I guess, the vs_2_0 only works, because the Shader is not broken but just at wrong depth.
bCalcTexCRCatStart = true crashes for me too.
The second way didn't work, because in the Textureslog the offsets for the crosshair(and other stuff) texture is always zero.
I know it from Dishonored, there were a lot different offsets for one texture.
In Dishonored helixmod, there is code to get the depth from the screen center for a dynamic crosshair. I tried to adopt this, but had no luck yesterday. But I'm still on it.

B29124B1 seems to be for nightclouds. Or maybe just different cloud layers. I fixed that yesterday plus the stars and moon/sun. I can send you the Shader files, if you wish.

I guess, the vs_2_0 only works, because the Shader is not broken but just at wrong depth.

Desktop-PC

i7 870 @ 3.8GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

#5
Posted 06/06/2017 10:36 AM   
[code]def c100, 0.04, 0.5, 0.0 , 256 def c253, 0.1, 1.0, 0.0625, -100.0 ... //center Sample mov r14, c100.yyzz texldl r10, r14, s1 mul r1.x, r10.w, c100.w //mov r1.x, c253.w //test rcp r1.w, r1.x[/code] This is the code, I borrowed from Dishonored Helixmod. It should represent the depth at screen center. But the output seems to be zero , when used in Fallout3. If I activate line 8 and give a high negative value to r1.x, then my HUD stays in depth. But I want it dynamic. Has somebody a clue?
def c100, 0.04, 0.5, 0.0 , 256
def c253, 0.1, 1.0, 0.0625, -100.0
...
//center Sample
mov r14, c100.yyzz
texldl r10, r14, s1
mul r1.x, r10.w, c100.w
//mov r1.x, c253.w //test
rcp r1.w, r1.x

This is the code, I borrowed from Dishonored Helixmod. It should represent the depth at screen center.
But the output seems to be zero , when used in Fallout3.

If I activate line 8 and give a high negative value to r1.x, then my HUD stays in depth. But I want it dynamic.

Has somebody a clue?

Desktop-PC

i7 870 @ 3.8GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

#6
Posted 06/07/2017 03:25 AM   
@all Shaderhackers: I understood now, that I need a PixelShader that uses Depth-Information and pass that over to the crosshair-VertexShader. I found a PixelShader with DepthMap. [code]... // sampler2D DepthMap; ... // DepthMap s4 1 ... ps_3_0 def c0, -4096, -0.000244140625, 1, 0.000199999995 def c6, -4, 4, 1, -9.99999975e-005 def c7, 0, 2, -1, 1 def c14, -0.569999993, 0.819999993, 0, 100 dcl_centroid t0 dcl_centroid t1 dcl_centroid t2 dcl_centroid t3 dcl_centroid t4 dcl_centroid t5 dcl t6 dcl t7.xy dcl_2d s0 dcl_2d s1 dcl_2d s2 dcl_2d s4 mov r0, t1 dp4 r1.x, t2, r0 dp4 r1.z, t4, r0 dp4 r2.w, t3, r0 dp4 r1.w, t5, r0 add r1.y, -r2.w, r1.w texld r0, t7, s2 texldp r1, r1, s4 ... [/code] I tried with "GetSampler1FromReg = 4" for the PS and "SetSampler1ToReg = 258" for the crosshair-VS, but it wasn't working. Then I tried with "DepthWRT = 1" for the PS to dump out the depth-texture, but I ended with a black texture. I used this code to dump the depth map: [code]texld r10, r1, s4 mov oC1.x, r10[/code] Was that wrong? Do I have to do something different? Or is it just impossible on some game-engines? I really need help.
@all Shaderhackers:

I understood now, that I need a PixelShader that uses Depth-Information and pass that over to the crosshair-VertexShader.
I found a PixelShader with DepthMap.
...
// sampler2D DepthMap;
...
// DepthMap s4 1
...
ps_3_0
def c0, -4096, -0.000244140625, 1, 0.000199999995
def c6, -4, 4, 1, -9.99999975e-005
def c7, 0, 2, -1, 1
def c14, -0.569999993, 0.819999993, 0, 100
dcl_centroid t0
dcl_centroid t1
dcl_centroid t2
dcl_centroid t3
dcl_centroid t4
dcl_centroid t5
dcl t6
dcl t7.xy
dcl_2d s0
dcl_2d s1
dcl_2d s2
dcl_2d s4
mov r0, t1
dp4 r1.x, t2, r0
dp4 r1.z, t4, r0
dp4 r2.w, t3, r0
dp4 r1.w, t5, r0
add r1.y, -r2.w, r1.w
texld r0, t7, s2
texldp r1, r1, s4
...

I tried with "GetSampler1FromReg = 4" for the PS and "SetSampler1ToReg = 258" for the crosshair-VS, but it wasn't working.

Then I tried with "DepthWRT = 1" for the PS to dump out the depth-texture, but I ended with a black texture.
I used this code to dump the depth map:
texld r10, r1, s4
mov oC1.x, r10

Was that wrong? Do I have to do something different? Or is it just impossible on some game-engines?
I really need help.

Desktop-PC

i7 870 @ 3.8GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

#7
Posted 06/08/2017 04:58 PM   
I can't help, but I know of two examples. Look at this thread page https://forums.geforce.com/default/topic/809236/3d-vision/obscure-indie-games/2/ Download the first link in post #24 for Fancy Skulls, you can examine the fix and perhaps glean some information from it. Then check post #26 as well It seems that it's all about the if/endifs and elses
I can't help, but I know of two examples.

Look at this thread page
https://forums.geforce.com/default/topic/809236/3d-vision/obscure-indie-games/2/

Download the first link in post #24 for Fancy Skulls, you can examine the fix and perhaps glean some information from it.

Then check post #26 as well

It seems that it's all about the if/endifs and elses

#8
Posted 06/08/2017 07:46 PM   
Well, I did a similar if/else to cut out the crosshair. But my main problem is to get the depth buffer/map. :(
Well, I did a similar if/else to cut out the crosshair.
But my main problem is to get the depth buffer/map. :(

Desktop-PC

i7 870 @ 3.8GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

#9
Posted 06/09/2017 07:31 AM   
Aaaargh!!! When I try to override a PixelShader, I get distorted graphics here and there. I now discovered, that four PS are using s13 (two of them are using every of the 16 samplers). But s13 seems to be still the best option, as all other samplers are used much more. How can I get around this? "DefPSSampler" can't be set for one special PS only, right?
Aaaargh!!!

When I try to override a PixelShader, I get distorted graphics here and there.

I now discovered, that four PS are using s13 (two of them are using every of the 16 samplers). But s13 seems to be still the best option, as all other samplers are used much more.

How can I get around this?
"DefPSSampler" can't be set for one special PS only, right?

Desktop-PC

i7 870 @ 3.8GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

#10
Posted 06/10/2017 08:18 PM   
AFAIK, you're screwed if the shader is being used elsewhere, but I've really no idea. I know that at one time daspawn was asking because he wanted to toyify the environment, which in turn broke the FPS weapon. So he wanted to isolate the weapon and have it 2D, which looks terrible imo. https://forums.geforce.com/default/topic/819149/battlefield-hardline/?offset=77#4746007
AFAIK, you're screwed if the shader is being used elsewhere, but I've really no idea. I know that at one time daspawn was asking because he wanted to toyify the environment, which in turn broke the FPS weapon. So he wanted to isolate the weapon and have it 2D, which looks terrible imo.

https://forums.geforce.com/default/topic/819149/battlefield-hardline/?offset=77#4746007

#11
Posted 06/12/2017 09:03 PM   
I stumbled over the next problem. It seems, if you want to use the "GetSampler1FromReg" function, the shader must be a ps_3_0 (but I still can be wrong with this). So I used DarkStarSwords shadertool.py . But it breaks the shaders. "dcl_pp_centroid" is not converted right. It needs to be converted to "dcl_texcoordX_pp_centroid". ----------------- The other s13 problem is not that bad. For two of the four shaders with s13 used, i found a small workaround for now (I didn't discover yet, where the other two ones are used). It doesn't look original, but still better than broken: No PS override: [url=https://abload.de/img/f3_s13problem_nohelix1vszs.jpg][img]https://abload.de/thumb/f3_s13problem_nohelix1vszs.jpg[/img][/url] Any PS override leads to s13 distortion: [url=https://abload.de/img/f3_s13problem_helixmodesl5.jpg][img]https://abload.de/thumb/f3_s13problem_helixmodesl5.jpg[/img][/url] "Fixed" with texture out of s8 : [url=https://abload.de/img/f3_s13problem_helixmo8ys74.jpg][img]https://abload.de/thumb/f3_s13problem_helixmo8ys74.jpg[/img][/url]
I stumbled over the next problem. It seems, if you want to use the "GetSampler1FromReg" function, the shader must be a ps_3_0 (but I still can be wrong with this).

So I used DarkStarSwords shadertool.py . But it breaks the shaders.
"dcl_pp_centroid" is not converted right.
It needs to be converted to "dcl_texcoordX_pp_centroid".

-----------------

The other s13 problem is not that bad.
For two of the four shaders with s13 used, i found a small workaround for now (I didn't discover yet, where the other two ones are used).
It doesn't look original, but still better than broken:

No PS override:
Image

Any PS override leads to s13 distortion:
Image

"Fixed" with texture out of s8 :
Image

Desktop-PC

i7 870 @ 3.8GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

#12
Posted 06/13/2017 02:00 AM   
Now I found, what I was looking for. :D :D :D Let's see if I can use it for the crosshair. There is still some strange behavior in the empty sky, as there seems to be content of the last frames. [img]https://abload.de/img/depth_dds7que0.jpg[/img]
Now I found, what I was looking for. :D :D :D

Let's see if I can use it for the crosshair.
There is still some strange behavior in the empty sky, as there seems to be content of the last frames.
Image

Desktop-PC

i7 870 @ 3.8GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

#13
Posted 06/16/2017 03:53 AM   
I think I will give up. ;-( Depthmap is only generated if DOF is enabled. But DOF kills 3D-Vision completely. Samplers in the DOF-shader will not be stereoized. ;-( And at the moment I don't have a clue to get this working.
I think I will give up. ;-(

Depthmap is only generated if DOF is enabled.
But DOF kills 3D-Vision completely. Samplers in the DOF-shader will not be stereoized. ;-(
And at the moment I don't have a clue to get this working.

Desktop-PC

i7 870 @ 3.8GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

#14
Posted 06/17/2017 06:29 PM   
Not sure if it would work... but couldn't you enable it(DOF), use/get the sampler and edit it later in the PS so it's transparent/disabled? Super curious, how'd you get the DepthMap to display like that?
Not sure if it would work... but couldn't you enable it(DOF), use/get the sampler and edit it later in the PS so it's transparent/disabled?

Super curious, how'd you get the DepthMap to display like that?
#15
Posted 06/17/2017 07:36 PM   
  1 / 3    
Scroll To Top