I saw the documentation in the d3dx.ini but I wasn't sure how to use it in a shader, thanks. I only have a desktop but I didn't think of discover mode, that is a possibility, I have the glasses.
I think that you are quite young, I am probably the oldest prospective shader hacker that there is. I was a computer operator on 2nd & 3rd generation mainframes (ICL 1500, IBM 360 & ICL System 4), then I became a programmer but of commercial software although I have programmed micro code, assembler and modified a compiler. I have worked for Friden (old computer division of Singer), Nixdorf, Siemens and the last years a small software house which developed its own package on Win dows for car dealers. Now I am retired at the age of 67 (so plenty of time to do shader hacking) and my hobby is computer games.
I have a 3D monitor but nowadays I always play on a projector and almost only in Stereo 3D but I have quite a few games which are completely broken and there is no fix so I thought it would be a fun idea to learn shader hacking and try to fix them myself however I am having a hard time understanding how 3D works - what are matrices in 3D terms ?. I will study your comments and try to understand them.
I am an Englishman living in Holland, you are an Australian I believe so we have completely different time zones - 10 hours difference ?
So now you know a bit more about the person you are helping. I could gift you the game which would make it easier to communicate, that's absolutely no problem. I don't expect you to solve it for me, just use it to give me advice.
I saw the documentation in the d3dx.ini but I wasn't sure how to use it in a shader, thanks. I only have a desktop but I didn't think of discover mode, that is a possibility, I have the glasses.
I think that you are quite young, I am probably the oldest prospective shader hacker that there is. I was a computer operator on 2nd & 3rd generation mainframes (ICL 1500, IBM 360 & ICL System 4), then I became a programmer but of commercial software although I have programmed micro code, assembler and modified a compiler. I have worked for Friden (old computer division of Singer), Nixdorf, Siemens and the last years a small software house which developed its own package on Win dows for car dealers. Now I am retired at the age of 67 (so plenty of time to do shader hacking) and my hobby is computer games.
I have a 3D monitor but nowadays I always play on a projector and almost only in Stereo 3D but I have quite a few games which are completely broken and there is no fix so I thought it would be a fun idea to learn shader hacking and try to fix them myself however I am having a hard time understanding how 3D works - what are matrices in 3D terms ?. I will study your comments and try to understand them.
I am an Englishman living in Holland, you are an Australian I believe so we have completely different time zones - 10 hours difference ?
So now you know a bit more about the person you are helping. I could gift you the game which would make it easier to communicate, that's absolutely no problem. I don't expect you to solve it for me, just use it to give me advice.
Nice to meet you tonka!
Your prior experience with assembly languages is sure to come in handy. I myself had experience in PPC and x86 assembly (both writing it, and reverse engineering code written by others) before I started here, which made picking up shader assembly easy.
I'm 29 and currently working as a Software Engineer in one of IBM's most well regarded open source labs ([url]http://ozlabs.org/about.html[/url]). I mostly do quite low level work there close to the hardware - hacking on the Linux kernel, device drivers, PPC assembly, FPGAs, etc.
Computer graphics has always been a particularly interesting subject to me, and I had dabbled in DirectX and OpenGL programming on and off for well over a decade before I joined this community, so I was already somewhat familiar with how games work which was probably an advantage when I started out shaderhacking (although I still had a lot to learn, having only ever used the fixed rendering pipeline before that).
I now have a pretty good understanding of the maths involved with computer graphics, but I think a lot can still be achieved without an in depth knowledge as a lot of our fixes involve recognising patterns (like spotting a matrix multiply as a sequence of four dot products or a mul/mad/mad/add sequence with consecutive constant registers) and a whole lot of trial and error - understanding the maths has been most useful to develop new fixes for some of the harder effects in unknown games/engines.
Maths has always been a fairly strong subject for me (I would have easily been in the top two of my class in high school, although my university lecturers were not cut out for teaching so I didn't formally continue with it). Unfortunately the particular field of maths most relevant to video games (linear algebra) was not taught at all in the region I grew up in, and I'd only covered the basics while dabbling with computer graphics, so this was one area I focussed on a lot and experimented with to really gain a deep understanding (some of my experiments using python and numpy: [url]https://github.com/DarkStarSword/3d-fixes/blob/master/matrix.py[/url]).
If you read up on linear algebrea yourself keep in mind that video games are restricted to a relatively small practical subset of the field, so it's most useful to read resources that are aimed at game developers rather than resources aimed at pure theoretical mathematicians. In particular, games use the four dimensional homogeneous coordinate system because it allows them to use matrix multiplications to arbitrarily move, scale and rotate three dimensional coordinates between different frames of reference (things get a little more involved in the projection matrix that does actually use the homogeneous w coordinate, but only to store the coordinate's original depth).
If you want to gift me the game I won't say no as long as there are no strings attached - just add me as a friend on Steam, same username as here.
Your prior experience with assembly languages is sure to come in handy. I myself had experience in PPC and x86 assembly (both writing it, and reverse engineering code written by others) before I started here, which made picking up shader assembly easy.
I'm 29 and currently working as a Software Engineer in one of IBM's most well regarded open source labs (http://ozlabs.org/about.html). I mostly do quite low level work there close to the hardware - hacking on the Linux kernel, device drivers, PPC assembly, FPGAs, etc.
Computer graphics has always been a particularly interesting subject to me, and I had dabbled in DirectX and OpenGL programming on and off for well over a decade before I joined this community, so I was already somewhat familiar with how games work which was probably an advantage when I started out shaderhacking (although I still had a lot to learn, having only ever used the fixed rendering pipeline before that).
I now have a pretty good understanding of the maths involved with computer graphics, but I think a lot can still be achieved without an in depth knowledge as a lot of our fixes involve recognising patterns (like spotting a matrix multiply as a sequence of four dot products or a mul/mad/mad/add sequence with consecutive constant registers) and a whole lot of trial and error - understanding the maths has been most useful to develop new fixes for some of the harder effects in unknown games/engines.
Maths has always been a fairly strong subject for me (I would have easily been in the top two of my class in high school, although my university lecturers were not cut out for teaching so I didn't formally continue with it). Unfortunately the particular field of maths most relevant to video games (linear algebra) was not taught at all in the region I grew up in, and I'd only covered the basics while dabbling with computer graphics, so this was one area I focussed on a lot and experimented with to really gain a deep understanding (some of my experiments using python and numpy: https://github.com/DarkStarSword/3d-fixes/blob/master/matrix.py).
If you read up on linear algebrea yourself keep in mind that video games are restricted to a relatively small practical subset of the field, so it's most useful to read resources that are aimed at game developers rather than resources aimed at pure theoretical mathematicians. In particular, games use the four dimensional homogeneous coordinate system because it allows them to use matrix multiplications to arbitrarily move, scale and rotate three dimensional coordinates between different frames of reference (things get a little more involved in the projection matrix that does actually use the homogeneous w coordinate, but only to store the coordinate's original depth).
If you want to gift me the game I won't say no as long as there are no strings attached - just add me as a friend on Steam, same username as here.
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
Nice to meet you DarkStarSword,
The assembly languages I used were on computers which stored programs and data on large cards with a magnetic stripe which were read in via a chute, updated and then ejected. The programs could be run and modified in the memory but had to be saved back to the cards. The save utility refused to update used cards so an essential item for programmers was a magnet which we used to clear the stripes when we saved the program. Next I worked on computers of which the hard disks were a complete cabinet. On windows I worked with a Basic language called V/Pro from an American firm called Basis who also has a 50% share in my old software house. They now have a language called BBJ which uses a Java interpreter. The HLSL code is not so difficult for me to understand but the whole structure with 4 components on a register and the matrix business is new to me, in fact programming games is a completely new experience but you are never too old to learn.
Previously I used to only play adventures because I like puzzles (I played The Longest Journey and Dreamfall and I have Dreamfall Chapters which I know you fixed but I still haven't played it) but nowadays I only play 3D games. I like using motion controls so I have a Razor Hydra which I program and use for almost every game and now I am using voice control (VoiceBot) also which adds a new dimension to games. I must say shader hacking is fun but I wish that I understood a bit more of what is going on. Will you tell me the various patterns and how to react to them.
I am busy with Vapour now checking all the shaders that I marked to see if they have any effect or not using Discover which was a great idea and saves a lot of time - a lot of them don't seem to have any effect. when I get stuck I will ask you for help if that's ok. I am a perfectionist from the work point of view so we will see how far I come.
You have now the game.
The assembly languages I used were on computers which stored programs and data on large cards with a magnetic stripe which were read in via a chute, updated and then ejected. The programs could be run and modified in the memory but had to be saved back to the cards. The save utility refused to update used cards so an essential item for programmers was a magnet which we used to clear the stripes when we saved the program. Next I worked on computers of which the hard disks were a complete cabinet. On windows I worked with a Basic language called V/Pro from an American firm called Basis who also has a 50% share in my old software house. They now have a language called BBJ which uses a Java interpreter. The HLSL code is not so difficult for me to understand but the whole structure with 4 components on a register and the matrix business is new to me, in fact programming games is a completely new experience but you are never too old to learn.
Previously I used to only play adventures because I like puzzles (I played The Longest Journey and Dreamfall and I have Dreamfall Chapters which I know you fixed but I still haven't played it) but nowadays I only play 3D games. I like using motion controls so I have a Razor Hydra which I program and use for almost every game and now I am using voice control (VoiceBot) also which adds a new dimension to games. I must say shader hacking is fun but I wish that I understood a bit more of what is going on. Will you tell me the various patterns and how to react to them.
I am busy with Vapour now checking all the shaders that I marked to see if they have any effect or not using Discover which was a great idea and saves a lot of time - a lot of them don't seem to have any effect. when I get stuck I will ask you for help if that's ok. I am a perfectionist from the work point of view so we will see how far I come.
I have been trying to signup on the Wiki, it says "What is the one true name of the God of 3D?" on the signup page. I don't know what to put. It keeps saying incorrect. Frustrating.
Edit: I figured it out. Its helix. BTW, is helix the same as helifax?
I have been trying to signup on the Wiki, it says "What is the one true name of the God of 3D?" on the signup page. I don't know what to put. It keeps saying incorrect. Frustrating.
Edit: I figured it out. Its helix. BTW, is helix the same as helifax?
[quote="flyoffacliff"]I have been trying to signup on the Wiki, it says "What is the one true name of the God of 3D?" on the signup page. I don't know what to put. It keeps saying incorrect. Frustrating.
Edit: I figured it out. Its helix. BTW, is helix the same as helifax?[/quote]
Great! Welcome. Sorry about the quiz, we needed something that those freakin' loser spamheads would get stumped on, but would be pretty clear for a 3D enthusiast. Since we put that up, no more spam, which we like.
Helifax != Helix Helix was the original mastermind who came up with the idea of fixing 3D by hacking the shaders directly. This was a pretty unique idea, and we've carried it to great lengths. Helixfax is our resident OpenGL guru, and made his own wrapper+stereoization driver for OpenGL.
flyoffacliff said:I have been trying to signup on the Wiki, it says "What is the one true name of the God of 3D?" on the signup page. I don't know what to put. It keeps saying incorrect. Frustrating.
Edit: I figured it out. Its helix. BTW, is helix the same as helifax?
Great! Welcome. Sorry about the quiz, we needed something that those freakin' loser spamheads would get stumped on, but would be pretty clear for a 3D enthusiast. Since we put that up, no more spam, which we like.
Helifax != Helix Helix was the original mastermind who came up with the idea of fixing 3D by hacking the shaders directly. This was a pretty unique idea, and we've carried it to great lengths. Helixfax is our resident OpenGL guru, and made his own wrapper+stereoization driver for OpenGL.
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
[quote="bo3b"][quote="flyoffacliff"]I have been trying to signup on the Wiki, it says "What is the one true name of the God of 3D?" on the signup page. I don't know what to put. It keeps saying incorrect. Frustrating.
Edit: I figured it out. Its helix. BTW, is helix the same as helifax?[/quote]
Great! Welcome. Sorry about the quiz, we needed something that those freakin' loser spamheads would get stumped on, but would be pretty clear for a 3D enthusiast. Since we put that up, no more spam, which we like.
Helifax != Helix Helix was the original mastermind who came up with the idea of fixing 3D by hacking the shaders directly. This was a pretty unique idea, and we've carried it to great lengths. Helixfax is our resident OpenGL guru, and made his own wrapper+stereoization driver for OpenGL. [/quote]
That is okay. Thank you.
From the research I conducted, this is what I think so far:
* Helix Mod = Supports only DX9 games. Original wrapper, no longer supported. Doesn't it have issues with Windows 8.1 and later?
* 3DMigoto = Supports only DX11 games. Is it backwards compatible with DX9?
* Helixfax's Wrapper - Supports only OpenGL.
* Flugan's Wrapper = Similer to helixmod, but rewritten for DX10 and Windows 8.1 plus support.
Is all of that correct? Thank you
flyoffacliff said:I have been trying to signup on the Wiki, it says "What is the one true name of the God of 3D?" on the signup page. I don't know what to put. It keeps saying incorrect. Frustrating.
Edit: I figured it out. Its helix. BTW, is helix the same as helifax?
Great! Welcome. Sorry about the quiz, we needed something that those freakin' loser spamheads would get stumped on, but would be pretty clear for a 3D enthusiast. Since we put that up, no more spam, which we like.
Helifax != Helix Helix was the original mastermind who came up with the idea of fixing 3D by hacking the shaders directly. This was a pretty unique idea, and we've carried it to great lengths. Helixfax is our resident OpenGL guru, and made his own wrapper+stereoization driver for OpenGL.
That is okay. Thank you.
From the research I conducted, this is what I think so far:
* Helix Mod = Supports only DX9 games. Original wrapper, no longer supported. Doesn't it have issues with Windows 8.1 and later?
* 3DMigoto = Supports only DX11 games. Is it backwards compatible with DX9?
* Helixfax's Wrapper - Supports only OpenGL.
* Flugan's Wrapper = Similer to helixmod, but rewritten for DX10 and Windows 8.1 plus support.
[quote="flyoffacliff"][quote="bo3b"][quote="flyoffacliff"]I have been trying to signup on the Wiki, it says "What is the one true name of the God of 3D?" on the signup page. I don't know what to put. It keeps saying incorrect. Frustrating.
Edit: I figured it out. Its helix. BTW, is helix the same as helifax?[/quote]
Great! Welcome. Sorry about the quiz, we needed something that those freakin' loser spamheads would get stumped on, but would be pretty clear for a 3D enthusiast. Since we put that up, no more spam, which we like.
Helifax != Helix Helix was the original mastermind who came up with the idea of fixing 3D by hacking the shaders directly. This was a pretty unique idea, and we've carried it to great lengths. Helixfax is our resident OpenGL guru, and made his own wrapper+stereoization driver for OpenGL. [/quote]
That is okay. Thank you.
From the research I conducted, this is what I think so far:
* Helix Mod = Supports only DX9 games. Original wrapper, no longer supported. Doesn't it have issues with Windows 8.1 and later?
* 3DMigoto = Supports only DX11 games. Is it backwards compatible with DX9?
* Helixfax's Wrapper - Supports only OpenGL.
* Flugan's Wrapper = Similer to helixmod, but rewritten for DX10 and Windows 8.1 plus support.
Is all of that correct? Thank you[/quote]
Not quite right.
* Helix Mod = only supports DX9. Still works on other OSes. 32 bit only. DX9 is dramatically simpler than DX11, and has no DXGI support, so it should still run fine on Win10. There is one version that runs on DX11 for Bioshock Infinite, but I think no one uses it now that we have good support in 3Dmigoto.
* 3Dmigoto: DX11 only. 32 bit and 64 bit versions. No DX9 version, although I have a work in progress for someday (no real need because HelixMod is very fully featured.) Experimental DX10 version, but DX10 games are very few.
* Helifax's wrapper. OpenGL only. Supports multiple generations of OpenGL (sort of like DX9-DX11), including antique ARB shaders for Star Wars.
* Flugan's wrapper. Only supports DX11, and can load any 3Dmigoto fix. Uses hooking instead of wrapping, and can work in situations, especially different OSes, where 3Dmigoto will crash.
flyoffacliff said:I have been trying to signup on the Wiki, it says "What is the one true name of the God of 3D?" on the signup page. I don't know what to put. It keeps saying incorrect. Frustrating.
Edit: I figured it out. Its helix. BTW, is helix the same as helifax?
Great! Welcome. Sorry about the quiz, we needed something that those freakin' loser spamheads would get stumped on, but would be pretty clear for a 3D enthusiast. Since we put that up, no more spam, which we like.
Helifax != Helix Helix was the original mastermind who came up with the idea of fixing 3D by hacking the shaders directly. This was a pretty unique idea, and we've carried it to great lengths. Helixfax is our resident OpenGL guru, and made his own wrapper+stereoization driver for OpenGL.
That is okay. Thank you.
From the research I conducted, this is what I think so far:
* Helix Mod = Supports only DX9 games. Original wrapper, no longer supported. Doesn't it have issues with Windows 8.1 and later?
* 3DMigoto = Supports only DX11 games. Is it backwards compatible with DX9?
* Helixfax's Wrapper - Supports only OpenGL.
* Flugan's Wrapper = Similer to helixmod, but rewritten for DX10 and Windows 8.1 plus support.
Is all of that correct? Thank you
Not quite right.
* Helix Mod = only supports DX9. Still works on other OSes. 32 bit only. DX9 is dramatically simpler than DX11, and has no DXGI support, so it should still run fine on Win10. There is one version that runs on DX11 for Bioshock Infinite, but I think no one uses it now that we have good support in 3Dmigoto.
* 3Dmigoto: DX11 only. 32 bit and 64 bit versions. No DX9 version, although I have a work in progress for someday (no real need because HelixMod is very fully featured.) Experimental DX10 version, but DX10 games are very few.
* Helifax's wrapper. OpenGL only. Supports multiple generations of OpenGL (sort of like DX9-DX11), including antique ARB shaders for Star Wars.
* Flugan's wrapper. Only supports DX11, and can load any 3Dmigoto fix. Uses hooking instead of wrapping, and can work in situations, especially different OSes, where 3Dmigoto will crash.
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
I've been meedling in different things;) and I finally begin to understand how the magic "StereFlagsDX10" is working. Or at least (from what I've seen) what it affects except the "one eye rendering".
Is related to how Compute shaders are working in stereo as well, hence the one eye WHITE image when things are not stereorized;)
In any case, I am trying to enable "WorldRender.LightTilePathCsEnable 1" in Frostbyte 3 engines;) and managed to find my value for the "StereFlagsDX10" setting.
Basically, this line says: Enable Tile Lighting Deferred Rendering;) The Cs comes from Compute Shader;)
And, yes is using compute shaders (as I found out by 3DMigoto way).
So, first this is how it looks like:
(Notice the black boxes? That is the bounding area in which it calculates the light)
Now same image when left+right eye are at the same parallax (both images fuse to be one, aka screen depth). Notice how the bounding boxes "fit" in both eyes.
Which leads me to believe I need to stereo this compute shader.
Is anyone willing to please tell me how I:
- get rid of the compiling issues
- stereo this shader?:)
Thank you in advance;)
Edit: Sorry for Surround images.
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
The decompiler still needs a fair bit of work to handle instructions unique to compute, domain, hull and geometry shaders properly (looks like it isn't even defining the UAVs / RWStructuredBuffers properly, nor is it using the right syntax to write to them).
When we have needed to edit these types shaders so far we have edited the assembly instead which can handle all this stuff (but has it's own set of gotchas, like forgetting to declare the stereo texture or increment dcl_temps working, but destabilising the game increasing the likelihood of a crash down the line, or omitting a parameter in an instruction causing a CTD from the assembler).
As for how to stereoise this particular shader... I'm not sure, but I don't think it's possible to do so from within the shader itself (and in fact I don't think this shader needs any adjustments). Looking at the screenshots and examining the code I would bet good money that there is something else external to this shader that decides which tiles to run it on and that is what will need to be fixed - and whatever is making that decision is either only running on the data for the right eye, or it's result is being stored in a mono buffer that we would need to identify and force to stereo.
This might be where you need to use frame analysis to study what the game is doing before it runs this shader - start by dumping out the textures for that shader to identify the Texture2D loaded in cs-t0. If you're lucky it will just be a matter of using a [TextureOverride] to force that texture to stereo, but there might be problems earlier in the frame that you need to solve - if you dump out the render targets leading up to the compute shader you might find a matching one.
Now, if you are very unlucky this might get even more complicated - I would guess that they are likely using DispatchIndirect() to run the compute shader instead of Dispatch() (no way to confirm this yet, though you could easily add more log messages to 3DMigoto), which takes a buffer to decide how many threads to spawn. If that is the case, that buffer might also need to be stereoised to make this work in 3D (otherwise the left eye might not have enough threads running for the amount of tiles it needs to process). Frame analysis only has limited support for buffers yet (and not the ones we would be looking for), and 3DMigoto currently offers no way to force them to stereo (until the other day I didn't even think they could be, then I discovered the driver does in fact use a stereo buffer internally so now I'm thinking it might be possible to force them, but we need more code to do this). This is something StereoFlagsDX10 might control, but I can't be certain without either documentation or experimental results.
The decompiler still needs a fair bit of work to handle instructions unique to compute, domain, hull and geometry shaders properly (looks like it isn't even defining the UAVs / RWStructuredBuffers properly, nor is it using the right syntax to write to them).
When we have needed to edit these types shaders so far we have edited the assembly instead which can handle all this stuff (but has it's own set of gotchas, like forgetting to declare the stereo texture or increment dcl_temps working, but destabilising the game increasing the likelihood of a crash down the line, or omitting a parameter in an instruction causing a CTD from the assembler).
As for how to stereoise this particular shader... I'm not sure, but I don't think it's possible to do so from within the shader itself (and in fact I don't think this shader needs any adjustments). Looking at the screenshots and examining the code I would bet good money that there is something else external to this shader that decides which tiles to run it on and that is what will need to be fixed - and whatever is making that decision is either only running on the data for the right eye, or it's result is being stored in a mono buffer that we would need to identify and force to stereo.
This might be where you need to use frame analysis to study what the game is doing before it runs this shader - start by dumping out the textures for that shader to identify the Texture2D loaded in cs-t0. If you're lucky it will just be a matter of using a [TextureOverride] to force that texture to stereo, but there might be problems earlier in the frame that you need to solve - if you dump out the render targets leading up to the compute shader you might find a matching one.
Now, if you are very unlucky this might get even more complicated - I would guess that they are likely using DispatchIndirect() to run the compute shader instead of Dispatch() (no way to confirm this yet, though you could easily add more log messages to 3DMigoto), which takes a buffer to decide how many threads to spawn. If that is the case, that buffer might also need to be stereoised to make this work in 3D (otherwise the left eye might not have enough threads running for the amount of tiles it needs to process). Frame analysis only has limited support for buffers yet (and not the ones we would be looking for), and 3DMigoto currently offers no way to force them to stereo (until the other day I didn't even think they could be, then I discovered the driver does in fact use a stereo buffer internally so now I'm thinking it might be possible to force them, but we need more code to do this). This is something StereoFlagsDX10 might control, but I can't be certain without either documentation or experimental results.
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
I am trying to use helixmod to fix a game (How to Survive Third Person). The game uses a Log.txt for logging and helixmod uses the same name for logging which causes an error message when starting the game. Is there a possibility to use a different name for the log in helixmod ?
I am trying to use helixmod to fix a game (How to Survive Third Person). The game uses a Log.txt for logging and helixmod uses the same name for logging which causes an error message when starting the game. Is there a possibility to use a different name for the log in helixmod ?
If Helix Mod isn't able to open LOG.txt it will try LOG1.txt instead, but it sounds like it must be opening the log file before the game. GetCurDirAtLoad might change where Helix Mod creates the log file, but it probably won't help.
Your best bet is probably to hexedit the d3d9.dll and replace the LOG.txt string located at 0x9328C with an alternate filename (looks like there's room for an extra four characters if you wanted).
If Helix Mod isn't able to open LOG.txt it will try LOG1.txt instead, but it sounds like it must be opening the log file before the game. GetCurDirAtLoad might change where Helix Mod creates the log file, but it probably won't help.
Your best bet is probably to hexedit the d3d9.dll and replace the LOG.txt string located at 0x9328C with an alternate filename (looks like there's room for an extra four characters if you wanted).
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
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. If I Alt-Tab out of the game is it possible to view that log, I get access denied.
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 ?
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.
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. If I Alt-Tab out of the game is it possible to view that log, I get access denied.
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 ?
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="DarkStarSword"]The decompiler still needs a fair bit of work to handle instructions unique to compute, domain, hull and geometry shaders properly (looks like it isn't even defining the UAVs / RWStructuredBuffers properly, nor is it using the right syntax to write to them).
When we have needed to edit these types shaders so far we have edited the assembly instead which can handle all this stuff (but has it's own set of gotchas, like forgetting to declare the stereo texture or increment dcl_temps working, but destabilising the game increasing the likelihood of a crash down the line, or omitting a parameter in an instruction causing a CTD from the assembler).
As for how to stereoise this particular shader... I'm not sure, but I don't think it's possible to do so from within the shader itself (and in fact I don't think this shader needs any adjustments). Looking at the screenshots and examining the code I would bet good money that there is something else external to this shader that decides which tiles to run it on and that is what will need to be fixed - and whatever is making that decision is either only running on the data for the right eye, or it's result is being stored in a mono buffer that we would need to identify and force to stereo.
This might be where you need to use frame analysis to study what the game is doing before it runs this shader - start by dumping out the textures for that shader to identify the Texture2D loaded in cs-t0. If you're lucky it will just be a matter of using a [TextureOverride] to force that texture to stereo, but there might be problems earlier in the frame that you need to solve - if you dump out the render targets leading up to the compute shader you might find a matching one.
Now, if you are very unlucky this might get even more complicated - I would guess that they are likely using DispatchIndirect() to run the compute shader instead of Dispatch() (no way to confirm this yet, though you could easily add more log messages to 3DMigoto), which takes a buffer to decide how many threads to spawn. If that is the case, that buffer might also need to be stereoised to make this work in 3D (otherwise the left eye might not have enough threads running for the amount of tiles it needs to process). Frame analysis only has limited support for buffers yet (and not the ones we would be looking for), and 3DMigoto currently offers no way to force them to stereo (until the other day I didn't even think they could be, then I discovered the driver does in fact use a stereo buffer internally so now I'm thinking it might be possible to force them, but we need more code to do this). This is something StereoFlagsDX10 might control, but I can't be certain without either documentation or experimental results.[/quote]
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;)
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:
[code]
cbuffer cb0 : register(b0)
{
float4x4 invViewProjectionMatrix : packoffset(c0);
uint2 resolutionMinusOne : packoffset(c4);
float2 invResolutionTimesBlockSize : packoffset(c4.z);
uint tileCountX : packoffset(c5);
uint tileCountY : packoffset(c5.y);
uint maxLightsInLightList : packoffset(c5.z);
uint cullAppendPassMaterialPassType : packoffset(c5.w);
uint lightInfoCount_Punctual : packoffset(c6);
uint lightInfoCount_PunctualShadow : packoffset(c6.y);
uint lightInfoCount_Area : packoffset(c6.z);
uint lightInfoCount_AreaShadow : packoffset(c6.w);
uint lightInfoCount_LocalIBL : packoffset(c7);
uint lightInfoCount_LocalPR : packoffset(c7.y);
uint unused1 : packoffset(c7.z);
uint unused2 : packoffset(c7.w);
uint2 coarseToFineTileShift : packoffset(c8);
uint2 coarseToFineInputTileRes : packoffset(c8.z);
}
Texture2D<uint> g_materialIdTileMaskTexture : register(t0);
StructuredBuffer<g_lightCullInput> g_lightCullInput : register(t1);
Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);
void main()
{
float4 r0,r1,r2;
uint4 bitmask, uiDest;
float4 fDest;
r0.x = (uint)vThreadID.x < tileCountX;
if (r0.x != 0) {
r0.xy = vThreadID.xy;
r0.zw = float2(0,0);
r0.x = g_materialIdTileMaskTexture.Load(r0.xyz).x;
r0.x = (int)r0.x == 1;
r0.y = cullAppendPassMaterialPassType == 0;
r0.x = (int)r0.y == (int)r0.x;
if (r0.x != 0) {
r0.x = mad((int)vThreadID.y, tileCountX, (int)vThreadID.x);
// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.xyz, r0.x, l(4), t1.xyzx
r0.x = g_materialIdTileMaskTexture[]..swiz;
r0.y = g_materialIdTileMaskTexture[]..swiz;
r0.z = g_materialIdTileMaskTexture[]..swiz;
r1.xyz = (uint3)r0.xyz >> int3(16,16,16);
r0.xyz = r0.xyz ? 0.000000 : 0;
r1.zw = (int2)r1.xz + (int2)r0.xz;
r0.w = (int)r0.y + (int)r1.z;
r0.w = (int)r1.y + (int)r0.w;
r1.z = (uint)vThreadID.x << 16;
r1.z = (int)r1.z | (int)vThreadID.y;
if (r0.w != 0) {
r0.x = (int)r0.w == (int)r0.x;
if (r0.x != 0) {
// Needs manual fix for instruction:
// imm_atomic_alloc r2.x, u0
InterlockedExchange ?(dest, value, orig_value);
g_materialIdTileMaskTexture[r2.x].0 = u0.x;
} else {
r0.x = (int)r0.w == (int)r1.x;
if (r0.x != 0) {
// Needs manual fix for instruction:
// imm_atomic_alloc r2.x, u1
InterlockedExchange ?(dest, value, orig_value);
g_materialIdTileMaskTexture[r2.x].0 = u1.x;
} else {
r0.x = (int)r0.w == (int)r0.y;
if (r0.x != 0) {
// Needs manual fix for instruction:
// imm_atomic_alloc r2.x, u2
InterlockedExchange ?(dest, value, orig_value);
g_materialIdTileMaskTexture[r2.x].0 = u2.x;
} else {
r0.x = (int)r0.w == (int)r1.y;
if (r0.x != 0) {
// Needs manual fix for instruction:
// imm_atomic_alloc r2.x, u3
InterlockedExchange ?(dest, value, orig_value);
g_materialIdTileMaskTexture[r2.x].0 = u3.x;
} else {
// Needs manual fix for instruction:
// imm_atomic_alloc r2.x, u6
InterlockedExchange ?(dest, value, orig_value);
g_materialIdTileMaskTexture[r2.x].0 = u6.x;
}
}
}
}
}
if (r1.w != 0) {
r0.x = (int)r0.z == (int)r1.w;
if (r0.x != 0) {
// Needs manual fix for instruction:
// imm_atomic_alloc r0.x, u4
InterlockedExchange ?(dest, value, orig_value);
g_materialIdTileMaskTexture[r0.x].0 = u4.x;
} else {
// Needs manual fix for instruction:
// imm_atomic_alloc r0.x, u5
InterlockedExchange ?(dest, value, orig_value);
g_materialIdTileMaskTexture[r0.x].0 = u5.x;
}
}
}
}
return;
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
// using 3Dmigoto v1.2.10 on Thu Nov 26 19:52:40 2015
//
//
// Buffer Definitions:
//
// cbuffer cb0
// {
//
// float4x4 invViewProjectionMatrix; // Offset: 0 Size: 64 [unused]
// uint2 resolutionMinusOne; // Offset: 64 Size: 8 [unused]
// float2 invResolutionTimesBlockSize;// Offset: 72 Size: 8 [unused]
// uint tileCountX; // Offset: 80 Size: 4
// uint tileCountY; // Offset: 84 Size: 4 [unused]
// uint maxLightsInLightList; // Offset: 88 Size: 4 [unused]
// uint cullAppendPassMaterialPassType;// Offset: 92 Size: 4
// uint lightInfoCount_Punctual; // Offset: 96 Size: 4 [unused]
// uint lightInfoCount_PunctualShadow;// Offset: 100 Size: 4 [unused]
// uint lightInfoCount_Area; // Offset: 104 Size: 4 [unused]
// uint lightInfoCount_AreaShadow; // Offset: 108 Size: 4 [unused]
// uint lightInfoCount_LocalIBL; // Offset: 112 Size: 4 [unused]
// uint lightInfoCount_LocalPR; // Offset: 116 Size: 4 [unused]
// uint unused1; // Offset: 120 Size: 4 [unused]
// uint unused2; // Offset: 124 Size: 4 [unused]
// uint2 coarseToFineTileShift; // Offset: 128 Size: 8 [unused]
// uint2 coarseToFineInputTileRes; // Offset: 136 Size: 8 [unused]
//
// }
//
// Resource bind info for g_lightCullInput
// {
//
// uint4 $Element; // Offset: 0 Size: 16
//
// }
//
// Resource bind info for g_compactTileGridUav_Punctual
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
// Resource bind info for g_compactTileGridUav_PunctualShadow
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
// Resource bind info for g_compactTileGridUav_Area
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
// Resource bind info for g_compactTileGridUav_AreaShadow
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
// Resource bind info for g_compactTileGridUav_LocalIBL
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
// Resource bind info for g_compactTileGridUav_LocalIBLAndPR
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
// Resource bind info for g_compactTileGridUav_AllLights
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_materialIdTileMaskTexture texture uint 2d 0 1
// g_lightCullInput texture struct r/o 1 1
// g_compactTileGridUav_Punctual UAV struct append 0 1
// g_compactTileGridUav_PunctualShadow UAV struct append 1 1
// g_compactTileGridUav_Area UAV struct append 2 1
// g_compactTileGridUav_AreaShadow UAV struct append 3 1
// g_compactTileGridUav_LocalIBL UAV struct append 4 1
// g_compactTileGridUav_LocalIBLAndPR UAV struct append 5 1
// g_compactTileGridUav_AllLights UAV struct append 6 1
// cb0 cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Input
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
cs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[6], immediateIndexed
dcl_resource_texture2d (uint,uint,uint,uint) t0
dcl_resource_structured t1, 16
dcl_uav_structured u0, 4
dcl_uav_structured u1, 4
dcl_uav_structured u2, 4
dcl_uav_structured u3, 4
dcl_uav_structured u4, 4
dcl_uav_structured u5, 4
dcl_uav_structured u6, 4
dcl_input vThreadID.xy
dcl_temps 3
dcl_thread_group 64, 1, 1
ult r0.x, vThreadID.x, cb0[5].x
if_nz r0.x
mov r0.xy, vThreadID.xyxx
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(uint,uint,uint,uint) r0.x, r0.xyzw, t0.xyzw
ieq r0.x, r0.x, l(1)
ieq r0.y, cb0[5].w, l(0)
ieq r0.x, r0.y, r0.x
if_nz r0.x
imad r0.x, vThreadID.y, cb0[5].x, vThreadID.x
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.xyz, r0.x, l(4), t1.xyzx
ushr r1.xyz, r0.xyzx, l(16, 16, 16, 0)
and r0.xyz, r0.xyzx, l(0x0000ffff, 0x0000ffff, 0x0000ffff, 0)
iadd r1.zw, r1.xxxz, r0.xxxz
iadd r0.w, r0.y, r1.z
iadd r0.w, r1.y, r0.w
ishl r1.z, vThreadID.x, l(16)
or r1.z, r1.z, vThreadID.y
if_nz r0.w
ieq r0.x, r0.w, r0.x
if_nz r0.x
imm_atomic_alloc r2.x, u0
store_structured u0.x, r2.x, l(0), r1.z
else
ieq r0.x, r0.w, r1.x
if_nz r0.x
imm_atomic_alloc r2.x, u1
store_structured u1.x, r2.x, l(0), r1.z
else
ieq r0.x, r0.w, r0.y
if_nz r0.x
imm_atomic_alloc r2.x, u2
store_structured u2.x, r2.x, l(0), r1.z
else
ieq r0.x, r0.w, r1.y
if_nz r0.x
imm_atomic_alloc r2.x, u3
store_structured u3.x, r2.x, l(0), r1.z
else
imm_atomic_alloc r2.x, u6
store_structured u6.x, r2.x, l(0), r1.z
endif
endif
endif
endif
endif
if_nz r1.w
ieq r0.x, r0.z, r1.w
if_nz r0.x
imm_atomic_alloc r0.x, u4
store_structured u4.x, r0.x, l(0), r1.z
else
imm_atomic_alloc r0.x, u5
store_structured u5.x, r0.x, l(0), r1.z
endif
endif
endif
endif
ret
// Approximately 59 instruction slots used
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
[/code]
Any idea how I can make this one stereo? (It renders in 2D)
The ASM is below;)
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)
DarkStarSword said:The decompiler still needs a fair bit of work to handle instructions unique to compute, domain, hull and geometry shaders properly (looks like it isn't even defining the UAVs / RWStructuredBuffers properly, nor is it using the right syntax to write to them).
When we have needed to edit these types shaders so far we have edited the assembly instead which can handle all this stuff (but has it's own set of gotchas, like forgetting to declare the stereo texture or increment dcl_temps working, but destabilising the game increasing the likelihood of a crash down the line, or omitting a parameter in an instruction causing a CTD from the assembler).
As for how to stereoise this particular shader... I'm not sure, but I don't think it's possible to do so from within the shader itself (and in fact I don't think this shader needs any adjustments). Looking at the screenshots and examining the code I would bet good money that there is something else external to this shader that decides which tiles to run it on and that is what will need to be fixed - and whatever is making that decision is either only running on the data for the right eye, or it's result is being stored in a mono buffer that we would need to identify and force to stereo.
This might be where you need to use frame analysis to study what the game is doing before it runs this shader - start by dumping out the textures for that shader to identify the Texture2D loaded in cs-t0. If you're lucky it will just be a matter of using a [TextureOverride] to force that texture to stereo, but there might be problems earlier in the frame that you need to solve - if you dump out the render targets leading up to the compute shader you might find a matching one.
Now, if you are very unlucky this might get even more complicated - I would guess that they are likely using DispatchIndirect() to run the compute shader instead of Dispatch() (no way to confirm this yet, though you could easily add more log messages to 3DMigoto), which takes a buffer to decide how many threads to spawn. If that is the case, that buffer might also need to be stereoised to make this work in 3D (otherwise the left eye might not have enough threads running for the amount of tiles it needs to process). Frame analysis only has limited support for buffers yet (and not the ones we would be looking for), and 3DMigoto currently offers no way to force them to stereo (until the other day I didn't even think they could be, then I discovered the driver does in fact use a stereo buffer internally so now I'm thinking it might be possible to force them, but we need more code to do this). This is something StereoFlagsDX10 might control, but I can't be certain without either documentation or experimental results.
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;)
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:
Any idea how I can make this one stereo? (It renders in 2D)
The ASM is below;)
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)
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
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
I think that you are quite young, I am probably the oldest prospective shader hacker that there is. I was a computer operator on 2nd & 3rd generation mainframes (ICL 1500, IBM 360 & ICL System 4), then I became a programmer but of commercial software although I have programmed micro code, assembler and modified a compiler. I have worked for Friden (old computer division of Singer), Nixdorf, Siemens and the last years a small software house which developed its own package on Win dows for car dealers. Now I am retired at the age of 67 (so plenty of time to do shader hacking) and my hobby is computer games.
I have a 3D monitor but nowadays I always play on a projector and almost only in Stereo 3D but I have quite a few games which are completely broken and there is no fix so I thought it would be a fun idea to learn shader hacking and try to fix them myself however I am having a hard time understanding how 3D works - what are matrices in 3D terms ?. I will study your comments and try to understand them.
I am an Englishman living in Holland, you are an Australian I believe so we have completely different time zones - 10 hours difference ?
So now you know a bit more about the person you are helping. I could gift you the game which would make it easier to communicate, that's absolutely no problem. I don't expect you to solve it for me, just use it to give me advice.
Your prior experience with assembly languages is sure to come in handy. I myself had experience in PPC and x86 assembly (both writing it, and reverse engineering code written by others) before I started here, which made picking up shader assembly easy.
I'm 29 and currently working as a Software Engineer in one of IBM's most well regarded open source labs (http://ozlabs.org/about.html). I mostly do quite low level work there close to the hardware - hacking on the Linux kernel, device drivers, PPC assembly, FPGAs, etc.
Computer graphics has always been a particularly interesting subject to me, and I had dabbled in DirectX and OpenGL programming on and off for well over a decade before I joined this community, so I was already somewhat familiar with how games work which was probably an advantage when I started out shaderhacking (although I still had a lot to learn, having only ever used the fixed rendering pipeline before that).
I now have a pretty good understanding of the maths involved with computer graphics, but I think a lot can still be achieved without an in depth knowledge as a lot of our fixes involve recognising patterns (like spotting a matrix multiply as a sequence of four dot products or a mul/mad/mad/add sequence with consecutive constant registers) and a whole lot of trial and error - understanding the maths has been most useful to develop new fixes for some of the harder effects in unknown games/engines.
Maths has always been a fairly strong subject for me (I would have easily been in the top two of my class in high school, although my university lecturers were not cut out for teaching so I didn't formally continue with it). Unfortunately the particular field of maths most relevant to video games (linear algebra) was not taught at all in the region I grew up in, and I'd only covered the basics while dabbling with computer graphics, so this was one area I focussed on a lot and experimented with to really gain a deep understanding (some of my experiments using python and numpy: https://github.com/DarkStarSword/3d-fixes/blob/master/matrix.py).
If you read up on linear algebrea yourself keep in mind that video games are restricted to a relatively small practical subset of the field, so it's most useful to read resources that are aimed at game developers rather than resources aimed at pure theoretical mathematicians. In particular, games use the four dimensional homogeneous coordinate system because it allows them to use matrix multiplications to arbitrarily move, scale and rotate three dimensional coordinates between different frames of reference (things get a little more involved in the projection matrix that does actually use the homogeneous w coordinate, but only to store the coordinate's original depth).
If you want to gift me the game I won't say no as long as there are no strings attached - just add me as a friend on Steam, same username as here.
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
The assembly languages I used were on computers which stored programs and data on large cards with a magnetic stripe which were read in via a chute, updated and then ejected. The programs could be run and modified in the memory but had to be saved back to the cards. The save utility refused to update used cards so an essential item for programmers was a magnet which we used to clear the stripes when we saved the program. Next I worked on computers of which the hard disks were a complete cabinet. On windows I worked with a Basic language called V/Pro from an American firm called Basis who also has a 50% share in my old software house. They now have a language called BBJ which uses a Java interpreter. The HLSL code is not so difficult for me to understand but the whole structure with 4 components on a register and the matrix business is new to me, in fact programming games is a completely new experience but you are never too old to learn.
Previously I used to only play adventures because I like puzzles (I played The Longest Journey and Dreamfall and I have Dreamfall Chapters which I know you fixed but I still haven't played it) but nowadays I only play 3D games. I like using motion controls so I have a Razor Hydra which I program and use for almost every game and now I am using voice control (VoiceBot) also which adds a new dimension to games. I must say shader hacking is fun but I wish that I understood a bit more of what is going on. Will you tell me the various patterns and how to react to them.
I am busy with Vapour now checking all the shaders that I marked to see if they have any effect or not using Discover which was a great idea and saves a lot of time - a lot of them don't seem to have any effect. when I get stuck I will ask you for help if that's ok. I am a perfectionist from the work point of view so we will see how far I come.
You have now the game.
Edit: I figured it out. Its helix. BTW, is helix the same as helifax?
Monitor: ASUS VG248 :: CPU: i7 4770 3.5Ghz :: Mobo: MSI Z87-G45 :: RAM: 16GB 1600Mhz :: GPU: Gigabyte GeForce GTX 770 4GB :: OS: Windows 10 64-bit :: Storage: 256GB SSD :: Wheel: Logitech G27
Great! Welcome. Sorry about the quiz, we needed something that those freakin' loser spamheads would get stumped on, but would be pretty clear for a 3D enthusiast. Since we put that up, no more spam, which we like.
Helifax != Helix Helix was the original mastermind who came up with the idea of fixing 3D by hacking the shaders directly. This was a pretty unique idea, and we've carried it to great lengths. Helixfax is our resident OpenGL guru, and made his own wrapper+stereoization driver for OpenGL.
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
That is okay. Thank you.
From the research I conducted, this is what I think so far:
* Helix Mod = Supports only DX9 games. Original wrapper, no longer supported. Doesn't it have issues with Windows 8.1 and later?
* 3DMigoto = Supports only DX11 games. Is it backwards compatible with DX9?
* Helixfax's Wrapper - Supports only OpenGL.
* Flugan's Wrapper = Similer to helixmod, but rewritten for DX10 and Windows 8.1 plus support.
Is all of that correct? Thank you
Monitor: ASUS VG248 :: CPU: i7 4770 3.5Ghz :: Mobo: MSI Z87-G45 :: RAM: 16GB 1600Mhz :: GPU: Gigabyte GeForce GTX 770 4GB :: OS: Windows 10 64-bit :: Storage: 256GB SSD :: Wheel: Logitech G27
Not quite right.
* Helix Mod = only supports DX9. Still works on other OSes. 32 bit only. DX9 is dramatically simpler than DX11, and has no DXGI support, so it should still run fine on Win10. There is one version that runs on DX11 for Bioshock Infinite, but I think no one uses it now that we have good support in 3Dmigoto.
* 3Dmigoto: DX11 only. 32 bit and 64 bit versions. No DX9 version, although I have a work in progress for someday (no real need because HelixMod is very fully featured.) Experimental DX10 version, but DX10 games are very few.
* Helifax's wrapper. OpenGL only. Supports multiple generations of OpenGL (sort of like DX9-DX11), including antique ARB shaders for Star Wars.
* Flugan's wrapper. Only supports DX11, and can load any 3Dmigoto fix. Uses hooking instead of wrapping, and can work in situations, especially different OSes, where 3Dmigoto will crash.
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
I've been meedling in different things;) and I finally begin to understand how the magic "StereFlagsDX10" is working. Or at least (from what I've seen) what it affects except the "one eye rendering".
Is related to how Compute shaders are working in stereo as well, hence the one eye WHITE image when things are not stereorized;)
In any case, I am trying to enable "WorldRender.LightTilePathCsEnable 1" in Frostbyte 3 engines;) and managed to find my value for the "StereFlagsDX10" setting.
Basically, this line says: Enable Tile Lighting Deferred Rendering;) The Cs comes from Compute Shader;)
And, yes is using compute shaders (as I found out by 3DMigoto way).
So, first this is how it looks like:
(Notice the black boxes? That is the bounding area in which it calculates the light)
Now same image when left+right eye are at the same parallax (both images fuse to be one, aka screen depth). Notice how the bounding boxes "fit" in both eyes.
Which leads me to believe I need to stereo this compute shader.
HOWEVER, when I dump I am greeted with this:
Is anyone willing to please tell me how I:
- get rid of the compiling issues
- stereo this shader?:)
Thank you in advance;)
Edit: Sorry for Surround images.
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)
When we have needed to edit these types shaders so far we have edited the assembly instead which can handle all this stuff (but has it's own set of gotchas, like forgetting to declare the stereo texture or increment dcl_temps working, but destabilising the game increasing the likelihood of a crash down the line, or omitting a parameter in an instruction causing a CTD from the assembler).
As for how to stereoise this particular shader... I'm not sure, but I don't think it's possible to do so from within the shader itself (and in fact I don't think this shader needs any adjustments). Looking at the screenshots and examining the code I would bet good money that there is something else external to this shader that decides which tiles to run it on and that is what will need to be fixed - and whatever is making that decision is either only running on the data for the right eye, or it's result is being stored in a mono buffer that we would need to identify and force to stereo.
This might be where you need to use frame analysis to study what the game is doing before it runs this shader - start by dumping out the textures for that shader to identify the Texture2D loaded in cs-t0. If you're lucky it will just be a matter of using a [TextureOverride] to force that texture to stereo, but there might be problems earlier in the frame that you need to solve - if you dump out the render targets leading up to the compute shader you might find a matching one.
Now, if you are very unlucky this might get even more complicated - I would guess that they are likely using DispatchIndirect() to run the compute shader instead of Dispatch() (no way to confirm this yet, though you could easily add more log messages to 3DMigoto), which takes a buffer to decide how many threads to spawn. If that is the case, that buffer might also need to be stereoised to make this work in 3D (otherwise the left eye might not have enough threads running for the amount of tiles it needs to process). Frame analysis only has limited support for buffers yet (and not the ones we would be looking for), and 3DMigoto currently offers no way to force them to stereo (until the other day I didn't even think they could be, then I discovered the driver does in fact use a stereo buffer internally so now I'm thinking it might be possible to force them, but we need more code to do this). This is something StereoFlagsDX10 might control, but I can't be certain without either documentation or experimental results.
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
Your best bet is probably to hexedit the d3d9.dll and replace the LOG.txt string located at 0x9328C with an alternate filename (looks like there's room for an extra four characters if you wanted).
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
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 ?
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.
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;)
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:
Any idea how I can make this one stereo? (It renders in 2D)
The ASM is below;)
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)
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)
How can I fix the "bad code" segment? ^_^
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)