Bo3b's School For Shaderhackers
  45 / 88    
[quote="tonka"]Thanks DarkStarSword, I had to change the one with the '\' before it then it worked, I should have thought of that myself but I know absolutely nothing about dlls, I thought that they were just a library of functions.[/quote]No worries :) [quote]If I Alt-Tab out of the game is it possible to view that log, I get access denied.[/quote]Unfortunately not at present :( If we're lucky, it might be possible to binary patch it to allow this - I happen to know that it opens the log file using CreateFileA(), which takes a dwShareMode argument - if we can overwrite the value Helix Mod uses for that with FILE_SHARE_READ we might be able to get this to work... If I have time tonight I'll apply my 1337 reverse engineering skills to the problem (Oh, wouldn't it be nice if Helix Mod were open source?) Otherwise we could always write yet another tool to hook the call and force this (or maybe something like this already exists?). [quote]I looked at Albedo: Eyes from Outer Space today but it looks far too broken for me to fix. I see on Steam that you also have that game - have you ever looked at it for fixing ?[/quote]Oh yeah, that game was on my TODO list at some point, but I was waiting for it to leave early access first... Looks like that happened while I wasn't looking so I'll add it back to my list -- but my backlog is quite full right now so it may be some time before I get to it. [quote]BTW I am now playing Lichdom Battlemage with your fix using all the spells voice activated, it adds a new dimension to the game. I have used a combination of Harry Potter spell names and latin names. Only disadvantage is it takes a bit longer to cast the spell.[/quote]Cool =)
tonka said:Thanks DarkStarSword, I had to change the one with the '\' before it then it worked, I should have thought of that myself but I know absolutely nothing about dlls, I thought that they were just a library of functions.
No worries :)

If I Alt-Tab out of the game is it possible to view that log, I get access denied.
Unfortunately not at present :(

If we're lucky, it might be possible to binary patch it to allow this - I happen to know that it opens the log file using CreateFileA(), which takes a dwShareMode argument - if we can overwrite the value Helix Mod uses for that with FILE_SHARE_READ we might be able to get this to work... If I have time tonight I'll apply my 1337 reverse engineering skills to the problem (Oh, wouldn't it be nice if Helix Mod were open source?)

Otherwise we could always write yet another tool to hook the call and force this (or maybe something like this already exists?).

I looked at Albedo: Eyes from Outer Space today but it looks far too broken for me to fix. I see on Steam that you also have that game - have you ever looked at it for fixing ?
Oh yeah, that game was on my TODO list at some point, but I was waiting for it to leave early access first... Looks like that happened while I wasn't looking so I'll add it back to my list -- but my backlog is quite full right now so it may be some time before I get to it.

BTW I am now playing Lichdom Battlemage with your fix using all the spells voice activated, it adds a new dimension to the game. I have used a combination of Harry Potter spell names and latin names.
Only disadvantage is it takes a bit longer to cast the spell.
Cool =)

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 11/27/2015 12:06 AM   
[quote="helifax"]Thanks for the info;) Interesting stuff there;) I'll play a bit more from the driver side and see if I can end up with anything;) There are a couple of maps in SW BF that require Compute shaders to render properly unfortunately, as all the lighting is done using them.. SO! I was able to fix all my issues and the tile lighting issue;)[/quote] Nice! [quote]And now I am exactly where I want to be. I have a couple of LIGHTING shaders that are Compute Shaders. For example this one:[/quote] That's the same tile shader you posted above (was that intentional?), and while I might be wrong, I can't see anything in this shader that would need to be fixed - it doesn't seem to be transforming any coordinates, but perhaps it's doing something more unusual with the tiles that I'd need to study the code in more detail to understand. [quote]Also, is there a way to find and MARK a shader and dump it in ASM format? I looked in the ini file but I might have missed it... (as I remember doing it before)[/quote] We've been meaning to add an option to change copy on mark to use assembly shaders, but haven't got around to it yet. For now, the best way is to set export_shaders=1 to dump shaders as assembly (which uses Flugan's precision fix in recent versions of 3DMigoto), then look at the log file when you mark a shader to find it's hash and manually copy it to ShaderFixes (I'm pretty sure 3DMigoto will preference assembly versions over HLSL if you have both in ShaderFixes). [quote="helifax"]I also have a BAD pixel shader code here: ... How can I fix the "bad code" segment? ^_^[/quote] [/quote] Let's take a look: [code] // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r4.w, r4.w, l(12), t21.xxxx r4.w = g_preIntegratedDLSampler[]..swiz; [/code] ok, so it's an indexed load from a structured buffer. Well, there's no "g_preIntegratedDLSampler" defined in the shader, but t21 is: [code] StructuredBuffer<g_lightCullInput> g_lightCullInput : register(t21); [/code] There's also a bit more info in the assembly dump that is handy to know: [code] // Resource bind info for g_lightCullInput // { // // uint4 $Element; // Offset: 0 Size: 16 // // } ... // g_lightCullInput texture struct r/o 21 1 [/code] So, putting all this info together we need to define a structured buffer that matches this format, which is pretty straight forward in this case: [code] struct g_lightCullInputType { uint4 Element; }; StructuredBuffer<struct g_lightCullInputType> g_lightCullInput : register(t21); [/code] Then fix up the instruction based on the MSDN documentation of the instruction, and realising that the srcByteOffset of 12 is the number of bytes into the structure to read from, which is Element.w: [code] // ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r4.w, r4.w, l(12), t21.xxxx r4.w = g_lightCullInput[r4.w].Element.w; [/code] I haven't tested that, but barring any typos it should work.
helifax said:Thanks for the info;) Interesting stuff there;) I'll play a bit more from the driver side and see if I can end up with anything;) There are a couple of maps in SW BF that require Compute shaders to render properly unfortunately, as all the lighting is done using them..

SO! I was able to fix all my issues and the tile lighting issue;)

Nice!

And now I am exactly where I want to be. I have a couple of LIGHTING shaders that are Compute Shaders.
For example this one:


That's the same tile shader you posted above (was that intentional?), and while I might be wrong, I can't see anything in this shader that would need to be fixed - it doesn't seem to be transforming any coordinates, but perhaps it's doing something more unusual with the tiles that I'd need to study the code in more detail to understand.

Also, is there a way to find and MARK a shader and dump it in ASM format? I looked in the ini file but I might have missed it... (as I remember doing it before)

We've been meaning to add an option to change copy on mark to use assembly shaders, but haven't got around to it yet.

For now, the best way is to set export_shaders=1 to dump shaders as assembly (which uses Flugan's precision fix in recent versions of 3DMigoto), then look at the log file when you mark a shader to find it's hash and manually copy it to ShaderFixes (I'm pretty sure 3DMigoto will preference assembly versions over HLSL if you have both in ShaderFixes).

helifax said:I also have a BAD pixel shader code here:

...

How can I fix the "bad code" segment? ^_^



Let's take a look:

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r4.w, r4.w, l(12), t21.xxxx
r4.w = g_preIntegratedDLSampler[]..swiz;

ok, so it's an indexed load from a structured buffer. Well, there's no "g_preIntegratedDLSampler" defined in the shader, but t21 is:

StructuredBuffer<g_lightCullInput> g_lightCullInput : register(t21);

There's also a bit more info in the assembly dump that is handy to know:

// Resource bind info for g_lightCullInput
// {
//
// uint4 $Element; // Offset: 0 Size: 16
//
// }

...

// g_lightCullInput texture struct r/o 21 1

So, putting all this info together we need to define a structured buffer that matches this format, which is pretty straight forward in this case:

struct g_lightCullInputType
{
uint4 Element;
};

StructuredBuffer<struct g_lightCullInputType> g_lightCullInput : register(t21);

Then fix up the instruction based on the MSDN documentation of the instruction, and realising that the srcByteOffset of 12 is the number of bytes into the structure to read from, which is Element.w:

// ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r4.w, r4.w, l(12), t21.xxxx
r4.w = g_lightCullInput[r4.w].Element.w;


I haven't tested that, but barring any typos it should work.

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 11/27/2015 12:57 AM   
[quote="DarkStarSword"][quote]If I Alt-Tab out of the game is it possible to view that log, I get access denied.[/quote]Unfortunately not at present :( If we're lucky, it might be possible to binary patch it to allow this - I happen to know that it opens the log file using CreateFileA(), which takes a dwShareMode argument - if we can overwrite the value Helix Mod uses for that with FILE_SHARE_READ we might be able to get this to work... If I have time tonight I'll apply my 1337 reverse engineering skills to the problem (Oh, wouldn't it be nice if Helix Mod were open source?)[/quote] Ask, and ye shall receive - binary patched versions of Helix Mod that allow the LOG.txt to be opened while the game is running: 32bit: https://github.com/DarkStarSword/3d-fixes/raw/master/__HELIX__/2014-03-02-DEBUG-BINARY-PATCHED/d3d9.dll 64bit: https://github.com/DarkStarSword/3d-fixes/raw/master/__HELIX__/2014-03-02-DEBUG-BINARY-PATCHED/x64/d3d9.dll To me, everything is open source - they just don't know it yet :-p
DarkStarSword said:
If I Alt-Tab out of the game is it possible to view that log, I get access denied.
Unfortunately not at present :(
If we're lucky, it might be possible to binary patch it to allow this - I happen to know that it opens the log file using CreateFileA(), which takes a dwShareMode argument - if we can overwrite the value Helix Mod uses for that with FILE_SHARE_READ we might be able to get this to work... If I have time tonight I'll apply my 1337 reverse engineering skills to the problem (Oh, wouldn't it be nice if Helix Mod were open source?)


Ask, and ye shall receive - binary patched versions of Helix Mod that allow the LOG.txt to be opened while the game is running:

32bit:

https://github.com/DarkStarSword/3d-fixes/raw/master/__HELIX__/2014-03-02-DEBUG-BINARY-PATCHED/d3d9.dll


64bit:

https://github.com/DarkStarSword/3d-fixes/raw/master/__HELIX__/2014-03-02-DEBUG-BINARY-PATCHED/x64/d3d9.dll



To me, everything is open source - they just don't know it yet :-p

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 11/27/2015 08:03 AM   
[quote="DarkStarSword"] That's the same tile shader you posted above (was that intentional?), and while I might be wrong, I can't see anything in this shader that would need to be fixed - it doesn't seem to be transforming any coordinates, but perhaps it's doing something more unusual with the tiles that I'd need to study the code in more detail to understand. [/quote] Yes, it wasn't a copy paste error;) This is the only shader (PS or CS) that I was able to find that is controlling one lighting effect... I also looked into it and I couldn't see any place where it would require a correction...but I just wanted to ask;) [quote="DarkStarSword"] Then fix up the instruction based on the MSDN documentation of the instruction, and realising that the srcByteOffset of 12 is the number of bytes into the structure to read from, which is Element.w: [/quote] Everything is perfectly clear so far;) Just one question I can't figure it out from where did you know that the offset (srcByteOffset) is 12 bytes? I see there ? [code] ...(mixed,mixed,mixed,mixed) r4.w, r4.w, l(12), t21.xxxx [/code] From the "r4.w" here? or from the "l(12)"? Big thanks!!!
DarkStarSword said:

That's the same tile shader you posted above (was that intentional?), and while I might be wrong, I can't see anything in this shader that would need to be fixed - it doesn't seem to be transforming any coordinates, but perhaps it's doing something more unusual with the tiles that I'd need to study the code in more detail to understand.


Yes, it wasn't a copy paste error;) This is the only shader (PS or CS) that I was able to find that is controlling one lighting effect... I also looked into it and I couldn't see any place where it would require a correction...but I just wanted to ask;)

DarkStarSword said:
Then fix up the instruction based on the MSDN documentation of the instruction, and realising that the srcByteOffset of 12 is the number of bytes into the structure to read from, which is Element.w:


Everything is perfectly clear so far;) Just one question I can't figure it out from where did you know that the offset (srcByteOffset) is 12 bytes? I see there ?
...(mixed,mixed,mixed,mixed) r4.w, r4.w, l(12), t21.xxxx


From the "r4.w" here? or from the "l(12)"?

Big thanks!!!

1x Palit RTX 2080Ti Pro Gaming OC(watercooled and overclocked to hell)
3x 3D Vision Ready Asus VG278HE monitors (5760x1080).
Intel i9 9900K (overclocked to 5.3 and watercooled ofc).
Asus Maximus XI Hero Mobo.
16 GB Team Group T-Force Dark Pro DDR4 @ 3600.
Lots of Disks:
- Raid 0 - 256GB Sandisk Extreme SSD.
- Raid 0 - WD Black - 2TB.
- SanDisk SSD PLUS 480 GB.
- Intel 760p 256GB M.2 PCIe NVMe SSD.
Creative Sound Blaster Z.
Windows 10 x64 Pro.
etc


My website with my fixes and OpenGL to 3D Vision wrapper:
http://3dsurroundgaming.com

(If you like some of the stuff that I've done and want to donate something, you can do it with PayPal at tavyhome@gmail.com)

Posted 11/27/2015 09:55 AM   
Thanks, does helixmod record asm errors in fixed shaders in the log. This seems to be a shadows shader in the game but what I try only seems to cause a lot of flickering. The shadows are all too much to the right, do I need to change pixel shaders also ? I also get a ghosting by my character, what do I need to do to correct that ? [code] vs_3_0 dcl_position o0 dcl_texcoord o1 dcl_texcoord1 o2 def c4, 0.01000214, 1, 0.5, 0 dcl_position v0 add r0.xy, v0, c4.y mul r0.xy, r0, c4.z add r0.y, -r0, c4 mov o1.xy, r0 add o2.xy, r0, c0 mov o0.xy, v0 mov o0.zw, c4.xyxy [/code]
Thanks, does helixmod record asm errors in fixed shaders in the log.

This seems to be a shadows shader in the game but what I try only seems to cause a lot of flickering. The shadows are all too much to the right, do I need to change pixel shaders also ?

I also get a ghosting by my character, what do I need to do to correct that ?

vs_3_0
dcl_position o0
dcl_texcoord o1
dcl_texcoord1 o2
def c4, 0.01000214, 1, 0.5, 0
dcl_position v0
add r0.xy, v0, c4.y
mul r0.xy, r0, c4.z
add r0.y, -r0, c4
mov o1.xy, r0
add o2.xy, r0, c0
mov o0.xy, v0
mov o0.zw, c4.xyxy

Posted 11/27/2015 09:57 AM   
[quote="tonka"]Thanks, does helixmod record asm errors in fixed shaders in the log.[/quote] Honestly I don't remember (almost never check the log since it wasn't accessible while the game was running until now) - but you could quite easily perform a trivial experiment to answer this. I do know that there are certain errors that won't show up in the log because they are valid assembly but aren't possible for the hardware to perform (things like using two different constant registers in the one instruction, because the hardware only has a single read port for constant registers). We listed some of the gotchas we know about here (if you find any others please edit the page and add them): [url]http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#Gotchas[/url] [quote]This seems to be a shadows shader in the game but what I try only seems to cause a lot of flickering. The shadows are all too much to the right, do I need to change pixel shaders also ?[/quote] Most likely the shadows will need a fix in the pixel shader, however if this is an unknown engine that we don't already know the patterns to fix you would probably be better off disabling the shadows until you have mastered the easier fixes first. [quote]I also get a ghosting by my character, what do I need to do to correct that ?[/quote] Like a halo? Not sure what you mean here. [quote="helifax"]Everything is perfectly clear so far;) Just one question I can't figure it out from where did you know that the offset (srcByteOffset) is 12 bytes? I see there ? [code] ...(mixed,mixed,mixed,mixed) r4.w, r4.w, l(12), t21.xxxx [/code] From the "r4.w" here? or from the "l(12)"? Big thanks!!![/quote] Partly from the documentation on the ld_structured instruction (not positive this is the same as ld_structured_indexable, but it looks like it is) and partly from my own experience with how compilers generate code: https://msdn.microsoft.com/en-us/library/windows/desktop/hh447157(v=vs.85).aspx The pseudocode on that page is sure to be confusing because it's complete garbage - there's a fundamental error in the ReadLocation calculation where they have used the wrong names... don't pay any attention to it. Looking at the arguments that instruction takes, r4.w is srcAddress and l(12) is srcByteOffset. srcAddress is defined as an index and srcByteOffset is a byte offset, so r4.w will be the index into an array of structs and l(12) will be an offset within that struct. If you forget this as being a buffer for a moment and just think of it as an array of structs (which is exactly what it is) this makes sense - say if you had some C code like this: [code] #include <stdio.h> struct foo { float x; float y; float z; float w; }; static struct foo bar[10]; int main(int argc, char *argv[]) { int i; for (i = 0; i < 10; i++) { printf("bar[%i].w = %f\n", i, bar[i].w); } } [/code] You can see that we are accessing a struct within the array by index, but we don't index within an individual struct - that's just going to be a fixed offset that the compiler will figure out from where the w member is in memory. So, putting it together, the array index is most likely going to be a variable, while the offset within the struct will be a literal number. Hence, r4.w is the index and l(12) is the offset within the struct. Of course there are always exceptions, like if the struct itself also contained an array that was indexed in the code.
tonka said:Thanks, does helixmod record asm errors in fixed shaders in the log.

Honestly I don't remember (almost never check the log since it wasn't accessible while the game was running until now) - but you could quite easily perform a trivial experiment to answer this.

I do know that there are certain errors that won't show up in the log because they are valid assembly but aren't possible for the hardware to perform (things like using two different constant registers in the one instruction, because the hardware only has a single read port for constant registers). We listed some of the gotchas we know about here (if you find any others please edit the page and add them):
http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#Gotchas

This seems to be a shadows shader in the game but what I try only seems to cause a lot of flickering. The shadows are all too much to the right, do I need to change pixel shaders also ?

Most likely the shadows will need a fix in the pixel shader, however if this is an unknown engine that we don't already know the patterns to fix you would probably be better off disabling the shadows until you have mastered the easier fixes first.

I also get a ghosting by my character, what do I need to do to correct that ?

Like a halo? Not sure what you mean here.

helifax said:Everything is perfectly clear so far;) Just one question I can't figure it out from where did you know that the offset (srcByteOffset) is 12 bytes? I see there ?
...(mixed,mixed,mixed,mixed) r4.w, r4.w, l(12), t21.xxxx


From the "r4.w" here? or from the "l(12)"?

Big thanks!!!

Partly from the documentation on the ld_structured instruction (not positive this is the same as ld_structured_indexable, but it looks like it is) and partly from my own experience with how compilers generate code:

https://msdn.microsoft.com/en-us/library/windows/desktop/hh447157(v=vs.85).aspx


The pseudocode on that page is sure to be confusing because it's complete garbage - there's a fundamental error in the ReadLocation calculation where they have used the wrong names... don't pay any attention to it.

Looking at the arguments that instruction takes, r4.w is srcAddress and l(12) is srcByteOffset. srcAddress is defined as an index and srcByteOffset is a byte offset, so r4.w will be the index into an array of structs and l(12) will be an offset within that struct. If you forget this as being a buffer for a moment and just think of it as an array of structs (which is exactly what it is) this makes sense - say if you had some C code like this:

#include <stdio.h>

struct foo {
float x;
float y;
float z;
float w;
};

static struct foo bar[10];

int main(int argc, char *argv[])
{
int i;

for (i = 0; i < 10; i++) {
printf("bar[%i].w = %f\n", i, bar[i].w);
}
}


You can see that we are accessing a struct within the array by index, but we don't index within an individual struct - that's just going to be a fixed offset that the compiler will figure out from where the w member is in memory.

So, putting it together, the array index is most likely going to be a variable, while the offset within the struct will be a literal number. Hence, r4.w is the index and l(12) is the offset within the struct.

Of course there are always exceptions, like if the struct itself also contained an array that was indexed in the code.

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 11/27/2015 11:45 AM   
Can you give me a 32-bit version of the dll please, that one is 64-bit. You can see in the 2nd screenshot that I attached what I mean by ghosting. Also the rock in front of my character, is that a halo? Ok, I seem to have a problem with F10 where some of the time it is not working so I thought that none of my fixes were correct. The halo problem is now solved, the shadows are disabled and the game is looking quite playable. I would like to push the '!' mark in this screenshot into depth, in fact I would like to push the HUD into depth but I can't find any shaders for the HUD. How do you alter HUDs?
Can you give me a 32-bit version of the dll please, that one is 64-bit.

You can see in the 2nd screenshot that I attached what I mean by ghosting. Also the rock in front of my character, is that a halo?

Ok, I seem to have a problem with F10 where some of the time it is not working so I thought that none of my fixes were correct. The halo problem is now solved, the shadows are disabled and the game is looking quite playable.

I would like to push the '!' mark in this screenshot into depth, in fact I would like to push the HUD into depth but I can't find any shaders for the HUD. How do you alter HUDs?
Attachments

HowToSurvive03_50.jps

Posted 11/27/2015 06:35 PM   
Big thanks DarkStarSword! The mystery is solved;)
Big thanks DarkStarSword!
The mystery is solved;)

1x Palit RTX 2080Ti Pro Gaming OC(watercooled and overclocked to hell)
3x 3D Vision Ready Asus VG278HE monitors (5760x1080).
Intel i9 9900K (overclocked to 5.3 and watercooled ofc).
Asus Maximus XI Hero Mobo.
16 GB Team Group T-Force Dark Pro DDR4 @ 3600.
Lots of Disks:
- Raid 0 - 256GB Sandisk Extreme SSD.
- Raid 0 - WD Black - 2TB.
- SanDisk SSD PLUS 480 GB.
- Intel 760p 256GB M.2 PCIe NVMe SSD.
Creative Sound Blaster Z.
Windows 10 x64 Pro.
etc


My website with my fixes and OpenGL to 3D Vision wrapper:
http://3dsurroundgaming.com

(If you like some of the stuff that I've done and want to donate something, you can do it with PayPal at tavyhome@gmail.com)

Posted 11/27/2015 06:45 PM   
[quote="tonka"]Can you give me a 32-bit version of the dll please, that one is 64-bit.[/quote]I posted links to both versions above. [quote]Ok, I seem to have a problem with F10 where some of the time it is not working so I thought that none of my fixes were correct. The halo problem is now solved, the shadows are disabled and the game is looking quite playable.[/quote]Great! The F10 thing with Helix Mod is annoying - to be able to reload a shader it has to have already been in the ShaderOverride directory (and not have any errors that prevent it assembling) when the game was launched. That's probably worth adding to the wiki as a gotcha under Helix Mod - would you mind adding it? [quote]I would like to push the '!' mark in this screenshot into depth, in fact I would like to push the HUD into depth but I can't find any shaders for the HUD. How do you alter HUDs?[/quote]HUDS are almost always adjusted by altering the output position from their vertex shader (usually we use the formula x += separation * hud_depth; to set it to some percentage towards infinity, but there are other methods as well), but of course that means you will have to identify the vertex shader first. If the vertex shader is being tricky to hunt, see if you can hunt the pixel shader instead then use this method to identify the matching vertex shader: [url]http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#Shader_Hunting_a_Vertex_Shader_for_a_Given_Pixel_Shader_.28or_vice_versa.29[/url] Another possibility with Helix Mod is that it might be Vertex Shader 0 - the very first vertex shader that the game creates won't ever be disabled while hunting, but you can still see the CRC and dump it out. In some games (like Stranded Deep ever since they switched to Unity 5) the UI doesn't disappear even when I have the right vertex shader selected, but it's appearance changes ever so slightly, and IIRC it stops updating. In some games there might not be a vertex shader used for the UI at all. This is rare, but there is a solution (note that F10 reload doesn't work for these ever): [url]http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#Inserting_a_Missing_Vertex_Shader_Before_a_Pixel_Shader[/url] In some games, the UI is rendered using only fixed pipeline, which we can't adjust because there are no shaders.
tonka said:Can you give me a 32-bit version of the dll please, that one is 64-bit.
I posted links to both versions above.

Ok, I seem to have a problem with F10 where some of the time it is not working so I thought that none of my fixes were correct. The halo problem is now solved, the shadows are disabled and the game is looking quite playable.
Great!

The F10 thing with Helix Mod is annoying - to be able to reload a shader it has to have already been in the ShaderOverride directory (and not have any errors that prevent it assembling) when the game was launched. That's probably worth adding to the wiki as a gotcha under Helix Mod - would you mind adding it?

I would like to push the '!' mark in this screenshot into depth, in fact I would like to push the HUD into depth but I can't find any shaders for the HUD. How do you alter HUDs?
HUDS are almost always adjusted by altering the output position from their vertex shader (usually we use the formula x += separation * hud_depth; to set it to some percentage towards infinity, but there are other methods as well), but of course that means you will have to identify the vertex shader first.

If the vertex shader is being tricky to hunt, see if you can hunt the pixel shader instead then use this method to identify the matching vertex shader:
http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#Shader_Hunting_a_Vertex_Shader_for_a_Given_Pixel_Shader_.28or_vice_versa.29

Another possibility with Helix Mod is that it might be Vertex Shader 0 - the very first vertex shader that the game creates won't ever be disabled while hunting, but you can still see the CRC and dump it out.

In some games (like Stranded Deep ever since they switched to Unity 5) the UI doesn't disappear even when I have the right vertex shader selected, but it's appearance changes ever so slightly, and IIRC it stops updating.

In some games there might not be a vertex shader used for the UI at all. This is rare, but there is a solution (note that F10 reload doesn't work for these ever):
http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List#Inserting_a_Missing_Vertex_Shader_Before_a_Pixel_Shader

In some games, the UI is rendered using only fixed pipeline, which we can't adjust because there are no shaders.

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 11/28/2015 06:24 AM   
I am gradually learning more and more. Now I understand why I could not see any effect in my fixes using F10. That should definitely be in the gotchas, I will see if I can add it. There were no shaders at all for the HUD that disabled it, I will look at the 0 shaders. Yesterday I found a pdf of a book called Real Time Shader Programming and read through it. It's pretty old but there is a lot of information about lighting and objects in it, half of which was greek to me. How do I solve the halos on the beach in the screenshot below. I found a vertex shader but stereoizing it doesn't seem to help.
I am gradually learning more and more. Now I understand why I could not see any effect in my fixes using F10. That should definitely be in the gotchas, I will see if I can add it. There were no shaders at all for the HUD that disabled it, I will look at the 0 shaders.

Yesterday I found a pdf of a book called Real Time Shader Programming and read through it. It's pretty old but there is a lot of information about lighting and objects in it, half of which was greek to me.

How do I solve the halos on the beach in the screenshot below. I found a vertex shader but stereoizing it doesn't seem to help.
Attachments

HowToSurvive05_50.jps

Posted 11/28/2015 08:55 AM   
Hmmm, I can't see any halo issues in that screenshot? Is it just me, or is the grass behind everything else? I can barely tell though because everything in that screenshot looks like it's on a flat plane at infinity (either your convergence is set very low or that was taken on a much larger screen than my laptop).
Hmmm, I can't see any halo issues in that screenshot?

Is it just me, or is the grass behind everything else? I can barely tell though because everything in that screenshot looks like it's on a flat plane at infinity (either your convergence is set very low or that was taken on a much larger screen than my laptop).

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 11/28/2015 05:02 PM   
Left and right of my character there is a faint light green duplication of his whole body in 3D, also the body on the right has it. Convergence=1.6, separation=100 and it is a 27"" monitor. The grass seems fine to me. This game also has some vs 2_0 shaders including Vertex Shader 0 which I need to convert to vs 3_0 for helixmod to work don't I ? I know how to do that. What about ps shaders - do both 2_0 and 3_0 work with helixmod ? If I disable Vertex Shader 0 I get a black screen when starting the game so I guess that is the shader for the menu and HUD. It will probably be difficult to differentiate between the two, I guess. Both 0 shaders have very few instructions, how is that possible for menu screens and HUD ? Yes, the HUD disappears when I disable the shader when in game. What do you mean by hud_depth in x += separation * hud_depth ?
Left and right of my character there is a faint light green duplication of his whole body in 3D, also the body on the right has it. Convergence=1.6, separation=100 and it is a 27"" monitor.

The grass seems fine to me.

This game also has some vs 2_0 shaders including Vertex Shader 0 which I need to convert to vs 3_0 for helixmod to work don't I ? I know how to do that. What about ps shaders - do both 2_0 and 3_0 work with helixmod ?

If I disable Vertex Shader 0 I get a black screen when starting the game so I guess that is the shader for the menu and HUD. It will probably be difficult to differentiate between the two, I guess. Both 0 shaders have very few instructions, how is that possible for menu screens and HUD ?

Yes, the HUD disappears when I disable the shader when in game. What do you mean by hud_depth in x += separation * hud_depth ?

Posted 11/28/2015 06:18 PM   
[quote="tonka"]Left and right of my character there is a faint light green duplication of his whole body in 3D, also the body on the right has it.[/quote]I stil can't see it on the screenshot you posted, even zooming in and examining each 2D image - are you sure it's not just crosstalk from your monitor? [quote]This game also has some vs 2_0 shaders including Vertex Shader 0 which I need to convert to vs 3_0 for helixmod to work don't I ? I know how to do that. What about ps shaders - do both 2_0 and 3_0 work with helixmod ?[/quote]Yeah, you will need to convert them to shader model 3. You can use my shadertool.py for this, convert them manually by hand, or use mana84's converter: http://helixmod.blogspot.com.au/2013/05/vs11vs20-vs30-converter.html Of the two tools I'd recommend mine - it can handle pixel shaders and a bunch of edge cases that mana's tool misses (plus you can play with the --auto-fix-vertex-halo and other options I have built into it). [quote]If I disable Vertex Shader 0 I get a black screen when starting the game so I guess that is the shader for the menu and HUD. It will probably be difficult to differentiate between the two, I guess. Both 0 shaders have very few instructions, how is that possible for menu screens and HUD ?[/quote]HUD vertex shaders generally don't have many instructions because the coordinates have already been calculated by the game, so there's not much for the vertex shader to do (probably just scaling the coordinates to the range DX needs), and the pixel shader is usually just copying a texture to the screen so it also doesn't have much to do either. [quote]Yes, the HUD disappears when I disable the shader when in game. What do you mean by hud_depth in x += separation * hud_depth ?[/quote]hud_depth is the depth you want to move the HUD to - 0 is screen depth, 1 is infinity, negative numbers pop out of the screen.
tonka said:Left and right of my character there is a faint light green duplication of his whole body in 3D, also the body on the right has it.
I stil can't see it on the screenshot you posted, even zooming in and examining each 2D image - are you sure it's not just crosstalk from your monitor?

This game also has some vs 2_0 shaders including Vertex Shader 0 which I need to convert to vs 3_0 for helixmod to work don't I ? I know how to do that. What about ps shaders - do both 2_0 and 3_0 work with helixmod ?
Yeah, you will need to convert them to shader model 3. You can use my shadertool.py for this, convert them manually by hand, or use mana84's converter:


http://helixmod.blogspot.com.au/2013/05/vs11vs20-vs30-converter.html


Of the two tools I'd recommend mine - it can handle pixel shaders and a bunch of edge cases that mana's tool misses (plus you can play with the --auto-fix-vertex-halo and other options I have built into it).

If I disable Vertex Shader 0 I get a black screen when starting the game so I guess that is the shader for the menu and HUD. It will probably be difficult to differentiate between the two, I guess. Both 0 shaders have very few instructions, how is that possible for menu screens and HUD ?
HUD vertex shaders generally don't have many instructions because the coordinates have already been calculated by the game, so there's not much for the vertex shader to do (probably just scaling the coordinates to the range DX needs), and the pixel shader is usually just copying a texture to the screen so it also doesn't have much to do either.

Yes, the HUD disappears when I disable the shader when in game. What do you mean by hud_depth in x += separation * hud_depth ?
hud_depth is the depth you want to move the HUD to - 0 is screen depth, 1 is infinity, negative numbers pop out of the screen.

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 11/29/2015 02:30 AM   
You are dead right, I checked it on my projector and it is my monitor. I have never seen this behaviour with stereo 3D before, sorry to cause you work for nothing. Could you give me an actual example of code for pushing the HUD into depth. I would expect to change the z value but you say in the formula x and why is it added ? I have now found an example in Legend of Grimrock 2. [code]def c200, 0.80, 0, 0.0625, 0 def c201, .01, .15, 0.0625, .30 def c220, 0, 0, 0, 0 def c222, 1, 2, 3, 4 dcl_position v0 dcl_color v1 dcl_texcoord v2 dcl_2d s0 dcl_position o0 dcl_color o1 dcl_texcoord o2.xy dp4 r3.x, c0, v0 dp4 r3.y, c1, v0 dp4 r3.z, c2, v0 dp4 r3.w, c3, v0 texldl r1, c200.z, s0 mov r15.x, c250.y mov r10.x, c201.x if_eq r15.x, c222.x mov r10.x, c201.x endif if_eq r15.x, c222.y mov r10.x, c201.y endif if_eq r15.x, c222.z mov r10.x, c201.w endif if_eq r3.w, c222.x mul r1.x, r1.x, -r10.x add r3.x, r3.x, -r1.x endif mov o0, r3 mov o1, v1 mov o2.xy, v2 [/code] Why is he multiplying with a negative number and then adding with the same value negative ? I made a change in the vertex shader and now I see the ground shadows in the right place but they are all flickering like mad and there are weird shadows on the rocks - what causes that ? These are the shadow shaders, I think. [code] vs_3_0 dcl_position o0 dcl_texcoord o1 dcl_texcoord1 o2 def c4, 0.01000214, 1, 0.5, 0 dcl_position v0 add r0.xy, v0, c4.y mul r0.xy, r0, c4.z add r0.y, -r0, c4 mov o1.xy, r0 add o2.xy, r0, c0 mov o0.xy, v0 mov o0.zw, c4.xyxy [/code] [code] ps_3_0 dcl_2d s0 dcl_2d s1 dcl_2d s2 dcl_2d s3 def c29, 1, 0.00390625, 1.52600005e-005, 0 def c30, 2, -1, 1, 0.5 def c31, 0.00392156979, 1.53799992e-005, -0.000200030001, 2000 def c32, 0.25, 0, 0, 0 dcl_texcoord v0.xy dcl_texcoord1 v1.xy texld_pp r0.xyz, v1, s0 dp3 r1.w, r0, c29 add r0.x, r1.w, -c24.z cmp_pp r0.y, -r0.x, c29.x, c29.w cmp_pp oC0, -r0.x, c29.w, c29.x if_gt r0.y, c29.w mad r0.x, v0, c30, c30.y mov r0.w, c29.x mad r0.y, -v0, c30.x, c30.z mov r0.z, r1.w dp4 r1.x, r0, c23 rcp r2.x, r1.x dp4 r1.z, r0, c22 dp4 r1.y, r0, c21 dp4 r1.x, r0, c20 mul r2.xyz, r1, r2.x mov r0.w, c29.x if_lt r1.w, c24.x mov r1.xyz, r2 mov r1.w, c29.x dp4 r0.x, r1, c4 rcp r0.z, r0.x dp4 r0.y, r1, c2 dp4 r0.x, r1, c1 mul r0.xy, r0, r0.z mad r0.xy, r0, c30.w, c30.w add r1.y, -r0, c29.x mov r1.x, r0 add r0.xy, r1, c28 mov r0.z, c29.w texldl r3.xyz, r0.xyzz, s1 mad r1.z, r3.y, c31.x, r3 mad r3.w, r3.x, c31.y, r1.z add r0.xy, r1, c27 mov r0.z, c29.w texldl r0.xyz, r0.xyzz, s1 mad r0.y, r0, c31.x, r0.z mad r3.z, r0.x, c31.y, r0.y add r0.xy, r1, c26 mov r0.z, c29.w texldl r0.xyz, r0.xyzz, s1 mad r0.y, r0, c31.x, r0.z mov r1.z, c29.w add r1.xy, r1, c25 texldl r1.xyz, r1.xyzz, s1 mad r0.z, r1.y, c31.x, r1 mad r3.x, r1, c31.y, r0.z mad r3.y, r0.x, c31, r0 add r0.xyz, r2, -c5 mov r1.x, c6 mov r1.y, c6 else if_lt r1.w, c24.y mov r1.xyz, r2 mov r1.w, c29.x dp4 r0.x, r1, c10 rcp r0.z, r0.x dp4 r0.y, r1, c8 dp4 r0.x, r1, c7 mul r0.xy, r0, r0.z mad r0.xy, r0, c30.w, c30.w add r0.y, -r0, c29.x add r1.xy, r0, c28 mov r1.z, c29.w texldl r3.xyz, r1.xyzz, s2 mad r0.z, r3.y, c31.x, r3 mad r3.w, r3.x, c31.y, r0.z add r1.xy, r0, c27 mov r1.z, c29.w texldl r1.xyz, r1.xyzz, s2 mad r1.y, r1, c31.x, r1.z mad r3.z, r1.x, c31.y, r1.y add r1.xy, r0, c26 mov r1.z, c29.w texldl r1.xyz, r1.xyzz, s2 mad r1.y, r1, c31.x, r1.z mad r3.y, r1.x, c31, r1 mov r0.z, c29.w add r0.xy, r0, c25 texldl r0.xyz, r0.xyzz, s2 mad r0.y, r0, c31.x, r0.z mad r3.x, r0, c31.y, r0.y add r0.xyz, r2, -c11 mov r1.x, c12 mov r1.y, c12 else mov r0.xyz, r2 mov r0.w, c29.x dp4 r1.x, r0, c16 rcp r1.z, r1.x dp4 r1.y, r0, c14 dp4 r1.x, r0, c13 mul r0.xy, r1, r1.z mad r0.xy, r0, c30.w, c30.w add r0.y, -r0, c29.x add r1.xy, r0, c28 mov r1.z, c29.w texldl r3.xyz, r1.xyzz, s3 mad r0.z, r3.y, c31.x, r3 mad r3.w, r3.x, c31.y, r0.z add r1.xy, r0, c27 mov r1.z, c29.w texldl r1.xyz, r1.xyzz, s3 mad r0.w, r1.y, c31.x, r1.z mad r3.z, r1.x, c31.y, r0.w add r1.xy, r0, c26 mov r1.z, c29.w texldl r1.xyz, r1.xyzz, s3 mad r0.w, r1.y, c31.x, r1.z mad r3.y, r1.x, c31, r0.w add r0.w, c24.z, -c24 rcp r1.x, r0.w add r0.w, -r1, c24.z mul_sat r0.w, r0, r1.x mov r0.z, c29.w add r0.xy, r0, c25 texldl r0.xyz, r0.xyzz, s3 mad r0.y, r0, c31.x, r0.z mad r3.x, r0, c31.y, r0.y add r0.xyz, r2, -c17 mov r1.x, c18 mov r1.y, c18 endif endif dp3 r0.x, r0, c19 add r1.y, -r1.x, r1 add r0.x, r0, -r1 rcp r0.y, r1.y mul r0.x, r0, r0.y add_pp r0.x, r0, c31.z add r1, r0.x, -r3 mul_sat r1, r1, c31.w dp4_pp r0.x, r1, c32.x mad oC0, -r0.x, r0.w, c29.x endif [/code]
You are dead right, I checked it on my projector and it is my monitor. I have never seen this behaviour with stereo 3D before, sorry to cause you work for nothing.

Could you give me an actual example of code for pushing the HUD into depth. I would expect to change the z value but you say in the formula x and why is it added ? I have now found an example in Legend of Grimrock 2.

def c200, 0.80, 0, 0.0625, 0
def c201, .01, .15, 0.0625, .30
def c220, 0, 0, 0, 0
def c222, 1, 2, 3, 4
dcl_position v0
dcl_color v1
dcl_texcoord v2
dcl_2d s0
dcl_position o0
dcl_color o1
dcl_texcoord o2.xy
dp4 r3.x, c0, v0
dp4 r3.y, c1, v0
dp4 r3.z, c2, v0
dp4 r3.w, c3, v0
texldl r1, c200.z, s0
mov r15.x, c250.y
mov r10.x, c201.x
if_eq r15.x, c222.x
mov r10.x, c201.x
endif
if_eq r15.x, c222.y
mov r10.x, c201.y
endif
if_eq r15.x, c222.z
mov r10.x, c201.w
endif
if_eq r3.w, c222.x
mul r1.x, r1.x, -r10.x
add r3.x, r3.x, -r1.x
endif
mov o0, r3
mov o1, v1
mov o2.xy, v2


Why is he multiplying with a negative number and then adding with the same value negative ?

I made a change in the vertex shader and now I see the ground shadows in the right place but they are all flickering like mad and there are weird shadows on the rocks - what causes that ?

These are the shadow shaders, I think.

vs_3_0
dcl_position o0
dcl_texcoord o1
dcl_texcoord1 o2
def c4, 0.01000214, 1, 0.5, 0
dcl_position v0
add r0.xy, v0, c4.y
mul r0.xy, r0, c4.z
add r0.y, -r0, c4
mov o1.xy, r0
add o2.xy, r0, c0
mov o0.xy, v0
mov o0.zw, c4.xyxy


ps_3_0
dcl_2d s0
dcl_2d s1
dcl_2d s2
dcl_2d s3
def c29, 1, 0.00390625, 1.52600005e-005, 0
def c30, 2, -1, 1, 0.5
def c31, 0.00392156979, 1.53799992e-005, -0.000200030001, 2000
def c32, 0.25, 0, 0, 0
dcl_texcoord v0.xy
dcl_texcoord1 v1.xy
texld_pp r0.xyz, v1, s0
dp3 r1.w, r0, c29
add r0.x, r1.w, -c24.z
cmp_pp r0.y, -r0.x, c29.x, c29.w
cmp_pp oC0, -r0.x, c29.w, c29.x
if_gt r0.y, c29.w
mad r0.x, v0, c30, c30.y
mov r0.w, c29.x
mad r0.y, -v0, c30.x, c30.z
mov r0.z, r1.w
dp4 r1.x, r0, c23
rcp r2.x, r1.x
dp4 r1.z, r0, c22
dp4 r1.y, r0, c21
dp4 r1.x, r0, c20
mul r2.xyz, r1, r2.x
mov r0.w, c29.x
if_lt r1.w, c24.x
mov r1.xyz, r2
mov r1.w, c29.x
dp4 r0.x, r1, c4
rcp r0.z, r0.x
dp4 r0.y, r1, c2
dp4 r0.x, r1, c1
mul r0.xy, r0, r0.z
mad r0.xy, r0, c30.w, c30.w
add r1.y, -r0, c29.x
mov r1.x, r0
add r0.xy, r1, c28
mov r0.z, c29.w
texldl r3.xyz, r0.xyzz, s1
mad r1.z, r3.y, c31.x, r3
mad r3.w, r3.x, c31.y, r1.z
add r0.xy, r1, c27
mov r0.z, c29.w
texldl r0.xyz, r0.xyzz, s1
mad r0.y, r0, c31.x, r0.z
mad r3.z, r0.x, c31.y, r0.y
add r0.xy, r1, c26
mov r0.z, c29.w
texldl r0.xyz, r0.xyzz, s1
mad r0.y, r0, c31.x, r0.z
mov r1.z, c29.w
add r1.xy, r1, c25
texldl r1.xyz, r1.xyzz, s1
mad r0.z, r1.y, c31.x, r1
mad r3.x, r1, c31.y, r0.z
mad r3.y, r0.x, c31, r0
add r0.xyz, r2, -c5
mov r1.x, c6
mov r1.y, c6
else
if_lt r1.w, c24.y
mov r1.xyz, r2
mov r1.w, c29.x
dp4 r0.x, r1, c10
rcp r0.z, r0.x
dp4 r0.y, r1, c8
dp4 r0.x, r1, c7
mul r0.xy, r0, r0.z
mad r0.xy, r0, c30.w, c30.w
add r0.y, -r0, c29.x
add r1.xy, r0, c28
mov r1.z, c29.w
texldl r3.xyz, r1.xyzz, s2
mad r0.z, r3.y, c31.x, r3
mad r3.w, r3.x, c31.y, r0.z
add r1.xy, r0, c27
mov r1.z, c29.w
texldl r1.xyz, r1.xyzz, s2
mad r1.y, r1, c31.x, r1.z
mad r3.z, r1.x, c31.y, r1.y
add r1.xy, r0, c26
mov r1.z, c29.w
texldl r1.xyz, r1.xyzz, s2
mad r1.y, r1, c31.x, r1.z
mad r3.y, r1.x, c31, r1
mov r0.z, c29.w
add r0.xy, r0, c25
texldl r0.xyz, r0.xyzz, s2
mad r0.y, r0, c31.x, r0.z
mad r3.x, r0, c31.y, r0.y
add r0.xyz, r2, -c11
mov r1.x, c12
mov r1.y, c12
else
mov r0.xyz, r2
mov r0.w, c29.x
dp4 r1.x, r0, c16
rcp r1.z, r1.x
dp4 r1.y, r0, c14
dp4 r1.x, r0, c13
mul r0.xy, r1, r1.z
mad r0.xy, r0, c30.w, c30.w
add r0.y, -r0, c29.x
add r1.xy, r0, c28
mov r1.z, c29.w
texldl r3.xyz, r1.xyzz, s3
mad r0.z, r3.y, c31.x, r3
mad r3.w, r3.x, c31.y, r0.z
add r1.xy, r0, c27
mov r1.z, c29.w
texldl r1.xyz, r1.xyzz, s3
mad r0.w, r1.y, c31.x, r1.z
mad r3.z, r1.x, c31.y, r0.w
add r1.xy, r0, c26
mov r1.z, c29.w
texldl r1.xyz, r1.xyzz, s3
mad r0.w, r1.y, c31.x, r1.z
mad r3.y, r1.x, c31, r0.w
add r0.w, c24.z, -c24
rcp r1.x, r0.w
add r0.w, -r1, c24.z
mul_sat r0.w, r0, r1.x
mov r0.z, c29.w
add r0.xy, r0, c25
texldl r0.xyz, r0.xyzz, s3
mad r0.y, r0, c31.x, r0.z
mad r3.x, r0, c31.y, r0.y
add r0.xyz, r2, -c17
mov r1.x, c18
mov r1.y, c18
endif
endif
dp3 r0.x, r0, c19
add r1.y, -r1.x, r1
add r0.x, r0, -r1
rcp r0.y, r1.y
mul r0.x, r0, r0.y
add_pp r0.x, r0, c31.z
add r1, r0.x, -r3
mul_sat r1, r1, c31.w
dp4_pp r0.x, r1, c32.x
mad oC0, -r0.x, r0.w, c29.x
endif

Posted 11/29/2015 01:51 PM   
[quote="tonka"]Could you give me an actual example of code for pushing the HUD into depth. I would expect to change the z value but you say in the formula x and why is it added ? I have now found an example in Legend of Grimrock 2.[/quote] This specific question is answered in Bo3b's School for ShaderHackers. I read through this thread, and about 2/3 of your questions are answered in my lessons there. Have you done the lessons? Not just read them, did the exercises? The reason this is important is because you are using up some of DarkStarSword's time to answer questions you should already know. That's the exact reason I took the time to make those lessons in the first place- so that we don't have to answer the same questions over and over, and we can all use the same terminology. Don't try to run before you can walk, the fundamentals are super important.
tonka said:Could you give me an actual example of code for pushing the HUD into depth. I would expect to change the z value but you say in the formula x and why is it added ? I have now found an example in Legend of Grimrock 2.

This specific question is answered in Bo3b's School for ShaderHackers. I read through this thread, and about 2/3 of your questions are answered in my lessons there.

Have you done the lessons? Not just read them, did the exercises?

The reason this is important is because you are using up some of DarkStarSword's time to answer questions you should already know. That's the exact reason I took the time to make those lessons in the first place- so that we don't have to answer the same questions over and over, and we can all use the same terminology.

Don't try to run before you can walk, the fundamentals are super important.

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 11/30/2015 03:13 AM   
  45 / 88    
Scroll To Top