I've resumed a Nightmare playthrough today in Ys Origin, and I remembered that there are two incorrect effects in 3D:
- Bloom.
- Water reflections.
The water reflections have one defect that I usually call "double stereo correction". For example, the water reflections in Zelda Twilight Princess could be easily fixed by substracting the typical stereo correction formula. So this should be easy to fix.
However, I have one problem here, and it's that I know very little (if anything) about ASM, because I have been using 3Dmigoto all this time.
Original shader ("5E126F9E.txt"):
[code]
vs_1_1
dcl_position v0
dcl_normal v1
dcl_color v2
dcl_color1 v3
dcl_texcoord v4
def c28, 0.5, 3.14159298, 6.28318501, 0.318309993
def c29, 1, -0.5, 0.0416669995, -0.00138899998
def c30, 1, -0.166666999, 0.00833300035, -0.000197999994
def c32, 0.949999988, 0.150000006, 0, 0
m4x4 r4, v0, c24
m4x4 r0, r4, c4
mov oPos, r0
dp3 r3.w, r4, r4
rsq r3.w, r3.w
mul r3.xyz, -r4, r3.w
rcp r3.w, r3.w
mad oFog, r3.w, c1.z, c1.w
add oT0.xy, v4, c1.xyyy
mul r0.x, r0.x, c0.y
mul r0.y, r0.y, -c0.y
mad r0.xy, r0.w, c0.y, r0.xyyy
mad r1.xy, r0.xyyy, c23.z, c23.x
mad r1.x, r1.x, c0.y, r1.y
mad r2.x, r1.x, c28.w, c28.x
expp r2.y, 0
mad r2.x, r2.y, c28.z, -c28.y
dst r8.xy, r2.x, r2.x
mul r8.z, r8.y, r8.y
mul r8.w, r8.y, r8.z
dp4 r1.x, r8, c29
mad r0.y, r1.x, c23.w, r0.y
mov oT1, r0
mul r1, c16, v2
mov oD0, r1
mov oD1.xyz, v3
// approximately 32 instruction slots used
[/code]
To simply disable it, I've used:
[code]
vs_3_0
dcl_position v0
dcl_position o0
[/code]
But that's not what I want.
First question: should I convert the shader to VS3? It results in this code:
[code]
vs_3_0
dcl_position o10
dcl_fog o11.x
dcl_texcoord o0.xy
dcl_texcoord1 o1.
dcl_color o8
dcl_color1 o9
dcl_position v0
dcl_normal v1
dcl_color v2
dcl_color1 v3
dcl_texcoord v4
def c28, 0.5, 3.14159298, 6.28318501, 0.318309993
def c29, 1, -0.5, 0.0416669995, -0.00138899998
def c30, 1, -0.166666999, 0.00833300035, -0.000197999994
def c32, 0.949999988, 0.150000006, 0, 0
m4x4 r4, v0, c24
m4x4 r0, r4, c4
mov o10, r0
dp3 r3.w, r4, r4
rsq r3.w, r3.w
mul r3.xyz, -r4, r3.w
rcp r3.w, r3.w
mad o11.x, r3.w, c1.z, c1.w
add o0.xy, v4, c1.xyyy
mul r0.x, r0.x, c0.y
mul r0.y, r0.y, -c0.y
mad r0.xy, r0.w, c0.y, r0.xyyy
mad r1.xy, r0.xyyy, c23.z, c23.x
mad r1.x, r1.x, c0.y, r1.y
mad r2.x, r1.x, c28.w, c28.x
expp r2.y, r2.x
mad r2.x, r2.y, c28.z, -c28.y
dst r8.xy, r2.x, r2.x
mul r8.z, r8.y, r8.y
mul r8.w, r8.y, r8.z
dp4 r1.x, r8, c29
mad r0.y, r1.x, c23.w, r0.y
mov o1, r0
mul r1, c16, v2
mov o8, r1
mov o9.xyz, v3
// approximately 32 instruction slots used
[/code]
I've read the guides linked in the helixmod blog (but not very thoroughly because of lack of time). If I understood it correctly, I have to insert a "dcl_2d s0" along the rest of the "dcl". The rest of the second guide is a bit strange to me. I'll be testing more tomorrow and see if I can fix it.
By the way, is there any download link for a release "d3d9.dll" file? I only found the debug dll, which is what I'm using. Just to use the most updated one, because I guess that I could use the dll from some other fix.
I've resumed a Nightmare playthrough today in Ys Origin, and I remembered that there are two incorrect effects in 3D:
- Bloom.
- Water reflections.
The water reflections have one defect that I usually call "double stereo correction". For example, the water reflections in Zelda Twilight Princess could be easily fixed by substracting the typical stereo correction formula. So this should be easy to fix.
However, I have one problem here, and it's that I know very little (if anything) about ASM, because I have been using 3Dmigoto all this time.
I've read the guides linked in the helixmod blog (but not very thoroughly because of lack of time). If I understood it correctly, I have to insert a "dcl_2d s0" along the rest of the "dcl". The rest of the second guide is a bit strange to me. I'll be testing more tomorrow and see if I can fix it.
By the way, is there any download link for a release "d3d9.dll" file? I only found the debug dll, which is what I'm using. Just to use the most updated one, because I guess that I could use the dll from some other fix.
Yes, in order to fix the shader and not disable it, you'll need to convert it to vs_3_0 form. HelixMod only works upon 3.0 shaders.
For the ASM parts, you should be able to use some references from the wiki, like the Canonical Stereo Code:
http://wiki.bo3b.net/index.php?title=Canonical_Stereo_Code
Here is an earlier reference page that I made that cuts to the chase on significant posts in the giant HelixMod thread:
http://helixmod.blogspot.com/2014/01/learning-how-to-fix-games.html
There are some great details at the top of the feature list, with some working examples from DarkStarSword:
http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List
Here are references to every version of HelixMod shipped, with some detail on what works in different versions:
[url]http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#List_of_features_supported_by_HelixMod.2C_and_all_versions_available.[/url]
I'm still having a hard time after trying things. Maybe I'm doing something wrong (I'm totally new to ASM). Is there a way to know if the code in the shader is syntactically incorrect, like the beeps of 3Dmigoto? I've tried multiplying some things by 0 or similar things just to see if I could mess with the shader, and visually it remained unaffected (also the stereo correction didn't seem to work, or just anything I tried to tweak).
What if the shader was incorrectly converted to VS3.0 by the converter? This "dcl_texcoord1 o1." (ending in a period) seems out of place, unless it's something that exists in ASM. Deleting the "." didn't help, anyway :p.
I think I'll have to properly learn ASM to know what I'm doing, before anything else.
I'm still having a hard time after trying things. Maybe I'm doing something wrong (I'm totally new to ASM). Is there a way to know if the code in the shader is syntactically incorrect, like the beeps of 3Dmigoto? I've tried multiplying some things by 0 or similar things just to see if I could mess with the shader, and visually it remained unaffected (also the stereo correction didn't seem to work, or just anything I tried to tweak).
What if the shader was incorrectly converted to VS3.0 by the converter? This "dcl_texcoord1 o1." (ending in a period) seems out of place, unless it's something that exists in ASM. Deleting the "." didn't help, anyway :p.
I think I'll have to properly learn ASM to know what I'm doing, before anything else.
[quote="masterotaku"]I'm still having a hard time after trying things. Maybe I'm doing something wrong (I'm totally new to ASM). Is there a way to know if the code in the shader is syntactically incorrect, like the beeps of 3Dmigoto? I've tried multiplying some things by 0 or similar things just to see if I could mess with the shader, and visually it remained unaffected (also the stereo correction didn't seem to work, or just anything I tried to tweak).
What if the shader was incorrectly converted to VS3.0 by the converter? This "dcl_texcoord1 o1." (ending in a period) seems out of place, unless it's something that exists in ASM. Deleting the "." didn't help, anyway :p.
I think I'll have to properly learn ASM to know what I'm doing, before anything else.[/quote]
The only way to know if the shader is assembling is to look in the LOG.txt file. Look for the shader hash, and it will report syntax errors there. The file is locked by the game when running, so you have to exit the game to open the file.
That ending in a period is definitely a bug, and will cause the assembly to fail.
These are part of the weirdness of using HelixMod. No good way around these things, other than experience getting bitten. Look at the Gotchas section on the Wiki in detail. This isn't really an ASM problem so much as these are just rough edges on HelixMod itself.
masterotaku said:I'm still having a hard time after trying things. Maybe I'm doing something wrong (I'm totally new to ASM). Is there a way to know if the code in the shader is syntactically incorrect, like the beeps of 3Dmigoto? I've tried multiplying some things by 0 or similar things just to see if I could mess with the shader, and visually it remained unaffected (also the stereo correction didn't seem to work, or just anything I tried to tweak).
What if the shader was incorrectly converted to VS3.0 by the converter? This "dcl_texcoord1 o1." (ending in a period) seems out of place, unless it's something that exists in ASM. Deleting the "." didn't help, anyway :p.
I think I'll have to properly learn ASM to know what I'm doing, before anything else.
The only way to know if the shader is assembling is to look in the LOG.txt file. Look for the shader hash, and it will report syntax errors there. The file is locked by the game when running, so you have to exit the game to open the file.
That ending in a period is definitely a bug, and will cause the assembly to fail.
These are part of the weirdness of using HelixMod. No good way around these things, other than experience getting bitten. Look at the Gotchas section on the Wiki in detail. This isn't really an ASM problem so much as these are just rough edges on HelixMod itself.
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
Finally! The ASM experience I got with other games helped a lot and I could solve this in a few minutes. I'll make the blog post tomorrow, probably. Here is the fix that I'll post there:
https://s3.amazonaws.com/masterotaku/Ys+Origin/ys_origin_3d_fix.zip
In the end, the correct vertex shader code for the water is this:
[code]
vs_3_0
dcl_position o10
dcl_fog o11.x
dcl_texcoord o0.xy
dcl_texcoord1 o1.xyzw
dcl_color o8
dcl_color1 o9
dcl_position v0
dcl_normal v1
dcl_color v2
dcl_color1 v3
dcl_texcoord v4
def c247, 0, 0, 0.0625, 0.5
dcl_2d s0
def c28, 0.5, 3.14159298, 6.28318501, 0.318309993
def c29, 1, -0.5, 0.0416669995, -0.00138899998
def c30, 1, -0.166666999, 0.00833300035, -0.000197999994
def c32, 0.949999988, 0.150000006, 0, 0
m4x4 r4, v0, c24
m4x4 r0, r4, c4
mov o10, r0
dp3 r3.w, r4, r4
rsq r3.w, r3.w
mul r3.xyz, -r4, r3.w
rcp r3.w, r3.w
mad o11.x, r3.w, c1.z, c1.w
add o0.xy, v4, c1.xyyy
mul r0.x, r0.x, c0.y
mul r0.y, r0.y, -c0.y
mad r0.xy, r0.w, c0.y, r0.xyyy
mad r1.xy, r0.xyyy, c23.z, c23.x
mad r1.x, r1.x, c0.y, r1.y
mad r2.x, r1.x, c28.w, c28.x
expp r2.y, r2.x
mad r2.x, r2.y, c28.z, -c28.y
dst r8.xy, r2.x, r2.x
mul r8.z, r8.y, r8.y
mul r8.w, r8.y, r8.z
dp4 r1.x, r8, c29
mad r0.y, r1.x, c23.y, r0.y
texldl r24, c247.z, s0
add r24.w, r0.w, -r24.y
mul r24.w, r24.w, c247.w
mad r0.x, r24.w, r24.x, r0.x
mov o1.xyzw, r0.xyzw
mul r1, c16, v2
mov o8, r1
mov o9.xyz, v3
// approximately 32 instruction slots used
[/code]
Instead of "c23.w", the shader needed to use "c23.y". After that, the typical stereo correction but multiplied by 0.5.
By the way, I remember bloom effects being incorrect before, but they are rendering correctly now. Hmmmm.
F1 and F2 are two convergence presets, that can be modified with ctrl+F7.
Finally! The ASM experience I got with other games helped a lot and I could solve this in a few minutes. I'll make the blog post tomorrow, probably. Here is the fix that I'll post there:
What the hell? I went to the mirrors area and reflections were at depth (at a bad one that I fixed now). They were always flat, at surface depth. This is how it looks now:
http://u.cubeupload.com/masterotaku/ysowin008.jpg
Also look at the fixed water here, by the way (not related to what I was saying about reflections):
http://u.cubeupload.com/masterotaku/ysowin010.jpg
Redownload the fix from my previous post, please. It includes that fixed shader now.
Are these differences (bloom and mirror reflections) because I'm using the GOG version instead of the Steam version (which I lost when my HDD died. I had the GOG installer in my external HDD so I installed that instead)? Or because of new drivers? I don't know. I don't remember if it is this game the one that has two ".exe" files on Steam (in GOG it has one, "yso_win.exe").
Before doing the blog post, I'll download the game again on Steam and check if the fix is valid there. It should be done this weekend.
What the hell? I went to the mirrors area and reflections were at depth (at a bad one that I fixed now). They were always flat, at surface depth. This is how it looks now:
Redownload the fix from my previous post, please. It includes that fixed shader now.
Are these differences (bloom and mirror reflections) because I'm using the GOG version instead of the Steam version (which I lost when my HDD died. I had the GOG installer in my external HDD so I installed that instead)? Or because of new drivers? I don't know. I don't remember if it is this game the one that has two ".exe" files on Steam (in GOG it has one, "yso_win.exe").
Before doing the blog post, I'll download the game again on Steam and check if the fix is valid there. It should be done this weekend.
I have tried the Steam version. Everything is the same as the GOG version. I really have no idea why bloom effects are correct and why reflections aren't flat now.
Whatever. It's better and simpler this way, and I hope it works for everyone.
Edit: the fix is on the blog now.
I have tried the Steam version. Everything is the same as the GOG version. I really have no idea why bloom effects are correct and why reflections aren't flat now.
Whatever. It's better and simpler this way, and I hope it works for everyone.
- Bloom.
- Water reflections.
The water reflections have one defect that I usually call "double stereo correction". For example, the water reflections in Zelda Twilight Princess could be easily fixed by substracting the typical stereo correction formula. So this should be easy to fix.
However, I have one problem here, and it's that I know very little (if anything) about ASM, because I have been using 3Dmigoto all this time.
Original shader ("5E126F9E.txt"):
To simply disable it, I've used:
But that's not what I want.
First question: should I convert the shader to VS3? It results in this code:
I've read the guides linked in the helixmod blog (but not very thoroughly because of lack of time). If I understood it correctly, I have to insert a "dcl_2d s0" along the rest of the "dcl". The rest of the second guide is a bit strange to me. I'll be testing more tomorrow and see if I can fix it.
By the way, is there any download link for a release "d3d9.dll" file? I only found the debug dll, which is what I'm using. Just to use the most updated one, because I guess that I could use the dll from some other fix.
CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: Gainward Phoenix 1080 GLH
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com
For the ASM parts, you should be able to use some references from the wiki, like the Canonical Stereo Code:
http://wiki.bo3b.net/index.php?title=Canonical_Stereo_Code
Here is an earlier reference page that I made that cuts to the chase on significant posts in the giant HelixMod thread:
http://helixmod.blogspot.com/2014/01/learning-how-to-fix-games.html
There are some great details at the top of the feature list, with some working examples from DarkStarSword:
http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List
Here are references to every version of HelixMod shipped, with some detail on what works in different versions:
http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#List_of_features_supported_by_HelixMod.2C_and_all_versions_available.
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
CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: Gainward Phoenix 1080 GLH
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com
AsRock X58 Extreme6 mobo
Intel Core-i7 950 @ 4ghz
12gb Corsair Dominator DDR3 1600
ASUS DirectCU II GTX 780 3gb
Corsair TX 950w PSU
NZXT Phantom Red/Black Case
3d Vision 1 w/ Samsung 2233rz Monitor
3d Vision 2 w/ ASUS VG278HE Monitor
What if the shader was incorrectly converted to VS3.0 by the converter? This "dcl_texcoord1 o1." (ending in a period) seems out of place, unless it's something that exists in ASM. Deleting the "." didn't help, anyway :p.
I think I'll have to properly learn ASM to know what I'm doing, before anything else.
CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: Gainward Phoenix 1080 GLH
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com
The only way to know if the shader is assembling is to look in the LOG.txt file. Look for the shader hash, and it will report syntax errors there. The file is locked by the game when running, so you have to exit the game to open the file.
That ending in a period is definitely a bug, and will cause the assembly to fail.
These are part of the weirdness of using HelixMod. No good way around these things, other than experience getting bitten. Look at the Gotchas section on the Wiki in detail. This isn't really an ASM problem so much as these are just rough edges on HelixMod itself.
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
https://s3.amazonaws.com/masterotaku/Ys+Origin/ys_origin_3d_fix.zip
In the end, the correct vertex shader code for the water is this:
Instead of "c23.w", the shader needed to use "c23.y". After that, the typical stereo correction but multiplied by 0.5.
By the way, I remember bloom effects being incorrect before, but they are rendering correctly now. Hmmmm.
F1 and F2 are two convergence presets, that can be modified with ctrl+F7.
CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: Gainward Phoenix 1080 GLH
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com
http://u.cubeupload.com/masterotaku/ysowin008.jpg
Also look at the fixed water here, by the way (not related to what I was saying about reflections):
http://u.cubeupload.com/masterotaku/ysowin010.jpg
Redownload the fix from my previous post, please. It includes that fixed shader now.
Are these differences (bloom and mirror reflections) because I'm using the GOG version instead of the Steam version (which I lost when my HDD died. I had the GOG installer in my external HDD so I installed that instead)? Or because of new drivers? I don't know. I don't remember if it is this game the one that has two ".exe" files on Steam (in GOG it has one, "yso_win.exe").
Before doing the blog post, I'll download the game again on Steam and check if the fix is valid there. It should be done this weekend.
CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: Gainward Phoenix 1080 GLH
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com
I also have the GOG version and it looks perfect !
Win7 64bit Pro
CPU: 4790K 4.8 GHZ
GPU: Aurus 1080 TI 2.08 GHZ - 100% Watercooled !
Monitor: Asus PG278QR
And lots of ram and HD's ;)
Whatever. It's better and simpler this way, and I hope it works for everyone.
Edit: the fix is on the blog now.
CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: Gainward Phoenix 1080 GLH
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com