Bo3b's School For Shaderhackers
  10 / 87    
[quote="3d4dd"]bo3b, can You read my mind?! I wanted to add the possibility to the "Mind: Path to Thalamus"-fix to disable and enable the light shafts with a hotkey. When I was going to ask about this in the forum I just discovered Your 3rd lesson :) So instead of doing Your quiz I first tried to use this method in Mind and it worked. I even learned to use 2 different hotkeys in the same shader to change either the color or the alpha values (this changes different aspects of the light shafts). Mind is also a good example why it could be useful to offer the option to disable a shader with by hotkeys. There seems to be no way to fix the light shafts. But removing them generally would change the complete amtosphere of the game. Besides from that depending on the situation (and the sensibility of the player) the (different aspects of the) light shafts are more or less annoying. So in this case a hotkey seems to me to be the best solution. So thank You for Your very intersting lesson that came just in time :)[/quote]Awesome! Really happy to see you getting traction so quickly. Also, [i]really [/i]good point. Making it the user's preference for on/off via keypress is even better, because we know everyone is different. So, it's not even just for demo, it's actually got a real use. Sweet! I'll edit the text on the Lesson to clarify that, but leave video as is. This is probably worth keeping in mind for future fixes where we disable stuff. Maybe doesn't require a keypress toggle for every different effect, but should definitely have a separate Const for each effect, so that end-users can tweak it as they desire. With this in mind, I'll use that shortly to disable the Fog effect in TheBall. Some people may not mind it, and it's always possible that other things like config file settings or profiles can fix some of those effects, so being able to restore them without altering the shader files will be a great tweak. Thanks for the suggestion. BTW: for everyone, please feel free to upload other games for Quiz stuff. Anything is good, and it'll be fun to see other games and tweaks as well.
3d4dd said:bo3b, can You read my mind?! I wanted to add the possibility to the "Mind: Path to Thalamus"-fix to disable and enable the light shafts with a hotkey. When I was going to ask about this in the forum I just discovered Your 3rd lesson :) So instead of doing Your quiz I first tried to use this method in Mind and it worked. I even learned to use 2 different hotkeys in the same shader to change either the color or the alpha values (this changes different aspects of the light shafts). Mind is also a good example why it could be useful to offer the option to disable a shader with by hotkeys. There seems to be no way to fix the light shafts. But removing them generally would change the complete amtosphere of the game. Besides from that depending on the situation (and the sensibility of the player) the (different aspects of the) light shafts are more or less annoying. So in this case a hotkey seems to me to be the best solution.
So thank You for Your very intersting lesson that came just in time :)
Awesome! Really happy to see you getting traction so quickly.

Also, really good point. Making it the user's preference for on/off via keypress is even better, because we know everyone is different. So, it's not even just for demo, it's actually got a real use. Sweet! I'll edit the text on the Lesson to clarify that, but leave video as is.

This is probably worth keeping in mind for future fixes where we disable stuff. Maybe doesn't require a keypress toggle for every different effect, but should definitely have a separate Const for each effect, so that end-users can tweak it as they desire.

With this in mind, I'll use that shortly to disable the Fog effect in TheBall. Some people may not mind it, and it's always possible that other things like config file settings or profiles can fix some of those effects, so being able to restore them without altering the shader files will be a great tweak. Thanks for the suggestion.


BTW: for everyone, please feel free to upload other games for Quiz stuff. Anything is good, and it'll be fun to see other games and tweaks as well.

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 09/02/2014 12:20 AM   
[quote="DarkStarSword"]Cool, I've done lesson 3 :) Lesson learned - don't choose F7 as the toggle key, since that causes Helix mod to rewrite DX9Settings.ini without preserving comments.[/quote]Yikes! Yep, another of those gotchas with HelixMod. I've run into this as well, with a nicely commented .ini that gets stripped of comments when settings are saved via the F7 key. F7 for people that don't know, is to save the current convergence and separation settings for a given preset. So that allows people to tweak the look to their liking, then save the result into the .ini file, replacing whatever values it shipped with. Very handy and useful, just having it strip the comments is unfortunate. Now you can see why most people doing fixes skip the comments in the .ini. I just think comments are too valuable, so I always want to at least start with them.
DarkStarSword said:Cool, I've done lesson 3 :)

Lesson learned - don't choose F7 as the toggle key, since that causes Helix mod to rewrite DX9Settings.ini without preserving comments.
Yikes! Yep, another of those gotchas with HelixMod. I've run into this as well, with a nicely commented .ini that gets stripped of comments when settings are saved via the F7 key.

F7 for people that don't know, is to save the current convergence and separation settings for a given preset. So that allows people to tweak the look to their liking, then save the result into the .ini file, replacing whatever values it shipped with.

Very handy and useful, just having it strip the comments is unfortunate. Now you can see why most people doing fixes skip the comments in the .ini. I just think comments are too valuable, so I always want to at least start with them.

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 09/02/2014 12:27 AM   
[quote="TsaebehT"]UseByDef=True[/quote] Thankyou good sir! I've started applying what I've learned here to adjusting the UI depth in Betrayer: https://github.com/DarkStarSword/3d-fixes
TsaebehT said:UseByDef=True

Thankyou good sir!

I've started applying what I've learned here to adjusting the UI depth in Betrayer: https://github.com/DarkStarSword/3d-fixes

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 09/02/2014 01:07 AM   
Good deal, having stuff checked in makes things a lot better. I use it for diff comparisons a lot. In case it's helpful, for the DX11 game fixes, I've been checking those shader files into the 3Dmigoto repository. For example: [url]https://github.com/bo3b/3Dmigoto/tree/master/AC4[/url]
Good deal, having stuff checked in makes things a lot better. I use it for diff comparisons a lot.

In case it's helpful, for the DX11 game fixes, I've been checking those shader files into the 3Dmigoto repository. For example: https://github.com/bo3b/3Dmigoto/tree/master/AC4

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 09/02/2014 08:30 AM   
Aw man, I can feel it - I've managed to fix the water in Betrayer... http://photos.3dvisionlive.com/DarkStarSword/image/5405dabdd475fe93670001c5/ That is, unless I turn my head left or right - the water is only correct from that one angle :-/ Still, must be getting close :) I decided to take a shot in the dark at the vertex shader for the water. I disabled each of the outputs in turn to work out what did what - o0 did the ripple distortion, o1 made the distant water opaque, o2 did nothing I could see, o3 (tex) and o5 (pos) both just made the water pretty much disappear, but o4 made the water near me opaque. I dismissed it at first, but soon realised that o4 was in fact a pretty likely suspect - a bit of messing around later confirmed my suspicion when I was able to affect the distance of the duplicated images.
Aw man, I can feel it - I've managed to fix the water in Betrayer...

http://photos.3dvisionlive.com/DarkStarSword/image/5405dabdd475fe93670001c5/


That is, unless I turn my head left or right - the water is only correct from that one angle :-/ Still, must be getting close :)

I decided to take a shot in the dark at the vertex shader for the water. I disabled each of the outputs in turn to work out what did what - o0 did the ripple distortion, o1 made the distant water opaque, o2 did nothing I could see, o3 (tex) and o5 (pos) both just made the water pretty much disappear, but o4 made the water near me opaque. I dismissed it at first, but soon realised that o4 was in fact a pretty likely suspect - a bit of messing around later confirmed my suspicion when I was able to affect the distance of the duplicated images.

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 09/02/2014 03:05 PM   
So, I'm looking through the pixel shader and I spot this beauty: [code] if_ne c3.x, -c3.x texld r5, c5.yzzw, s3 add r2.w, r1.w, -r5.y mad r1.x, r5.x, r2.w, r1.y [/code] Look familiar? What if I told you that c5.y is 0.0625? Hmmm, the magic number 0.0625...? What if I also told you that c3 is called NvStereoEnabled and s3 is called NvStereoFixTexture? Than that code would be doing if (NvStereoEnabled) r1.x = r1.y + separation * (depth - convergence) (and from experimentation, r1.y is the unadjusted X coordinate)! Looks like this game is already stereo aware, yet still has a few broken effects.
So, I'm looking through the pixel shader and I spot this beauty:
if_ne c3.x, -c3.x
texld r5, c5.yzzw, s3
add r2.w, r1.w, -r5.y
mad r1.x, r5.x, r2.w, r1.y


Look familiar? What if I told you that c5.y is 0.0625?

Hmmm, the magic number 0.0625...? What if I also told you that c3 is called NvStereoEnabled and s3 is called NvStereoFixTexture? Than that code would be doing if (NvStereoEnabled) r1.x = r1.y + separation * (depth - convergence) (and from experimentation, r1.y is the unadjusted X coordinate)!

Looks like this game is already stereo aware, yet still has a few broken effects.

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 09/02/2014 05:00 PM   
Yay! My first non-trivial fix =D Close water and the reflections now render correctly: http://photos.3dvisionlive.com/DarkStarSword/image/5406002cd475fe616c000151/ The trick was moving the stereo adjustment into the pixel shader - it was doing a view projection there and even though the shader is already stereo aware it was not correcting the output of that projection. There's still an issue on the distant water, which I'll look at tomorrow: http://photos.3dvisionlive.com/DarkStarSword/image/54060093d475fe0b2f000188/ The WIP is in my 3d-fixes github repository if anyone wanted to take a look :)
Yay! My first non-trivial fix =D Close water and the reflections now render correctly:

http://photos.3dvisionlive.com/DarkStarSword/image/5406002cd475fe616c000151/


The trick was moving the stereo adjustment into the pixel shader - it was doing a view projection there and even though the shader is already stereo aware it was not correcting the output of that projection.

There's still an issue on the distant water, which I'll look at tomorrow:

http://photos.3dvisionlive.com/DarkStarSword/image/54060093d475fe0b2f000188/


The WIP is in my 3d-fixes github repository if anyone wanted to take a look :)

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 09/02/2014 05:44 PM   
It seems like if you start a game with a Shader containing broken code it won't reload that Shader during a refresh(F10) even if the code is fixed afterwards, so if you're unsure either start the game with the Original Shader or just ps_3_0(or vs_3_0) and tinker away! :) When cycling(Type=1) multiple Presets it always starts at 1, even if 1 is UseByDef, so it'll repeat Preset1 at the start ... eg. 1,1,2,3,1,2,3. So it seems best to make the very last Preset UseByDef. [code][Pres1] Const1=0x00000000 [Pres2] Const1=0x3f000000 [Pres3] UseByDef=True Const1=0x3f800000[/code] One other little tidbit I found way you can set a Delay in milliseconds between when you press the Key and when it executes the Preset, it only seems to affect the 'to' and not the 'from' when using Type=2.\ [code][Key1] Key=32 Presets=3;2;1; Type=1 // 1 Second Delay Delay=1000[/code] edit:with 3 Presets you can also UseByDef [Pres1] and toggle(Type=2) between [Pres2] & [Pres3] (Presets=2;3;) Nice finds DarkStarSword, I looked into what 'Betrayer' actually was ... apparently I just bought that one in a bundle, I had wanted it but completely forgot the name ... Oops! Definitely looking forward to trying it out. :)
It seems like if you start a game with a Shader containing broken code it won't reload that Shader during a refresh(F10) even if the code is fixed afterwards, so if you're unsure either start the game with the Original Shader or just ps_3_0(or vs_3_0) and tinker away! :)

When cycling(Type=1) multiple Presets it always starts at 1, even if 1 is UseByDef, so it'll repeat Preset1 at the start ... eg. 1,1,2,3,1,2,3. So it seems best to make the very last Preset UseByDef.

[Pres1]
Const1=0x00000000
[Pres2]
Const1=0x3f000000
[Pres3]
UseByDef=True
Const1=0x3f800000

One other little tidbit I found way you can set a Delay in milliseconds between when you press the Key and when it executes the Preset, it only seems to affect the 'to' and not the 'from' when using Type=2.\

[Key1]
Key=32
Presets=3;2;1;
Type=1
// 1 Second Delay
Delay=1000

edit:with 3 Presets you can also UseByDef [Pres1] and toggle(Type=2) between [Pres2] & [Pres3] (Presets=2;3;)

Nice finds DarkStarSword, I looked into what 'Betrayer' actually was ... apparently I just bought that one in a bundle, I had wanted it but completely forgot the name ... Oops! Definitely looking forward to trying it out. :)
Posted 09/03/2014 12:59 AM   
[quote="TsaebehT"]It seems like if you start a game with a Shader containing broken code it won't reload that Shader during a refresh(F10) even if the code is fixed afterwards, so if you're unsure either start the game with the Original Shader or just ps_3_0(or vs_3_0) and tinker away! :) [/quote] Good catch, there's another gotcha to watch out for. For a while I had a typo (x220.y instead of c220.y) that was stopping the shader reloading, twice now I've had oc0 instead of oC0 and despite my familiarity with PPC assembly (day job) and x86 assembly (reverse engineering Miasmata) I've still managed to miss a comma here and there. I ended up purposefully breaking an effect just to see if it was reloading and have started thinking about writing a small app that just tries to compile each of the shaders to see if any are broken (or does such a thing already exist?). I'm also thinking it might be a good idea to start listing all the gotchas we run into somewhere - maybe another page on bo3b's wiki would work? As an aside, bo3b - what are your plans for the scope of the wiki? Do you want it to be only used for the lessons and material related to them, or as a wider shaderhacking resource? Or do you even see it as something that could potentially replace a lot of what helixmod.blogspot.com is currently used for (don't get me wrong - the last thing we should do is ditch the blog altogether, but I've felt for a while that a lot of the material on it would be better served in some other format)? [quote="TsaebehT"]When cycling(Type=1) multiple Presets it always starts at 1, even if 1 is UseByDef, so it'll repeat Preset1 at the start ... eg. 1,1,2,3,1,2,3. So it seems best to make the very last Preset UseByDef.[/quote] Yeah, I noticed the same thing and came to the same conclusion. I also noticed that UseByDef can be used on multiple presets (e.g. I wanted one preset that set a default convergence & separation, and another independent preset that set a default for Const2 which I am using to toggle light shafts on and off in Betrayer). I also noticed that if you use convergence & separation presets that using F7 to save changes will only work if the preset has been manually activated - it doesn't seem to work if it was only activated with UseByDef. Might be something to keep in mind when trying to tell users how to customise their convergence & separation settings. [quote="TsaebehT"]Nice finds DarkStarSword, I looked into what 'Betrayer' actually was ... apparently I just bought that one in a bundle, I had wanted it but completely forgot the name ... Oops! Definitely looking forward to trying it out. :)[/quote] Hehe, probably the same bundle I picked it up in :)
TsaebehT said:It seems like if you start a game with a Shader containing broken code it won't reload that Shader during a refresh(F10) even if the code is fixed afterwards, so if you're unsure either start the game with the Original Shader or just ps_3_0(or vs_3_0) and tinker away! :)

Good catch, there's another gotcha to watch out for. For a while I had a typo (x220.y instead of c220.y) that was stopping the shader reloading, twice now I've had oc0 instead of oC0 and despite my familiarity with PPC assembly (day job) and x86 assembly (reverse engineering Miasmata) I've still managed to miss a comma here and there.

I ended up purposefully breaking an effect just to see if it was reloading and have started thinking about writing a small app that just tries to compile each of the shaders to see if any are broken (or does such a thing already exist?). I'm also thinking it might be a good idea to start listing all the gotchas we run into somewhere - maybe another page on bo3b's wiki would work?

As an aside, bo3b - what are your plans for the scope of the wiki? Do you want it to be only used for the lessons and material related to them, or as a wider shaderhacking resource? Or do you even see it as something that could potentially replace a lot of what helixmod.blogspot.com is currently used for (don't get me wrong - the last thing we should do is ditch the blog altogether, but I've felt for a while that a lot of the material on it would be better served in some other format)?

TsaebehT said:When cycling(Type=1) multiple Presets it always starts at 1, even if 1 is UseByDef, so it'll repeat Preset1 at the start ... eg. 1,1,2,3,1,2,3. So it seems best to make the very last Preset UseByDef.

Yeah, I noticed the same thing and came to the same conclusion. I also noticed that UseByDef can be used on multiple presets (e.g. I wanted one preset that set a default convergence & separation, and another independent preset that set a default for Const2 which I am using to toggle light shafts on and off in Betrayer).

I also noticed that if you use convergence & separation presets that using F7 to save changes will only work if the preset has been manually activated - it doesn't seem to work if it was only activated with UseByDef. Might be something to keep in mind when trying to tell users how to customise their convergence & separation settings.

TsaebehT said:Nice finds DarkStarSword, I looked into what 'Betrayer' actually was ... apparently I just bought that one in a bundle, I had wanted it but completely forgot the name ... Oops! Definitely looking forward to trying it out. :)

Hehe, probably the same bundle I picked it up in :)

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 09/03/2014 04:48 AM   
[quote="DarkStarSword"][quote="TsaebehT"]When cycling(Type=1) multiple Presets it always starts at 1, even if 1 is UseByDef, so it'll repeat Preset1 at the start ... eg. 1,1,2,3,1,2,3. So it seems best to make the very last Preset UseByDef.[/quote]Yeah, I noticed the same thing and came to the same conclusion. I also noticed that UseByDef can be used on multiple presets (e.g. I wanted one preset that set a default convergence & separation, and another independent preset that set a default for Const2 which I am using to toggle light shafts on and off in Betrayer).[/quote]Interesting. This is not what I saw while making the video. Without using UseByDef, when the game was launched, we were getting the Pres2, because the code was set to disable the effect when passed in zero- and that's what you'd see at launch, disabled effect. Toggle would work, but it seemed clear in that case that it was taking Pres2 as the default. [quote="DarkStarSword"]Yay! My first non-trivial fix =D Close water and the reflections now render correctly: http://photos.3dvisionlive.com/DarkStarSword/image/5406002cd475fe616c000151/ The trick was moving the stereo adjustment into the pixel shader - it was doing a view projection there and even though the shader is already stereo aware it was not correcting the output of that projection.[/quote]Awesome! Congratulations on getting traction with the fixes. Super good to see!
DarkStarSword said:
TsaebehT said:When cycling(Type=1) multiple Presets it always starts at 1, even if 1 is UseByDef, so it'll repeat Preset1 at the start ... eg. 1,1,2,3,1,2,3. So it seems best to make the very last Preset UseByDef.
Yeah, I noticed the same thing and came to the same conclusion. I also noticed that UseByDef can be used on multiple presets (e.g. I wanted one preset that set a default convergence & separation, and another independent preset that set a default for Const2 which I am using to toggle light shafts on and off in Betrayer).
Interesting. This is not what I saw while making the video.

Without using UseByDef, when the game was launched, we were getting the Pres2, because the code was set to disable the effect when passed in zero- and that's what you'd see at launch, disabled effect. Toggle would work, but it seemed clear in that case that it was taking Pres2 as the default.

DarkStarSword said:Yay! My first non-trivial fix =D Close water and the reflections now render correctly:

http://photos.3dvisionlive.com/DarkStarSword/image/5406002cd475fe616c000151/


The trick was moving the stereo adjustment into the pixel shader - it was doing a view projection there and even though the shader is already stereo aware it was not correcting the output of that projection.
Awesome! Congratulations on getting traction with the fixes. Super good to see!

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 09/03/2014 08:44 AM   
Hello, just got around to working my way through lesson 1, I learned stuff! Massive thanks yet again, bo3b! For the sake of contributing, the only stumble I had pertains to the issue of the LOG.txt and Dumps folder failing to be created automatically upon launching the game. The most helpful suggestion was from the man himself, ~page 6 of this thread: [quote="bo3b"]I see this also with the full game. It seems to get confused on the working directory, and created a Dumps folder and LOG.txt two directories up at the ..\common\The Ball\ directory. The second time I ran it, it generated my single shaders in the correct spot, but the LOG.txt is still active two directories up. This happens with some games, and generally is because of too many launchers like Steam confusing the working directory. One thing to try is to go offline on Steam, that changes the launch sequence. Also [b]try launching the game exe directly from the folder, not through Steam.[/b] If it doesn't work for you on second or third launch, maybe try the demo version just to see. [/quote] It seems like this issue was never truly nailed down, so I thought I'd post (hopefully!) the true solution. (For reference, I run Windows 7 64-bit, and am using the Demo version of this game). Neither the Dumps folder nor the LOG.txt were created when I first ran the game. Having checked here and played with the possibilities discussed, I found that [b]the [i]only[/i] way to get them to generate (in the correct location at least) was to launch the game directly from the game's exe in Windows Explorer,[/b] as suggested (among other things) in the quoted text. Having gotten them generated, I deleted them, and tested launching from desktop shortcut, from Steam library, and Steam shortcut (right-click Steam -> click on recently played The Ball), none of which cause the Dumps folder or LOG.txt to generate. Tried again straight from the .exe, and voila, there they are. Going offline in Steam was not necessary. Hopefully this is helpful for someone. I am hesitant to mess around in the wiki, but it might be worth someone noting this in there when time and energy permit :) On to lesson 2! EDIT: Probably not significant, but thought I'd mention that I do not get the crash error from steamoverlay when quitting the game.
Hello, just got around to working my way through lesson 1, I learned stuff! Massive thanks yet again, bo3b!

For the sake of contributing, the only stumble I had pertains to the issue of the LOG.txt and Dumps folder failing to be created automatically upon launching the game. The most helpful suggestion was from the man himself, ~page 6 of this thread:

bo3b said:I see this also with the full game. It seems to get confused on the working directory, and created a Dumps folder and LOG.txt two directories up at the ..\common\The Ball\ directory.

The second time I ran it, it generated my single shaders in the correct spot, but the LOG.txt is still active two directories up. This happens with some games, and generally is because of too many launchers like Steam confusing the working directory.

One thing to try is to go offline on Steam, that changes the launch sequence. Also try launching the game exe directly from the folder, not through Steam.


If it doesn't work for you on second or third launch, maybe try the demo version just to see.


It seems like this issue was never truly nailed down, so I thought I'd post (hopefully!) the true solution. (For reference, I run Windows 7 64-bit, and am using the Demo version of this game).

Neither the Dumps folder nor the LOG.txt were created when I first ran the game.

Having checked here and played with the possibilities discussed, I found that the only way to get them to generate (in the correct location at least) was to launch the game directly from the game's exe in Windows Explorer, as suggested (among other things) in the quoted text.

Having gotten them generated, I deleted them, and tested launching from desktop shortcut, from Steam library, and Steam shortcut (right-click Steam -> click on recently played The Ball), none of which cause the Dumps folder or LOG.txt to generate. Tried again straight from the .exe, and voila, there they are.

Going offline in Steam was not necessary.

Hopefully this is helpful for someone. I am hesitant to mess around in the wiki, but it might be worth someone noting this in there when time and energy permit :) On to lesson 2!

EDIT: Probably not significant, but thought I'd mention that I do not get the crash error from steamoverlay when quitting the game.

Posted 09/03/2014 10:07 AM   
[quote="DarkStarSword"][quote="TsaebehT"]It seems like if you start a game with a Shader containing broken code it won't reload that Shader during a refresh(F10) even if the code is fixed afterwards, so if you're unsure either start the game with the Original Shader or just ps_3_0(or vs_3_0) and tinker away! :) [/quote] Good catch, there's another gotcha to watch out for. For a while I had a typo (x220.y instead of c220.y) that was stopping the shader reloading, twice now I've had oc0 instead of oC0 and despite my familiarity with PPC assembly (day job) and x86 assembly (reverse engineering Miasmata) I've still managed to miss a comma here and there. I ended up purposefully breaking an effect just to see if it was reloading and have started thinking about writing a small app that just tries to compile each of the shaders to see if any are broken (or does such a thing already exist?). I'm also thinking it might be a good idea to start listing all the gotchas we run into somewhere - maybe another page on bo3b's wiki would work? As an aside, bo3b - what are your plans for the scope of the wiki? Do you want it to be only used for the lessons and material related to them, or as a wider shaderhacking resource? Or do you even see it as something that could potentially replace a lot of what helixmod.blogspot.com is currently used for (don't get me wrong - the last thing we should do is ditch the blog altogether, but I've felt for a while that a lot of the material on it would be better served in some other format)?[/quote]No problem, please don't hesitate to add more pages to the Wiki. I've previously started a Hot Tips page that has a few things of this form. If it's sort of unstructured info, this is probably a good spot for it. [url]http://wiki.bo3b.net/index.php?title=Hot_tips[/url] If you want to make something larger or more formal, please feel free to make new pages as you like. The only pages I've locked are the ones for the Lessons themselves to keep them closer to the videos. I don't have anything in mind with respect to the Wiki, but whatever works best for people should be the way we go. Later, I'd expect to put in some links from the HelixModBlog to pages on the Wiki, or possibly move some of the more static stuff to the Blog. For now I think the Wiki is easiest. If people are running into those gotchas more often, I'll probably put up a Lesson with just that in mind. You are on the right track with deliberately breaking the shader to see if it is loading. I do that a fair amount to narrow down the problems. Be sure to check the LOG, as it will report ASM failures. Unfortunately Helix neglected to make it possible to open the LOG while the game is running, so you have to quit to see.
DarkStarSword said:
TsaebehT said:It seems like if you start a game with a Shader containing broken code it won't reload that Shader during a refresh(F10) even if the code is fixed afterwards, so if you're unsure either start the game with the Original Shader or just ps_3_0(or vs_3_0) and tinker away! :)

Good catch, there's another gotcha to watch out for. For a while I had a typo (x220.y instead of c220.y) that was stopping the shader reloading, twice now I've had oc0 instead of oC0 and despite my familiarity with PPC assembly (day job) and x86 assembly (reverse engineering Miasmata) I've still managed to miss a comma here and there.

I ended up purposefully breaking an effect just to see if it was reloading and have started thinking about writing a small app that just tries to compile each of the shaders to see if any are broken (or does such a thing already exist?). I'm also thinking it might be a good idea to start listing all the gotchas we run into somewhere - maybe another page on bo3b's wiki would work?

As an aside, bo3b - what are your plans for the scope of the wiki? Do you want it to be only used for the lessons and material related to them, or as a wider shaderhacking resource? Or do you even see it as something that could potentially replace a lot of what helixmod.blogspot.com is currently used for (don't get me wrong - the last thing we should do is ditch the blog altogether, but I've felt for a while that a lot of the material on it would be better served in some other format)?
No problem, please don't hesitate to add more pages to the Wiki.

I've previously started a Hot Tips page that has a few things of this form. If it's sort of unstructured info, this is probably a good spot for it. http://wiki.bo3b.net/index.php?title=Hot_tips

If you want to make something larger or more formal, please feel free to make new pages as you like. The only pages I've locked are the ones for the Lessons themselves to keep them closer to the videos.


I don't have anything in mind with respect to the Wiki, but whatever works best for people should be the way we go. Later, I'd expect to put in some links from the HelixModBlog to pages on the Wiki, or possibly move some of the more static stuff to the Blog. For now I think the Wiki is easiest.


If people are running into those gotchas more often, I'll probably put up a Lesson with just that in mind. You are on the right track with deliberately breaking the shader to see if it is loading. I do that a fair amount to narrow down the problems.

Be sure to check the LOG, as it will report ASM failures. Unfortunately Helix neglected to make it possible to open the LOG while the game is running, so you have to quit to see.

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 09/03/2014 11:56 AM   
I've done it! I've fixed all the water in Betrayer! Bo3b, you're right - it is immensely satisfying when you reload the shaders and suddenly everything is rendering correctly =D The remaining glitch on the Ocean turned out to be a result of the developers partial stereo fix conflicting with mine - so some things were fixed twice causing another glitch if that makes sense. It seems they were doing some calculations off the corrected X coordinate and others off the uncorrected coordinate. I was able to fix everything to use the corrected coordinate which removed the last glitches: http://photos.3dvisionlive.com/DarkStarSword/image/5406fde4d475fe386b0001b9/ There is another body of water in the game, which uses a different set of shaders (no evidence that the devs had tried to fix this one for stereo). This one was kind of interesting in that the refraction was done with a separate pair of shaders to the reflection. The refraction was easy to fix by adding the stereo adjustment in the pixel shader in the same way I did for the Ocean, but the reflection took me a while to work out that I needed to use r2.z for the depth rather than r2.w. I'm not entirely sure why that was - could it be something to do with needing the depth of the object being reflected rather than the water? I noticed that r2.z was being used just below the view projection in an 'rcp r1.w, r2.z' which clued me in: http://photos.3dvisionlive.com/DarkStarSword/image/54073db9d475fe7d7a0000ac/ http://photos.3dvisionlive.com/DarkStarSword/image/54073eb7d475fe161a0000fd/ Also, after fixing the water I spotted this message hidden in the ripples that was only visible from one spot on the fallen tree: http://photos.3dvisionlive.com/DarkStarSword/image/54073f10d475fe386b0001c4/ It's just the red debug text - I saw that get drawn on a random texture in another game as well. There's a few minor glitches I'll take a look at next (I have a feeling they will be low hanging fruit), then maybe I'll try to wrap my brain around the light shafts (any pointers? I'm not really sure where to start). Shadows are kind of interesting in this game - they actually render pretty well in 3D, but if you look at them they appear to be a few centimeters underneath the ground, which I've never seen in any other game before.
I've done it! I've fixed all the water in Betrayer! Bo3b, you're right - it is immensely satisfying when you reload the shaders and suddenly everything is rendering correctly =D

The remaining glitch on the Ocean turned out to be a result of the developers partial stereo fix conflicting with mine - so some things were fixed twice causing another glitch if that makes sense. It seems they were doing some calculations off the corrected X coordinate and others off the uncorrected coordinate. I was able to fix everything to use the corrected coordinate which removed the last glitches:

http://photos.3dvisionlive.com/DarkStarSword/image/5406fde4d475fe386b0001b9/


There is another body of water in the game, which uses a different set of shaders (no evidence that the devs had tried to fix this one for stereo). This one was kind of interesting in that the refraction was done with a separate pair of shaders to the reflection. The refraction was easy to fix by adding the stereo adjustment in the pixel shader in the same way I did for the Ocean, but the reflection took me a while to work out that I needed to use r2.z for the depth rather than r2.w. I'm not entirely sure why that was - could it be something to do with needing the depth of the object being reflected rather than the water? I noticed that r2.z was being used just below the view projection in an 'rcp r1.w, r2.z' which clued me in:


http://photos.3dvisionlive.com/DarkStarSword/image/54073db9d475fe7d7a0000ac/

http://photos.3dvisionlive.com/DarkStarSword/image/54073eb7d475fe161a0000fd/


Also, after fixing the water I spotted this message hidden in the ripples that was only visible from one spot on the fallen tree:

http://photos.3dvisionlive.com/DarkStarSword/image/54073f10d475fe386b0001c4/

It's just the red debug text - I saw that get drawn on a random texture in another game as well.

There's a few minor glitches I'll take a look at next (I have a feeling they will be low hanging fruit), then maybe I'll try to wrap my brain around the light shafts (any pointers? I'm not really sure where to start). Shadows are kind of interesting in this game - they actually render pretty well in 3D, but if you look at them they appear to be a few centimeters underneath the ground, which I've never seen in any other game before.

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 09/03/2014 04:36 PM   
Hi DarkStarSword. Great job on fixing the reflections! Not sure if you know, but Eqzitara already has a fix for Betrayer on the HelixMod site. (It's not currently listed in the Games List, though.) http://helixmod.blogspot.ch/2014/03/betrayer.html The fix on Helixmod doesn't include water reflections so your fix now makes this game perfect.
Hi DarkStarSword. Great job on fixing the reflections! Not sure if you know, but Eqzitara already has a fix for Betrayer on the HelixMod site. (It's not currently listed in the Games List, though.)

http://helixmod.blogspot.ch/2014/03/betrayer.html

The fix on Helixmod doesn't include water reflections so your fix now makes this game perfect.

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

Posted 09/04/2014 09:18 AM   
Wow, you fixed an issue that eqzitara didn't fix. Very impressive!
Wow, you fixed an issue that eqzitara didn't fix. Very impressive!

Posted 09/04/2014 10:45 AM   
  10 / 87    
Scroll To Top