3Dmigoto now open-source...
  67 / 143    
Thanks for the suggestions. First thing I tried was the MP3 profile... and then Tomb Raider/Batman:AC/any other 3D ready game, and even no profile at all. I also tried without having the 3DMigoto wrapper installed at all, to make sure that IT wasn't introducing this somehow, and it wasn't. (On a semi-related note, I earlier found that the rasterizer_disable_scissor=1 default setting in the d3dx.ini file was causing a pretty nasty slowdown issue!). I had originally thought of trying the compute shader setting, but didn't bother because this game doesn't use any CS's, but I just tried now and unfortunately didn't work. I did run frame analysis, and there's not a lot I can discern from it's output. I'll post up a link to a zip I made which includes the only the output for the relevant draw calls (I included the one immediately before where the broken shader occurs, all the buffer files for the broken shader, and then up until where you see the broken effect). If there's anything you can make out from the log or buffers, then I'd appreciate it. Basically, my theory is that for this one shader it thinks the output for both eyes are the same (the right eye) based on these observations: [list] [.]Standard stereo subtraction correction moves effect in both eyes in the same direction (to the left) rather than separating/diverging[/.] [.]Using the if(stereo.z>0) check affects both eyes. Using if(stereo.z<0) affects neither[/.] [.]This one is kinda hard to explain, but if I look at where the 'halo' or 'hole' is in the broken effect, and turn off my glasses, then whatever geometry object that the halo is of, the right eye image will have filled that gap (so, basically, that means that for that broken effect the separation amount is going in the wrong direction for that eye). Hope that makes sense.[/.] [/list]
Thanks for the suggestions. First thing I tried was the MP3 profile... and then Tomb Raider/Batman:AC/any other 3D ready game, and even no profile at all. I also tried without having the 3DMigoto wrapper installed at all, to make sure that IT wasn't introducing this somehow, and it wasn't. (On a semi-related note, I earlier found that the rasterizer_disable_scissor=1 default setting in the d3dx.ini file was causing a pretty nasty slowdown issue!). I had originally thought of trying the compute shader setting, but didn't bother because this game doesn't use any CS's, but I just tried now and unfortunately didn't work.

I did run frame analysis, and there's not a lot I can discern from it's output. I'll post up a link to a zip I made which includes the only the output for the relevant draw calls (I included the one immediately before where the broken shader occurs, all the buffer files for the broken shader, and then up until where you see the broken effect). If there's anything you can make out from the log or buffers, then I'd appreciate it.

Basically, my theory is that for this one shader it thinks the output for both eyes are the same (the right eye) based on these observations:
  • Standard stereo subtraction correction moves effect in both eyes in the same direction (to the left) rather than separating/diverging
  • Using the if(stereo.z>0) check affects both eyes. Using if(stereo.z<0) affects neither
  • This one is kinda hard to explain, but if I look at where the 'halo' or 'hole' is in the broken effect, and turn off my glasses, then whatever geometry object that the halo is of, the right eye image will have filled that gap (so, basically, that means that for that broken effect the separation amount is going in the wrong direction for that eye). Hope that makes sense.

3D Gaming Rig: CPU: i7 7700K @ 4.9Ghz | Mobo: Asus Maximus Hero VIII | RAM: Corsair Dominator 16GB | GPU: 2 x GTX 1080 Ti SLI | 3xSSDs for OS and Apps, 2 x HDD's for 11GB storage | PSU: Seasonic X-1250 M2| Case: Corsair C70 | Cooling: Corsair H115i Hydro cooler | Displays: Asus PG278QR, BenQ XL2420TX & BenQ HT1075 | OS: Windows 10 Pro + Windows 7 dual boot

Like my fixes? Dontations can be made to: www.paypal.me/DShanz or rshannonca@gmail.com
Like electronic music? Check out: www.soundcloud.com/dj-ryan-king

Posted 04/15/2016 07:33 PM   
You may need to identify a mono render target (or targets) and force them to stereo with 3DMigoto, or in some cases you may need to assign a dummy render target or depth buffer to influence driver heuristics (force_o0=1 in a shaderoverride section was a special option added add a dummy render target to solve a similar problem on a depth buffer pass of anti-aliased hairworks in Witcher 3, dummy depth buffers don't have an explicit option, but some arbitrary resource copying could be used to create & assign one - I don't have an example of this, but the way I created ResourceDepthBufferPuzzles in The Witness is somewhat close)
You may need to identify a mono render target (or targets) and force them to stereo with 3DMigoto, or in some cases you may need to assign a dummy render target or depth buffer to influence driver heuristics (force_o0=1 in a shaderoverride section was a special option added add a dummy render target to solve a similar problem on a depth buffer pass of anti-aliased hairworks in Witcher 3, dummy depth buffers don't have an explicit option, but some arbitrary resource copying could be used to create & assign one - I don't have an example of this, but the way I created ResourceDepthBufferPuzzles in The Witness is somewhat close)

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 04/16/2016 01:38 AM   
Assuming you meant 'fake_o0=1', then yeah, I actually tried that, but not sure if I did it correctly or not. I created a shaderoverride section for the VS, and included that in the section, but nothing happened. Not sure if anything more needed to be done in the shader or not. As for the rest, about identifying a mono render target, assigning a depth buffer, etc, this is where I'm unfortunately stuck and could use a little more information. Believe me, I've looked over almost all of your fixes for various things I've tried learning, and I'm often still left scratching my head asking "how did he do that/how did he figure that out?" In The Witness, in your d3dx.ini file, you include an override section where you state "Frame analysis log shows it uses the above depth buffer" but that doesn't really tell me how you determined that without seeing the log and/or knowing what you were looking for to determine. I've been struggling with figuring out how to extract any meaningful information using the frame analysis log for a while now because there was never really any documentation on how to use this effectively, what to look for, etc. There was some information done up for texture filtering, but even that I've struggled with because it isn't clear (for example, it says look for items with register id=0, but what if there are like 5 things with that ID? Are they always going to be register ID=0, or was that just for that example, and could a texture ever be in another ID slot?). I just realized I forgot to post the link to my FA output before... duh me! Here's the file: http://www.mediafire.com/download/18gojqu91dcden5/CoP_Broken_Bloom.zip I imagine you're too busy to tackle the task of writing up a whole set of instructions for everything I just mentioned, so do you think you could take a look at this output give me a little more specific instruction on this particular matter?
Assuming you meant 'fake_o0=1', then yeah, I actually tried that, but not sure if I did it correctly or not. I created a shaderoverride section for the VS, and included that in the section, but nothing happened. Not sure if anything more needed to be done in the shader or not.

As for the rest, about identifying a mono render target, assigning a depth buffer, etc, this is where I'm unfortunately stuck and could use a little more information. Believe me, I've looked over almost all of your fixes for various things I've tried learning, and I'm often still left scratching my head asking "how did he do that/how did he figure that out?" In The Witness, in your d3dx.ini file, you include an override section where you state "Frame analysis log shows it uses the above depth buffer" but that doesn't really tell me how you determined that without seeing the log and/or knowing what you were looking for to determine. I've been struggling with figuring out how to extract any meaningful information using the frame analysis log for a while now because there was never really any documentation on how to use this effectively, what to look for, etc. There was some information done up for texture filtering, but even that I've struggled with because it isn't clear (for example, it says look for items with register id=0, but what if there are like 5 things with that ID? Are they always going to be register ID=0, or was that just for that example, and could a texture ever be in another ID slot?).

I just realized I forgot to post the link to my FA output before... duh me! Here's the file: http://www.mediafire.com/download/18gojqu91dcden5/CoP_Broken_Bloom.zip

I imagine you're too busy to tackle the task of writing up a whole set of instructions for everything I just mentioned, so do you think you could take a look at this output give me a little more specific instruction on this particular matter?

3D Gaming Rig: CPU: i7 7700K @ 4.9Ghz | Mobo: Asus Maximus Hero VIII | RAM: Corsair Dominator 16GB | GPU: 2 x GTX 1080 Ti SLI | 3xSSDs for OS and Apps, 2 x HDD's for 11GB storage | PSU: Seasonic X-1250 M2| Case: Corsair C70 | Cooling: Corsair H115i Hydro cooler | Displays: Asus PG278QR, BenQ XL2420TX & BenQ HT1075 | OS: Windows 10 Pro + Windows 7 dual boot

Like my fixes? Dontations can be made to: www.paypal.me/DShanz or rshannonca@gmail.com
Like electronic music? Check out: www.soundcloud.com/dj-ryan-king

Posted 04/16/2016 04:51 AM   
That download site is hopeless - it's failed to download three times now. Can you email it to me instead: darkstarsword@gmail.com
That download site is hopeless - it's failed to download three times now. Can you email it to me instead: darkstarsword@gmail.com

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 04/16/2016 10:41 AM   
Hello again, here is another help request. With a lot of efforts and trials, I managed to mask labels in DCS by using PS shader injection to get a render target resource containing the cockpit frame surrounded by white. I used the resource to filter labels with a mask.Load(int3(value.xy),0) command and compare the given value to white. But this is only working in PS shaders... I want to use this mask in order to filter stereoize fix in HUD VSshader instead of the current texture filtering because it will work for all planes, unlike texture that are specific to each plane an has to be found. I can only steroize HUD in VS shader because there I did not find a way to shift the HUD display in the HUD PS shader (v0 is not used in the PS)... But my attempt to use the mask.Load in VS were unsuccessfull, it seems to me that it is because the coordinate I used in the VS shader are not appropriate. My problem is that I do not understand why. For example the fix is not working in the label VS with o0 coordinate conformed to screen resolution but is working in the label PS with v0 coordinates ! (there is one weird thing: I had to multiply by a factor 2 v0 of the PS to have the right result...). Labels are filtered in VS, but not at the right place... I convert o0.xy to screen resolution by using [code]xcoord.x = (tempo.x + 1)/2 * x3;[/code] where o0.x = tempo.x and x3 = screen X resol. I make some test to check that xcoord was in the right coordinate system by filtering VS output for half right part of screen (xcoord.x > 1920/2) and it seems to work. But the result of my filtering attempt by using [code]mask.Load(int3(xcoord.xy, 0))[/code] are not working as in PS... So what am I doing wrong ?
Hello again, here is another help request.
With a lot of efforts and trials, I managed to mask labels in DCS by using PS shader injection to get a render target resource containing the cockpit frame surrounded by white.
I used the resource to filter labels with a mask.Load(int3(value.xy),0) command and compare the given value to white.
But this is only working in PS shaders...
I want to use this mask in order to filter stereoize fix in HUD VSshader instead of the current texture filtering because it will work for all planes, unlike texture that are specific to each plane an has to be found.
I can only steroize HUD in VS shader because there I did not find a way to shift the HUD display in the HUD PS shader (v0 is not used in the PS)...
But my attempt to use the mask.Load in VS were unsuccessfull, it seems to me that it is because the coordinate I used in the VS shader are not appropriate.
My problem is that I do not understand why.
For example the fix is not working in the label VS with o0 coordinate conformed to screen resolution but is working in the label PS with v0 coordinates ! (there is one weird thing: I had to multiply by a factor 2 v0 of the PS to have the right result...). Labels are filtered in VS, but not at the right place...
I convert o0.xy to screen resolution by using
xcoord.x = (tempo.x + 1)/2 * x3;
where o0.x = tempo.x and x3 = screen X resol.

I make some test to check that xcoord was in the right coordinate system by filtering VS output for half right part of screen (xcoord.x > 1920/2) and it seems to work.
But the result of my filtering attempt by using
mask.Load(int3(xcoord.xy, 0))
are not working as in PS...

So what am I doing wrong ?

Posted 04/16/2016 03:52 PM   
[quote="helifax"] I had a quick idea related to the problem though: If the wrapper is looking and works if Nvapi.dll is present, what happens if (on a machine without nvidia drivers) you copy the nvapi.dll from an nvidia driver and put it next to the wrapper? The nvapi.dll that comes with 3DM is a proxy. I think you can swap it with a "real" one. While this is not a fix, this workaround should work;) (Since it was reported to work on a PC where nvapi was present which means 3DM is looking for it but not actually using it nor does the Windows Os). [/quote] Now I'm curious, I like to make HUD toggles with 3Dmigoto and it would be cool if AMD users could use them aswell. Where exactly is this "real" nvapi.dll file located? I can't find it :)
helifax said:
I had a quick idea related to the problem though: If the wrapper is looking and works if Nvapi.dll is present, what happens if (on a machine without nvidia drivers) you copy the nvapi.dll from an nvidia driver and put it next to the wrapper?

The nvapi.dll that comes with 3DM is a proxy. I think you can swap it with a "real" one.
While this is not a fix, this workaround should work;)
(Since it was reported to work on a PC where nvapi was present which means 3DM is looking for it but not actually using it nor does the Windows Os).


Now I'm curious, I like to make HUD toggles with 3Dmigoto and it would be cool if AMD users could use them aswell.

Where exactly is this "real" nvapi.dll file located? I can't find it :)

1080 Ti - i7 5820k - 16Gb RAM - Win 10 version 1607 - ASUS VG236H (1920x1080@120Hz)

Posted 04/16/2016 09:36 PM   
@DJ-RK by the looks of that frame analysis, the problem is that the game is downsampling using [b]square[/b] render targets, which the driver heuristics may think is a shadow map and treat as mono (depending on the game's profile - for DX11 I'm pretty sure it is the default, whereas for DX9 it wasn't). Try this: [code] [TextureOverrideDownsample512] hash=56060590 StereoMode=1 [TextureOverrideDownsample128] hash=cc2d0b81 StereoMode=1 [TextureOverrideDownsample16] hash=dddd426b StereoMode=1 [/code] You can see here that the hashes I've used came from the frame analysis, for each of the render targets that only had a valid image on the left and was either blank or garbage on the right. There's not that much documentation on this because tbh I lot of what I see seems to be pretty game specific and I'm still discovering new things with every game I look at, and the driver heuristics still don't always behave the way I think they should. In a frame analysis dump I'll usually be looking for something from the POV of the camera that does not look right, then trying to backtrack that to the earliest point it appears in the frame. Sometimes these are obviously blatantly broken, sometimes they are like this analysis with information missing from one eye (mono render target), or the same image used in both eyes (stereo render target with a mono image), but sometimes they can be quite subtle, and sometimes they can be hidden in an alpha channel or in a render target that failed to dump out (so keep an eye out for any missing draw call numbers, or any errors in the frame analysis log). A lot of the more advanced stuff is still down to intuition and haunches though - I'm pretty good at making good guesses (and being familiar with DX and how games use it helps), but they are still guesses. [quote="DJ-RK"]Assuming you meant 'fake_o0=1', then yeah, I actually tried that, but not sure if I did it correctly or not. I created a shaderoverride section for the VS, and included that in the section, but nothing happened. Not sure if anything more needed to be done in the shader or not.[/quote]Yeah, after seeing the frame analysis it's clear that in this case it wouldn't help because there are render targets assigned (o0) for the suspect draw calls. The time where it might be needed is if a game had a depth buffer assigned (oD), but no render targets at all. [quote]In The Witness, in your d3dx.ini file, you include an override section where you state "Frame analysis log shows it uses the above depth buffer" but that doesn't really tell me how you determined that without seeing the log and/or knowing what you were looking for to determine.[/quote]In that case I was looking for somewhere I could grab a copy of the depth buffer that I could use to add a stereo mouse cursor. Normally I use the lighting shaders for this purpose, but that only works for games using deferred lighting, which The Witness was not (a first clue being that shadows worked out of the box), so I used frame analysis to locate alternate shaders that had access to the depth buffer. If memory serves there may have been some complications in that game as well trying to work out how to scale the depth buffer depending on where I copied it from and some problems because it was always MSAA anti-aliased and certain surfaces were never drawn on it. [quote]There was some information done up for texture filtering, but even that I've struggled with because it isn't clear (for example, it says look for items with register id=0, but what if there are like 5 things with that ID? Are they always going to be register ID=0, or was that just for that example, and could a texture ever be in another ID slot?).[/quote]The ID slots there correspond to the texture slot number, and if you see multiple textures with the same ID that means they have been used in that slot at different times, so you might be trying to filter between those textures. Generally a shader will have it's main texture in one of the slots (often slot 0, but not always) and that is what you will want to filter on, and the other slots will be used for things like normal maps, specularity maps, etc.
@DJ-RK

by the looks of that frame analysis, the problem is that the game is downsampling using square render targets, which the driver heuristics may think is a shadow map and treat as mono (depending on the game's profile - for DX11 I'm pretty sure it is the default, whereas for DX9 it wasn't). Try this:

[TextureOverrideDownsample512]
hash=56060590
StereoMode=1

[TextureOverrideDownsample128]
hash=cc2d0b81
StereoMode=1

[TextureOverrideDownsample16]
hash=dddd426b
StereoMode=1


You can see here that the hashes I've used came from the frame analysis, for each of the render targets that only had a valid image on the left and was either blank or garbage on the right.

There's not that much documentation on this because tbh I lot of what I see seems to be pretty game specific and I'm still discovering new things with every game I look at, and the driver heuristics still don't always behave the way I think they should. In a frame analysis dump I'll usually be looking for something from the POV of the camera that does not look right, then trying to backtrack that to the earliest point it appears in the frame.

Sometimes these are obviously blatantly broken, sometimes they are like this analysis with information missing from one eye (mono render target), or the same image used in both eyes (stereo render target with a mono image), but sometimes they can be quite subtle, and sometimes they can be hidden in an alpha channel or in a render target that failed to dump out (so keep an eye out for any missing draw call numbers, or any errors in the frame analysis log).

A lot of the more advanced stuff is still down to intuition and haunches though - I'm pretty good at making good guesses (and being familiar with DX and how games use it helps), but they are still guesses.


DJ-RK said:Assuming you meant 'fake_o0=1', then yeah, I actually tried that, but not sure if I did it correctly or not. I created a shaderoverride section for the VS, and included that in the section, but nothing happened. Not sure if anything more needed to be done in the shader or not.
Yeah, after seeing the frame analysis it's clear that in this case it wouldn't help because there are render targets assigned (o0) for the suspect draw calls. The time where it might be needed is if a game had a depth buffer assigned (oD), but no render targets at all.

In The Witness, in your d3dx.ini file, you include an override section where you state "Frame analysis log shows it uses the above depth buffer" but that doesn't really tell me how you determined that without seeing the log and/or knowing what you were looking for to determine.
In that case I was looking for somewhere I could grab a copy of the depth buffer that I could use to add a stereo mouse cursor. Normally I use the lighting shaders for this purpose, but that only works for games using deferred lighting, which The Witness was not (a first clue being that shadows worked out of the box), so I used frame analysis to locate alternate shaders that had access to the depth buffer. If memory serves there may have been some complications in that game as well trying to work out how to scale the depth buffer depending on where I copied it from and some problems because it was always MSAA anti-aliased and certain surfaces were never drawn on it.

There was some information done up for texture filtering, but even that I've struggled with because it isn't clear (for example, it says look for items with register id=0, but what if there are like 5 things with that ID? Are they always going to be register ID=0, or was that just for that example, and could a texture ever be in another ID slot?).
The ID slots there correspond to the texture slot number, and if you see multiple textures with the same ID that means they have been used in that slot at different times, so you might be trying to filter between those textures. Generally a shader will have it's main texture in one of the slots (often slot 0, but not always) and that is what you will want to filter on, and the other slots will be used for things like normal maps, specularity maps, etc.

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 04/17/2016 07:22 AM   
@lefuneste it sounds like you are on the right track, and I'm not sure why it wouldn't be working for you. It might be a stupid question, but is xcoord.y set in much the same way as xcoord.x? If you can post the complete attempt I might be able to spot something.
@lefuneste it sounds like you are on the right track, and I'm not sure why it wouldn't be working for you. It might be a stupid question, but is xcoord.y set in much the same way as xcoord.x? If you can post the complete attempt I might be able to spot something.

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 04/17/2016 07:32 AM   
[quote="DarkStarSword"]@lefuneste If you can post the complete attempt I might be able to spot something.[/quote] Many thanks ! I enclosed 2 picture of labels, when non filtered and wrong filtered by VS, maybe it will help you (it doesn't help me...) Here is the non working VS shader: [code]//VS labels with mask (not working) cbuffer _Globals : register(b0) { float4 cv0 : packoffset(c0); float4 cv1 : packoffset(c1); float4 cv2 : packoffset(c2); float4 cv3 : packoffset(c3); float4 cv4 : packoffset(c4); float4 cv5 : packoffset(c5); float4 charArray[128] : packoffset(c6); float worldSpace : packoffset(c134) = float(0); float4x4 MVP : packoffset(c135); float4 charcolor : packoffset(c139); float epsilon : packoffset(c140) = float(9.99999975e-005); } Texture2D<float4> StereoParams : register(t78); Texture1D<float4> IniParams : register(t77); Texture2D<float4> t79 : register(t79); Texture2D<float4> t80 : register(t80); void main( float4 v0 : POSITION0, out float4 o0 : SV_POSITION0, out float2 o1 : TEXCOORD0) { float4 r0,r1; uint4 bitmask, uiDest; float4 fDest; float y1 = IniParams.Load(int2(1, 0)).y; float4 tmp, cockpit, water; float4 mountain; float4 result, tempo; float check, xcoord, ycoord; int width, height, levels, flag; float x3 = IniParams.Load(int2(3, 0)).x; float y3 = IniParams.Load(int2(3, 0)).y; r0.x = (uint)v0.z; r0.y = v0.x * charArray[r0.x].y + charArray[r0.x].x; r1.x = cv0.x + r0.y; r1.y = -v0.y * cv0.w + cv0.y; r1.z = 1; // o0.x = dot(r1.xyz, MVP._m00_m10_m30); // o0.y = dot(r1.xyz, MVP._m01_m11_m31); // o0.z = dot(r1.xyz, MVP._m02_m12_m32); // o0.w = dot(r1.xyz, MVP._m03_m13_m33); tempo.x = dot(r1.xyz, MVP._m00_m10_m30); tempo.y = dot(r1.xyz, MVP._m01_m11_m31); tempo.z = dot(r1.xyz, MVP._m02_m12_m32); tempo.w = dot(r1.xyz, MVP._m03_m13_m33); o0.xyzw = tempo.xyzw; r0.y = charArray[r0.x].y * v0.x; r0.y = r0.y * cv1.x + charArray[r0.x].z; r0.x = v0.y * cv0.z + charArray[r0.x].w; o1.xy = cv1.zw + r0.yx; float4 stereo = StereoParams.Load(0); float4 iniParams = IniParams.Load(0); o0.x+= stereo.x * (iniParams.x*y1 - stereo.y); xcoord = (tempo.x + 1)/2 * x3; ycoord = (tempo.y + 1)/2 * y3; tmp.x=xcoord*2; tmp.y=ycoord*2; water = t79.Load(int3(tmp.xy, 0)); cockpit = t80.Load(int3(tmp.xy, 0)); flag=0; check=0; result.x=cockpit.x-water.x; result.y=cockpit.y-water.y; result.z=cockpit.z-water.z; result.w=cockpit.w-water.w; if (water.z == 1) check=1; if ( !((abs(result.x) <= 0.001 && abs(result.y) <= 0.001 && abs(result.z) <= 0.001 ) || check == 1)) { o0.xyzw= float4(0,0,0,0); } return; }[/code] Here is the working PS shader:[code]// Labels PS cbuffer _Globals : register(b0) { float4 cv0 : packoffset(c0); float4 cv1 : packoffset(c1); float4 cv2 : packoffset(c2); float4 cv3 : packoffset(c3); float4 cv4 : packoffset(c4); float4 cv5 : packoffset(c5); float4 charArray[128] : packoffset(c6); float worldSpace : packoffset(c134) = {0}; float4x4 MVP : packoffset(c135); float4 charcolor : packoffset(c139); float epsilon : packoffset(c140) = {9.99999975e-005}; } SamplerState mySampler_s : register(s0); Texture2D<float4> FontTexture : register(t0); // 3Dmigoto declarations #define cmp - Texture2D<float4> StereoParams : register(t78); Texture1D<float4> IniParams : register(t77); Texture2D<float4> t100 : register(t100); Texture2D<float4> t101 : register(t101); void main( float4 v0 : SV_POSITION0, float2 v1 : TEXCOORD0, out float4 o0 : SV_TARGET0) { float4 r0; uint4 bitmask, uiDest; float4 fDest; float y1 = IniParams.Load(int2(1, 0)).y; float4 tmp, cockpit, water; float4 mountain; float4 result, tempo; float check, xcoord, ycoord; int width, height, levels, flag; float x3 = IniParams.Load(int2(3, 0)).x; float y3 = IniParams.Load(int2(3, 0)).y; r0.xyzw = FontTexture.Sample(mySampler_s, v1.xy).xyzw; o0.w = r0.w; o0.xyz = charcolor.xyz; tmp.x=v0.x*2; tmp.y=v0.y*2; water = t100.Load(int3(tmp.xy, 0)); cockpit = t101.Load(int3(tmp.xy, 0)); flag=0; check=0; result.x=cockpit.x-water.x; result.y=cockpit.y-water.y; result.z=cockpit.z-water.z; result.w=cockpit.w-water.w; if (water.z == 1) check=1; if ( !(abs(result.x) <= 0.001 && abs(result.y) <= 0.001 && abs(result.z) <= 0.001 ) || check == 1) { o0.w = 0; } return; }[/code] Here is the shader part of d3dx.ini (the label PS call is commented out in [ShaderOverrideLabels]). output-blue.hlsl and output-white.hlsl are pixel shader that return only a fixed value for o0. [code] [ResourcePerView] max_copies_per_frame = 1 [ResourceGround] max_copies_per_frame = 1 [ResourceWater] max_copies_per_frame = 1 [ResourceBackup0] max_copies_per_frame = 1 [ResourceBackup1] max_copies_per_frame = 1 [ShaderOverrideWater] Hash=9aab8271c8fd154d post ResourceWater = copy o0 [ShaderOverrideGroundWhite] ; this PS shader put ground in white hash = f3418c5e6ae23158 ; VS ground shader ;hash = 493bc731b72b6468 run = CustomShaderInjection [ShaderOverrideMountain] ; mountain PS hash = 207a01142ea364fb run = CustomShaderInjection2 [CustomShaderInjection] ; paint ground in white ps = ShaderFixes\output-white.hlsl ;needed for UH1H night flight ResourceGround = copy o0 ResourceBackup1 = copy o0 post Draw = from_caller ResourceGround = copy o0 post o0 = ResourceBackup1 [CustomShaderInjection2] ; inject mountain into ResourceWater ps = ShaderFixes\output-blue.hlsl ResourceBackup0 = copy o0 o0 = ref ResourceWater post Draw = from_caller post o0 = ResourceBackup0 ; [ShaderOverrideControl] ;Hash=6d4f5bb81c55393d ; Hash=f86fdf18b39e86b8 ; ps-t100= ResourceWater ; ps-t101 = ResourceGround ; x3 = res_width ; y3 = res_height ; Copy constant buffer 7 from the ground VS shader into the intermediate resource: [ShaderOverrideGround] ; 1.5 value ;Hash = 6de9fb56555ffdef ;2.0 value Hash = 228cd124fe81005c ResourcePerView = vs-cb7 ; Copy (actually reference) the intermediate resource into the sky/horizon as constant buffer 13 (13 because I do not know which number to chooseà) [ShaderOverrideHorizon] ; 1.5 value ;Hash = bda5788465aff6b0 ;2.0 value Hash = e291fc7505a59495 vs-cb13 = ResourcePerView ;for A10C & FC3 & Ka50 & Mig21 & FW190 & P51 HUD1 VS texture filtering [ShaderOverrideHUD1] Hash=38c581c23542f3ab z=ps-t0 ; vs-t100 = ResourceWater ; vs-t101= ResourceGround ; x3 = res_width ; y3 = res_height [ShaderOverrideHUD2] Hash=35d4deb078f43f02 z=ps-t0 ; vs-t100 = ref ResourceWater ; vs-t101= ref ResourceGround ; x3 = res_width ; y3 = res_height [ShaderOverrideLabels] ;VS not working Hash=472b2e7cb5c7ea4f vs-t79 = ResourceWater vs-t80= ResourceGround x3 = res_width y3 = res_height ; PS working ; Hash=e5ded239489d8cc9 ; ps-t100 = ResourceWater ; ps-t101= ResourceGround ; x3 = res_width ; y3 = res_height [Present] ResourceGround = null ResourceWater = null ResourceBackup0 = null ResourceBackup1 = null ResourcePerView = null x3 = 0.0 y3 = 0.0[/code]
DarkStarSword said:@lefuneste
If you can post the complete attempt I might be able to spot something.

Many thanks !
I enclosed 2 picture of labels, when non filtered and wrong filtered by VS, maybe it will help you (it doesn't help me...)
Here is the non working VS shader:
//VS labels with mask (not working)
cbuffer _Globals : register(b0)
{
float4 cv0 : packoffset(c0);
float4 cv1 : packoffset(c1);
float4 cv2 : packoffset(c2);
float4 cv3 : packoffset(c3);
float4 cv4 : packoffset(c4);
float4 cv5 : packoffset(c5);
float4 charArray[128] : packoffset(c6);
float worldSpace : packoffset(c134) = float(0);
float4x4 MVP : packoffset(c135);
float4 charcolor : packoffset(c139);
float epsilon : packoffset(c140) = float(9.99999975e-005);
}

Texture2D<float4> StereoParams : register(t78);
Texture1D<float4> IniParams : register(t77);
Texture2D<float4> t79 : register(t79);
Texture2D<float4> t80 : register(t80);

void main(
float4 v0 : POSITION0,
out float4 o0 : SV_POSITION0,
out float2 o1 : TEXCOORD0)
{
float4 r0,r1;
uint4 bitmask, uiDest;
float4 fDest;
float y1 = IniParams.Load(int2(1, 0)).y;

float4 tmp, cockpit, water;
float4 mountain;
float4 result, tempo;
float check, xcoord, ycoord;
int width, height, levels, flag;
float x3 = IniParams.Load(int2(3, 0)).x;
float y3 = IniParams.Load(int2(3, 0)).y;

r0.x = (uint)v0.z;
r0.y = v0.x * charArray[r0.x].y + charArray[r0.x].x;
r1.x = cv0.x + r0.y;
r1.y = -v0.y * cv0.w + cv0.y;
r1.z = 1;
// o0.x = dot(r1.xyz, MVP._m00_m10_m30);
// o0.y = dot(r1.xyz, MVP._m01_m11_m31);
// o0.z = dot(r1.xyz, MVP._m02_m12_m32);
// o0.w = dot(r1.xyz, MVP._m03_m13_m33);
tempo.x = dot(r1.xyz, MVP._m00_m10_m30);
tempo.y = dot(r1.xyz, MVP._m01_m11_m31);
tempo.z = dot(r1.xyz, MVP._m02_m12_m32);
tempo.w = dot(r1.xyz, MVP._m03_m13_m33);
o0.xyzw = tempo.xyzw;

r0.y = charArray[r0.x].y * v0.x;
r0.y = r0.y * cv1.x + charArray[r0.x].z;
r0.x = v0.y * cv0.z + charArray[r0.x].w;
o1.xy = cv1.zw + r0.yx;

float4 stereo = StereoParams.Load(0);
float4 iniParams = IniParams.Load(0);
o0.x+= stereo.x * (iniParams.x*y1 - stereo.y);

xcoord = (tempo.x + 1)/2 * x3;
ycoord = (tempo.y + 1)/2 * y3;
tmp.x=xcoord*2;
tmp.y=ycoord*2;
water = t79.Load(int3(tmp.xy, 0));
cockpit = t80.Load(int3(tmp.xy, 0));

flag=0;

check=0;
result.x=cockpit.x-water.x;
result.y=cockpit.y-water.y;
result.z=cockpit.z-water.z;
result.w=cockpit.w-water.w;

if (water.z == 1) check=1;
if ( !((abs(result.x) <= 0.001 && abs(result.y) <= 0.001 && abs(result.z) <= 0.001 ) || check == 1)) {

o0.xyzw= float4(0,0,0,0);
}



return;
}


Here is the working PS shader:
// Labels PS

cbuffer _Globals : register(b0)
{
float4 cv0 : packoffset(c0);
float4 cv1 : packoffset(c1);
float4 cv2 : packoffset(c2);
float4 cv3 : packoffset(c3);
float4 cv4 : packoffset(c4);
float4 cv5 : packoffset(c5);
float4 charArray[128] : packoffset(c6);
float worldSpace : packoffset(c134) = {0};
float4x4 MVP : packoffset(c135);
float4 charcolor : packoffset(c139);
float epsilon : packoffset(c140) = {9.99999975e-005};
}

SamplerState mySampler_s : register(s0);
Texture2D<float4> FontTexture : register(t0);


// 3Dmigoto declarations
#define cmp -
Texture2D<float4> StereoParams : register(t78);
Texture1D<float4> IniParams : register(t77);
Texture2D<float4> t100 : register(t100);
Texture2D<float4> t101 : register(t101);


void main(
float4 v0 : SV_POSITION0,
float2 v1 : TEXCOORD0,
out float4 o0 : SV_TARGET0)
{
float4 r0;
uint4 bitmask, uiDest;
float4 fDest;

float y1 = IniParams.Load(int2(1, 0)).y;
float4 tmp, cockpit, water;
float4 mountain;
float4 result, tempo;
float check, xcoord, ycoord;
int width, height, levels, flag;
float x3 = IniParams.Load(int2(3, 0)).x;
float y3 = IniParams.Load(int2(3, 0)).y;


r0.xyzw = FontTexture.Sample(mySampler_s, v1.xy).xyzw;
o0.w = r0.w;
o0.xyz = charcolor.xyz;

tmp.x=v0.x*2;
tmp.y=v0.y*2;
water = t100.Load(int3(tmp.xy, 0));
cockpit = t101.Load(int3(tmp.xy, 0));

flag=0;

check=0;

result.x=cockpit.x-water.x;
result.y=cockpit.y-water.y;
result.z=cockpit.z-water.z;
result.w=cockpit.w-water.w;

if (water.z == 1) check=1;
if ( !(abs(result.x) <= 0.001 && abs(result.y) <= 0.001 && abs(result.z) <= 0.001 ) || check == 1) {
o0.w = 0;
}

return;
}


Here is the shader part of d3dx.ini (the label PS call is commented out in [ShaderOverrideLabels]). output-blue.hlsl and output-white.hlsl are pixel shader that return only a fixed value for o0.
[ResourcePerView]
max_copies_per_frame = 1

[ResourceGround]
max_copies_per_frame = 1

[ResourceWater]
max_copies_per_frame = 1

[ResourceBackup0]
max_copies_per_frame = 1

[ResourceBackup1]
max_copies_per_frame = 1

[ShaderOverrideWater]
Hash=9aab8271c8fd154d
post ResourceWater = copy o0

[ShaderOverrideGroundWhite]
; this PS shader put ground in white
hash = f3418c5e6ae23158
; VS ground shader
;hash = 493bc731b72b6468
run = CustomShaderInjection

[ShaderOverrideMountain]
; mountain PS
hash = 207a01142ea364fb
run = CustomShaderInjection2

[CustomShaderInjection]
; paint ground in white
ps = ShaderFixes\output-white.hlsl
;needed for UH1H night flight
ResourceGround = copy o0
ResourceBackup1 = copy o0
post Draw = from_caller
ResourceGround = copy o0
post o0 = ResourceBackup1

[CustomShaderInjection2]
; inject mountain into ResourceWater
ps = ShaderFixes\output-blue.hlsl
ResourceBackup0 = copy o0
o0 = ref ResourceWater
post Draw = from_caller
post o0 = ResourceBackup0

; [ShaderOverrideControl]
;Hash=6d4f5bb81c55393d
; Hash=f86fdf18b39e86b8
; ps-t100= ResourceWater
; ps-t101 = ResourceGround
; x3 = res_width
; y3 = res_height

; Copy constant buffer 7 from the ground VS shader into the intermediate resource:
[ShaderOverrideGround]
; 1.5 value
;Hash = 6de9fb56555ffdef
;2.0 value
Hash = 228cd124fe81005c
ResourcePerView = vs-cb7

; Copy (actually reference) the intermediate resource into the sky/horizon as constant buffer 13 (13 because I do not know which number to chooseà)
[ShaderOverrideHorizon]
; 1.5 value
;Hash = bda5788465aff6b0
;2.0 value
Hash = e291fc7505a59495
vs-cb13 = ResourcePerView

;for A10C & FC3 & Ka50 & Mig21 & FW190 & P51 HUD1 VS texture filtering
[ShaderOverrideHUD1]
Hash=38c581c23542f3ab
z=ps-t0
; vs-t100 = ResourceWater
; vs-t101= ResourceGround
; x3 = res_width
; y3 = res_height

[ShaderOverrideHUD2]
Hash=35d4deb078f43f02
z=ps-t0
; vs-t100 = ref ResourceWater
; vs-t101= ref ResourceGround
; x3 = res_width
; y3 = res_height

[ShaderOverrideLabels]
;VS not working
Hash=472b2e7cb5c7ea4f
vs-t79 = ResourceWater
vs-t80= ResourceGround
x3 = res_width
y3 = res_height
; PS working
; Hash=e5ded239489d8cc9
; ps-t100 = ResourceWater
; ps-t101= ResourceGround
; x3 = res_width
; y3 = res_height

[Present]
ResourceGround = null
ResourceWater = null
ResourceBackup0 = null
ResourceBackup1 = null
ResourcePerView = null
x3 = 0.0
y3 = 0.0

Posted 04/17/2016 03:21 PM   
[quote="DarkStarSword"]@DJ-RK by the looks of that frame analysis, the problem is that the game is downsampling using [b]square[/b] render targets, which the driver heuristics may think is a shadow map and treat as mono (depending on the game's profile - for DX11 I'm pretty sure it is the default, whereas for DX9 it wasn't). Try this: [code] [TextureOverrideDownsample512] hash=56060590 StereoMode=1 [TextureOverrideDownsample128] hash=cc2d0b81 StereoMode=1 [TextureOverrideDownsample16] hash=dddd426b StereoMode=1 [/code] [/quote] Worked perfectly! I was so close, too. I had one identical entry in my d3dx.ini file, but with a different hash (probably one of the many other ones that appeared in the log file, rather than picking the hash that corresponded with the drawcall jps output). I also wasn't certain if using a textureoverride was correct for affecting a render target or not, and this helps confirm so. Major thanks, this was pretty much the last thing that needed to be fixed. I had figured out a way to disable it, but that took some of the brightness out of every scene, and considering how gloomy of a game this is already, losing even just a bit of "pop" out of it was pretty substantial. As always, you rock! Cheers.
DarkStarSword said:@DJ-RK

by the looks of that frame analysis, the problem is that the game is downsampling using square render targets, which the driver heuristics may think is a shadow map and treat as mono (depending on the game's profile - for DX11 I'm pretty sure it is the default, whereas for DX9 it wasn't). Try this:

[TextureOverrideDownsample512]
hash=56060590
StereoMode=1

[TextureOverrideDownsample128]
hash=cc2d0b81
StereoMode=1

[TextureOverrideDownsample16]
hash=dddd426b
StereoMode=1



Worked perfectly! I was so close, too. I had one identical entry in my d3dx.ini file, but with a different hash (probably one of the many other ones that appeared in the log file, rather than picking the hash that corresponded with the drawcall jps output). I also wasn't certain if using a textureoverride was correct for affecting a render target or not, and this helps confirm so.

Major thanks, this was pretty much the last thing that needed to be fixed. I had figured out a way to disable it, but that took some of the brightness out of every scene, and considering how gloomy of a game this is already, losing even just a bit of "pop" out of it was pretty substantial.

As always, you rock! Cheers.

3D Gaming Rig: CPU: i7 7700K @ 4.9Ghz | Mobo: Asus Maximus Hero VIII | RAM: Corsair Dominator 16GB | GPU: 2 x GTX 1080 Ti SLI | 3xSSDs for OS and Apps, 2 x HDD's for 11GB storage | PSU: Seasonic X-1250 M2| Case: Corsair C70 | Cooling: Corsair H115i Hydro cooler | Displays: Asus PG278QR, BenQ XL2420TX & BenQ HT1075 | OS: Windows 10 Pro + Windows 7 dual boot

Like my fixes? Dontations can be made to: www.paypal.me/DShanz or rshannonca@gmail.com
Like electronic music? Check out: www.soundcloud.com/dj-ryan-king

Posted 04/18/2016 03:05 AM   
Great to hear that worked DJ-RK :) @lefuneste I still can't spot anything wrong there. There's some minor things like dividing the output x & y by w, but there's a good chance that w == 1.0 so it may not make a difference. I'm not entirely clear on where they multiply by 2 has come from, but given you indicated that the PS version was working and you did it there as well that would seem to indicate it would be ok. I guess one difference is the PS version will be operating on the stereo adjusted coordinates, while the VS version is operating on the original position, but I gather that is probably what you want. Maybe there's something simple that I've missed, but I've looked over it a few times without spotting anything obvious. My only other suggestion would be to add some debugging experiments to try to verify that each value is what you expect at each point to work out where the problem has come from. You mentioned the game was free right? Can you post the full WIP and I'll see if I can try it out.
Great to hear that worked DJ-RK :)

@lefuneste I still can't spot anything wrong there. There's some minor things like dividing the output x & y by w, but there's a good chance that w == 1.0 so it may not make a difference. I'm not entirely clear on where they multiply by 2 has come from, but given you indicated that the PS version was working and you did it there as well that would seem to indicate it would be ok. I guess one difference is the PS version will be operating on the stereo adjusted coordinates, while the VS version is operating on the original position, but I gather that is probably what you want.

Maybe there's something simple that I've missed, but I've looked over it a few times without spotting anything obvious. My only other suggestion would be to add some debugging experiments to try to verify that each value is what you expect at each point to work out where the problem has come from.

You mentioned the game was free right? Can you post the full WIP and I'll see if I can try it out.

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 04/19/2016 08:48 AM   
[quote="DarkStarSword"] @lefuneste I still can't spot anything wrong there....You mentioned the game was free right? Can you post the full WIP and I'll see if I can try it out.[/quote] So I made at first a track (recorded flight that can be replayed in game 3D engine) with the free plane enclosed in the DCS freely downloadable game to help you to work on it. This help me to find the solution, as the plane cockpit as less windows than the helicopter ! I had to replace [code] ycoord = (tempo.y + 1)/2 * y3;[/code] by [code]ycoord = (1 - tempo.y)/2 * y3;[/code] It's strange that the formulas differs from VS to PS and also between X and Y...
DarkStarSword said:
@lefuneste I still can't spot anything wrong there....You mentioned the game was free right? Can you post the full WIP and I'll see if I can try it out.


So I made at first a track (recorded flight that can be replayed in game 3D engine) with the free plane enclosed in the DCS freely downloadable game to help you to work on it. This help me to find the solution, as the plane cockpit as less windows than the helicopter !

I had to replace
ycoord = (tempo.y + 1)/2 * y3;

by
ycoord = (1 - tempo.y)/2 * y3;


It's strange that the formulas differs from VS to PS and also between X and Y...

Posted 04/20/2016 06:12 PM   
Ahh, I've been caught out by that one as well - great work tracking it down :)
Ahh, I've been caught out by that one as well - great work tracking it down :)

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 04/21/2016 03:58 AM   
[center][size="L"][color="orange"]3DMigoto 1.2.36 is out:[/color] [url]https://github.com/bo3b/3Dmigoto/releases[/url][/size][/center] - [color="orange"]Convergence is no longer unlocked by default.[/color] To unlock convergence, set unlock_convergence=1 in the d3dx.ini and/or define a convergence map. This is primarily intended so that 3DMigoto and Helix Mod can be installed in the same game directory without interfering with each other. - Two new shader hash types have been added: [list] [.]shader_hash=embedded will use the first half of the MD5-like hash already embedded in the shader to skip the calculation altogether (this may speed up loading times slightly, but it is unlikely to be noticeable - I added this "because I can" and because I work with binary shaders more than I expect anyone else would, where this is sometimes useful)[/.] [.]shader_hash=bytecode is similar to UseAlternateCRC option of Helix Mod. It will restrict the hash to bytecode and input/output/patch constant signatures. It also uses a hardware accelerated crc32c hash (padded with 8 0s on the left), which should be faster than the default FNV hash (though as above, I don't expect any speedup would be noticeable). It's main purpose is to prevent the hashes changing if a game developer updates their build environment (shader compiler version, build path if debugging information is present (rare), etc) without changing the shader code. In some cases this might also reduce the number of shaders that need to be edited, though it also carries a higher risk of hash collisions, which may e.g. complicate separating out UI elements. I use this so that some of the MGSVTPP shaders will work in MGO which was built from a different path, since in some cases only their debug info differs.[/.] [/list]Note that there is no compatibility between the hash types - switching hash types would require all shaders to be redone with the new hashes, and ShaderOverride sections to be updated appropriately. I have some scripts in my 3d-fixes repository to assist in migrating between hash types (rename2embedded.sh, rename2bytecode.sh, dx11shaderanalyse.py), but they require that the undocumented export_binary=1 option has been used to dump the shaders in binary form with the old hashes first. I recommend trying to determine if you need / want an alternate hash type early. - Resource sections have new width_multiply and height_multiply options. These can be used to e.g. create half/quarter/double/etc size resources when a resource is created with copy_desc or otherwise. - Custom Shader sections have a new max_executions_per_frame option, which can limit the number of times they will run in a frame. This is intended to be used in situations such as running a custom shader once and only once prior to the first UI shader, which may not be always be the same shader and could be run many times. - StereoParams and IniParams may now be referenced as sources in arbitrary resource copying. This is useful to bind these before running a custom shader in certain games that constantly unbind them, or if you have opted to never bind them by default. e.g. I used this to allow Akiba's Trip to run in SBS mode. - Fixes the ubfe instruction in the decompiler (bo3b) Note that some of the ini parsing code was refactored for this release, which carries a small risk of introducing new bugs. If you notice an option does not seem to be working, please try the previous version.


- Convergence is no longer unlocked by default. To unlock convergence, set unlock_convergence=1 in the d3dx.ini and/or define a convergence map. This is primarily intended so that 3DMigoto and Helix Mod can be installed in the same game directory without interfering with each other.

- Two new shader hash types have been added:
  • shader_hash=embedded will use the first half of the MD5-like hash already embedded in the shader to skip the calculation altogether (this may speed up loading times slightly, but it is unlikely to be noticeable - I added this "because I can" and because I work with binary shaders more than I expect anyone else would, where this is sometimes useful)

  • shader_hash=bytecode is similar to UseAlternateCRC option of Helix Mod. It will restrict the hash to bytecode and input/output/patch constant signatures. It also uses a hardware accelerated crc32c hash (padded with 8 0s on the left), which should be faster than the default FNV hash (though as above, I don't expect any speedup would be noticeable).

    It's main purpose is to prevent the hashes changing if a game developer updates their build environment (shader compiler version, build path if debugging information is present (rare), etc) without changing the shader code. In some cases this might also reduce the number of shaders that need to be edited, though it also carries a higher risk of hash collisions, which may e.g. complicate separating out UI elements.

    I use this so that some of the MGSVTPP shaders will work in MGO which was built from a different path, since in some cases only their debug info differs.
Note that there is no compatibility between the hash types - switching hash types would require all shaders to be redone with the new hashes, and ShaderOverride sections to be updated appropriately. I have some scripts in my 3d-fixes repository to assist in migrating between hash types (rename2embedded.sh, rename2bytecode.sh, dx11shaderanalyse.py), but they require that the undocumented export_binary=1 option has been used to dump the shaders in binary form with the old hashes first. I recommend trying to determine if you need / want an alternate hash type early.

- Resource sections have new width_multiply and height_multiply options. These can be used to e.g. create half/quarter/double/etc size resources when a resource is created with copy_desc or otherwise.

- Custom Shader sections have a new max_executions_per_frame option, which can limit the number of times they will run in a frame. This is intended to be used in situations such as running a custom shader once and only once prior to the first UI shader, which may not be always be the same shader and could be run many times.

- StereoParams and IniParams may now be referenced as sources in arbitrary resource copying. This is useful to bind these before running a custom shader in certain games that constantly unbind them, or if you have opted to never bind them by default. e.g. I used this to allow Akiba's Trip to run in SBS mode.

- Fixes the ubfe instruction in the decompiler (bo3b)


Note that some of the ini parsing code was refactored for this release, which carries a small risk of introducing new bugs. If you notice an option does not seem to be working, please try the previous version.

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 04/26/2016 10:05 AM   
Thanks for the new update! [quote="DarkStarSword"]Convergence is no longer unlocked by default. To unlock convergence, set unlock_convergence=1 in the d3dx.ini and/or define a convergence map. This is primarily intended so that 3DMigoto and Helix Mod can be installed in the same game directory without interfering with each other.[/quote] May I ask what's a practical application of this? Is this for chain loading 3DMigoto to provide SBS support on DX9 games? Would this potentially be able to be implemented in a fashion where HelixMod is doing the wrapping into DX9, chain loading 3DMigoto, which can be used for hunting/dumping/shader overrides (so we can work with HLSL rather than ASM)? Probably not, but a man can dream, can't he? ;)
Thanks for the new update!

DarkStarSword said:Convergence is no longer unlocked by default. To unlock convergence, set unlock_convergence=1 in the d3dx.ini and/or define a convergence map. This is primarily intended so that 3DMigoto and Helix Mod can be installed in the same game directory without interfering with each other.


May I ask what's a practical application of this? Is this for chain loading 3DMigoto to provide SBS support on DX9 games? Would this potentially be able to be implemented in a fashion where HelixMod is doing the wrapping into DX9, chain loading 3DMigoto, which can be used for hunting/dumping/shader overrides (so we can work with HLSL rather than ASM)? Probably not, but a man can dream, can't he? ;)

3D Gaming Rig: CPU: i7 7700K @ 4.9Ghz | Mobo: Asus Maximus Hero VIII | RAM: Corsair Dominator 16GB | GPU: 2 x GTX 1080 Ti SLI | 3xSSDs for OS and Apps, 2 x HDD's for 11GB storage | PSU: Seasonic X-1250 M2| Case: Corsair C70 | Cooling: Corsair H115i Hydro cooler | Displays: Asus PG278QR, BenQ XL2420TX & BenQ HT1075 | OS: Windows 10 Pro + Windows 7 dual boot

Like my fixes? Dontations can be made to: www.paypal.me/DShanz or rshannonca@gmail.com
Like electronic music? Check out: www.soundcloud.com/dj-ryan-king

Posted 04/26/2016 09:39 PM   
  67 / 143    
Scroll To Top