Bo3b's School For Shaderhackers
  68 / 88    
I have a sneaking suspicion that the answer might lie in the lines that reference r7 (the first is likely to be different to the rest, like first might be an add and the rest might be a subtract or vice versa)... you might have to separate the mad_pp instructions out into a mul and an add and see what happens if you try to adjust it in the middle... but it is really hard to tell just looking at the code and I could be way off the mark - I'm often pretty confident that my guesses are close, but in this case I'm really not sure.
I have a sneaking suspicion that the answer might lie in the lines that reference r7 (the first is likely to be different to the rest, like first might be an add and the rest might be a subtract or vice versa)... you might have to separate the mad_pp instructions out into a mul and an add and see what happens if you try to adjust it in the middle... but it is really hard to tell just looking at the code and I could be way off the mark - I'm often pretty confident that my guesses are close, but in this case I'm really not sure.

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 12/03/2016 04:56 AM   
[quote="DarkStarSword"]@mx-2 my main experience with AO shaders has been that there are often a lot of places that need to be adjusted, and it will often look much worse then when you started until they are all adjusted simultaneously when suddenly it all looks perfect. I've fixed SSAO shaders in a couple of Unity games and as I recall it was along the same lines as fixing HBAO+, but there are more variations of SSAO than there are of HBAO+, so the details may vary. What game is that shader from?[/quote]The shader is from Risen 3. [quote="DarkStarSword"]I have a sneaking suspicion that the answer might lie in the lines that reference r7 (the first is likely to be different to the rest, like first might be an add and the rest might be a subtract or vice versa)... you might have to separate the mad_pp instructions out into a mul and an add and see what happens if you try to adjust it in the middle... but it is really hard to tell just looking at the code and I could be way off the mark - I'm often pretty confident that my guesses are close, but in this case I'm really not sure.[/quote]Thank you for your suggestion, I'll try that next time I work on that fix.
DarkStarSword said:@mx-2 my main experience with AO shaders has been that there are often a lot of places that need to be adjusted, and it will often look much worse then when you started until they are all adjusted simultaneously when suddenly it all looks perfect. I've fixed SSAO shaders in a couple of Unity games and as I recall it was along the same lines as fixing HBAO+, but there are more variations of SSAO than there are of HBAO+, so the details may vary.

What game is that shader from?
The shader is from Risen 3.

DarkStarSword said:I have a sneaking suspicion that the answer might lie in the lines that reference r7 (the first is likely to be different to the rest, like first might be an add and the rest might be a subtract or vice versa)... you might have to separate the mad_pp instructions out into a mul and an add and see what happens if you try to adjust it in the middle... but it is really hard to tell just looking at the code and I could be way off the mark - I'm often pretty confident that my guesses are close, but in this case I'm really not sure.
Thank you for your suggestion, I'll try that next time I work on that fix.
Hi guys, I know 3DMigoto has the ability to specify for a shader by hash, the handling: "handling=mono" I was wondering what does it actually do? Will make the Shader Run just one time? or will it disable all the 3D Vision Auto heuristics that try to stereorize the shader? Would it work on Compute Shaders? (I am looking at ME:A that is Frostbite 3 engine and all the lights are "rendered" from CS, but some shaders look like they are stereorized when they shouldn't be)
Hi guys,

I know 3DMigoto has the ability to specify for a shader by hash, the handling:

"handling=mono"

I was wondering what does it actually do? Will make the Shader Run just one time? or will it disable all the 3D Vision Auto heuristics that try to stereorize the shader?

Would it work on Compute Shaders?

(I am looking at ME:A that is Frostbite 3 engine and all the lights are "rendered" from CS, but some shaders look like they are stereorized when they shouldn't be)

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


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

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

Posted 03/22/2017 10:57 AM   
[quote="helifax"]Hi guys, I know 3DMigoto has the ability to specify for a shader by hash, the handling: "handling=mono" I was wondering what does it actually do? Will make the Shader Run just one time? or will it disable all the 3D Vision Auto heuristics that try to stereorize the shader? Would it work on Compute Shaders?[/quote] Hi Helifax. Not sure about "handling=mono". But it might be worth trying to disable 3D Vision Auto in the CS by placing this with the other declarations: [code]dcl_constantbuffer cb12[0], immediateIndexed[/code] Sorry if you've already tried this.
helifax said:Hi guys,

I know 3DMigoto has the ability to specify for a shader by hash, the handling:

"handling=mono"

I was wondering what does it actually do? Will make the Shader Run just one time? or will it disable all the 3D Vision Auto heuristics that try to stereorize the shader?

Would it work on Compute Shaders?


Hi Helifax. Not sure about "handling=mono". But it might be worth trying to disable 3D Vision Auto in the CS by placing this with the other declarations:

dcl_constantbuffer cb12[0], immediateIndexed


Sorry if you've already tried this.

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

Posted 03/22/2017 04:50 PM   
[quote="4everAwake"][quote="helifax"]Hi guys, I know 3DMigoto has the ability to specify for a shader by hash, the handling: "handling=mono" I was wondering what does it actually do? Will make the Shader Run just one time? or will it disable all the 3D Vision Auto heuristics that try to stereorize the shader? Would it work on Compute Shaders?[/quote] Hi Helifax. Not sure about "handling=mono". But it might be worth trying to disable 3D Vision Auto in the CS by placing this with the other declarations: [code]dcl_constantbuffer cb12[0], immediateIndexed[/code] Sorry if you've already tried this. [/quote] Hi, I am a bit confused now;) I need to use the above code to replace how the buffers are defined? Not at home currently, but once I get I can paste a CS;) Thank you;)
4everAwake said:
helifax said:Hi guys,

I know 3DMigoto has the ability to specify for a shader by hash, the handling:

"handling=mono"

I was wondering what does it actually do? Will make the Shader Run just one time? or will it disable all the 3D Vision Auto heuristics that try to stereorize the shader?

Would it work on Compute Shaders?


Hi Helifax. Not sure about "handling=mono". But it might be worth trying to disable 3D Vision Auto in the CS by placing this with the other declarations:

dcl_constantbuffer cb12[0], immediateIndexed


Sorry if you've already tried this.


Hi,

I am a bit confused now;) I need to use the above code to replace how the buffers are defined?
Not at home currently, but once I get I can paste a CS;)

Thank you;)

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


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

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

Posted 03/22/2017 05:31 PM   
[quote="helifax"][quote="4everAwake"][quote="helifax"]Hi guys, I know 3DMigoto has the ability to specify for a shader by hash, the handling: "handling=mono" I was wondering what does it actually do? Will make the Shader Run just one time? or will it disable all the 3D Vision Auto heuristics that try to stereorize the shader? Would it work on Compute Shaders?[/quote] Hi Helifax. Not sure about "handling=mono". But it might be worth trying to disable 3D Vision Auto in the CS by placing this with the other declarations: [code]dcl_constantbuffer cb12[0], immediateIndexed[/code] Sorry if you've already tried this. [/quote] Hi, I am a bit confused now;) I need to use the above code to replace how the buffers are defined? [/quote] Yes. Nvidia uses cb12[0] to inject 3D vision automatic to the shaders. So adding the line " dcl_constantbuffer cb12[0], immediateIndexed" in the ASM Vertex or Hull shaders (shader model 4 and 5) overrides 3D vision automatic. I haven't tried this with Compute shaders before so I'm not sure if it will work. For Shader model 3, c255 is the 3d vision constant. The equivalent of the above code would be: [code]def c255, 0, 0, 0, 0[/code] DarkStarSword discovered all of this a while back: [url]https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4786821/#4786821[/url]
helifax said:
4everAwake said:
helifax said:Hi guys,

I know 3DMigoto has the ability to specify for a shader by hash, the handling:

"handling=mono"

I was wondering what does it actually do? Will make the Shader Run just one time? or will it disable all the 3D Vision Auto heuristics that try to stereorize the shader?

Would it work on Compute Shaders?


Hi Helifax. Not sure about "handling=mono". But it might be worth trying to disable 3D Vision Auto in the CS by placing this with the other declarations:

dcl_constantbuffer cb12[0], immediateIndexed


Sorry if you've already tried this.


Hi,

I am a bit confused now;) I need to use the above code to replace how the buffers are defined?


Yes. Nvidia uses cb12[0] to inject 3D vision automatic to the shaders. So adding the line " dcl_constantbuffer cb12[0], immediateIndexed" in the ASM Vertex or Hull shaders (shader model 4 and 5) overrides 3D vision automatic. I haven't tried this with Compute shaders before so I'm not sure if it will work.

For Shader model 3, c255 is the 3d vision constant. The equivalent of the above code would be:
def c255, 0, 0, 0, 0


DarkStarSword discovered all of this a while back:
https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4786821/#4786821

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

Posted 03/22/2017 06:40 PM   
Thank you 4everAwake, It seems to work just fine in CS, but however is not what I am expecting;)) Seems the problem is still there in my case... Seems the CS I was looking at are already mono. Hmm...
Thank you 4everAwake,

It seems to work just fine in CS, but however is not what I am expecting;))
Seems the problem is still there in my case... Seems the CS I was looking at are already mono. Hmm...

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


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

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

Posted 03/22/2017 07:50 PM   
Right so made some progress on the CS and unlike how I initially believed, is not actually a CS but a part of the CS that renders those lights in what seems to be ONE eye. Once this is disabled I get this (SORRY for the Surround pictures! Look at the character): [url=http://www.iforce.co.nz/View.aspx?i=l1zto3nx.fiv.jpg][img]http://iforce.co.nz/i/l1zto3nx.fiv.jpg[/img][/url] Now this is how it looks be default! Lights showing in one eye: [url=http://www.iforce.co.nz/View.aspx?i=e42p04rm.mjv.jpg][img]http://iforce.co.nz/i/e42p04rm.mjv.jpg[/img][/url] Now the shader (Look for the comments in the shader): http://pastebin.com/bXrpW3dr (Too big to share it here) The fix I apply there fixes the model shadows, so that 100% works. However those lights are in one eye and can't figure it out who or what it does. I know this shader has the headers stripped, but cross-referencing with other FB3 games the buffers are like this: [code] // Buffer Definitions: // // cbuffer cbLightInfo // { // // struct AreaLightInfo // { // // struct BaseLightInfo // { // // float3 pos; // Offset: 0 // float invSqrAttenuationRadius;// Offset: 12 // float3 color; // Offset: 16 // float attenuationOffset; // Offset: 28 // float3 matrixForward; // Offset: 32 // float diffuseScale; // Offset: 44 // float3 matrixUp; // Offset: 48 // float specularScale; // Offset: 60 // float3 matrixLeft; // Offset: 64 // float shadowDimmer; // Offset: 76 // float angleScale; // Offset: 80 // float angleOffset; // Offset: 84 // float2 unused; // Offset: 88 // // } baseLight; // Offset: 0 // // struct BaseAreaLightInfo // { // // float3 virtualPos; // Offset: 96 // float occluderHeight; // Offset: 108 // float areaLightType; // Offset: 112 // float lightRadius0; // Offset: 116 // float lightRadius1; // Offset: 120 // float unused; // Offset: 124 // // } areaLight; // Offset: 96 // // struct VolumetricShadowInfo // { // // float enable; // Offset: 128 // float volumeShadowMapIndex;// Offset: 132 // float invAttenuationRadius;// Offset: 136 // float tanAngle; // Offset: 140 // // } vShadow; // Offset: 128 // // } g_lightInfoArea[128]; // Offset: 0 Size: 18432 // // } // // cbuffer cb0 // { // // float4x4 invViewProjectionMatrix; // Offset: 0 Size: 64 // float4 g_exposureMultipliers; // Offset: 64 Size: 16 // float localIblMipmapBias; // Offset: 80 Size: 4 [unused] // float screenAspectRatio; // Offset: 84 Size: 4 [unused] // float2 invResolution; // Offset: 88 Size: 8 // float4 shadowMapSizeAndInvSize; // Offset: 96 Size: 16 [unused] // uint forceSplitLighting; // Offset: 112 Size: 4 [unused] // uint sssScatteringEnables; // Offset: 116 Size: 4 [unused] // float volumetricShadowmapHalfTexelOffset;// Offset: 120 Size: 4 [unused] // float volumetricShadowmapOneMinusHalfTexelOffset;// Offset: 124 Size: 4 [unused] // float volumetricShadowmapInvMaxCount;// Offset: 128 Size: 4 [unused] // float dynamicAOFactor; // Offset: 132 Size: 4 // uint tileCountX; // Offset: 136 Size: 4 // uint pad1; // Offset: 140 Size: 4 [unused] // float4x3 g_normalBasisTransforms[6];// Offset: 144 Size: 288 // // } // // Resource bind info for g_lightCullInput // { // // uint4 $Element; // Offset: 0 Size: 16 // // } // // Resource bind info for g_lightIndexInput // { // // uint $Element; // Offset: 0 Size: 4 // // } // // Resource bind info for g_compactTileGridBuffer // { // // uint $Element; // Offset: 0 Size: 4 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // g_linearSampler sampler NA NA 0 1 // g_gbufferTexture0 texture float4 2d 0 1 // g_gbufferTexture1 texture float4 2d 1 1 // g_gbufferTexture2 texture float4 2d 2 1 // g_depthTexture texture float 2d 6 1 // g_diffuseOcclusionTexture texture float 2d 10 1 // g_lightCullInput texture struct r/o 19 1 // g_lightIndexInput texture struct r/o 20 1 // g_compactTileGridBuffer texture struct r/o 25 1 // g_outputTexture0 UAV float4 2d 0 1 // cb0 cbuffer NA NA 0 1 // cbLightInfo cbuffer NA NA 1 1 // [/code] cb0[0-3] is the inverse of the ViewProjection Matrix as seen in the code above;) Anyone has any idea on how to "solve this mystery"? :) PS: I tried all of the known formulas so far and the one in the shader fixes the shadows on the model as you can see in the images. I also tried calculate the normal ViewProx Matrix, apply the stereo to r4.x (after this line "div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.x") but makes no no difference :(
Right so made some progress on the CS and unlike how I initially believed, is not actually a CS but a part of the CS that renders those lights in what seems to be ONE eye.

Once this is disabled I get this (SORRY for the Surround pictures! Look at the character):
Image


Now this is how it looks be default! Lights showing in one eye:
Image

Now the shader (Look for the comments in the shader):
http://pastebin.com/bXrpW3dr
(Too big to share it here)

The fix I apply there fixes the model shadows, so that 100% works. However those lights are in one eye and can't figure it out who or what it does.

I know this shader has the headers stripped, but cross-referencing with other FB3 games the buffers are like this:

// Buffer Definitions: 
//
// cbuffer cbLightInfo
// {
//
// struct AreaLightInfo
// {
//
// struct BaseLightInfo
// {
//
// float3 pos; // Offset: 0
// float invSqrAttenuationRadius;// Offset: 12
// float3 color; // Offset: 16
// float attenuationOffset; // Offset: 28
// float3 matrixForward; // Offset: 32
// float diffuseScale; // Offset: 44
// float3 matrixUp; // Offset: 48
// float specularScale; // Offset: 60
// float3 matrixLeft; // Offset: 64
// float shadowDimmer; // Offset: 76
// float angleScale; // Offset: 80
// float angleOffset; // Offset: 84
// float2 unused; // Offset: 88
//
// } baseLight; // Offset: 0
//
// struct BaseAreaLightInfo
// {
//
// float3 virtualPos; // Offset: 96
// float occluderHeight; // Offset: 108
// float areaLightType; // Offset: 112
// float lightRadius0; // Offset: 116
// float lightRadius1; // Offset: 120
// float unused; // Offset: 124
//
// } areaLight; // Offset: 96
//
// struct VolumetricShadowInfo
// {
//
// float enable; // Offset: 128
// float volumeShadowMapIndex;// Offset: 132
// float invAttenuationRadius;// Offset: 136
// float tanAngle; // Offset: 140
//
// } vShadow; // Offset: 128
//
// } g_lightInfoArea[128]; // Offset: 0 Size: 18432
//
// }
//
// cbuffer cb0
// {
//
// float4x4 invViewProjectionMatrix; // Offset: 0 Size: 64
// float4 g_exposureMultipliers; // Offset: 64 Size: 16
// float localIblMipmapBias; // Offset: 80 Size: 4 [unused]
// float screenAspectRatio; // Offset: 84 Size: 4 [unused]
// float2 invResolution; // Offset: 88 Size: 8
// float4 shadowMapSizeAndInvSize; // Offset: 96 Size: 16 [unused]
// uint forceSplitLighting; // Offset: 112 Size: 4 [unused]
// uint sssScatteringEnables; // Offset: 116 Size: 4 [unused]
// float volumetricShadowmapHalfTexelOffset;// Offset: 120 Size: 4 [unused]
// float volumetricShadowmapOneMinusHalfTexelOffset;// Offset: 124 Size: 4 [unused]
// float volumetricShadowmapInvMaxCount;// Offset: 128 Size: 4 [unused]
// float dynamicAOFactor; // Offset: 132 Size: 4
// uint tileCountX; // Offset: 136 Size: 4
// uint pad1; // Offset: 140 Size: 4 [unused]
// float4x3 g_normalBasisTransforms[6];// Offset: 144 Size: 288
//
// }
//
// Resource bind info for g_lightCullInput
// {
//
// uint4 $Element; // Offset: 0 Size: 16
//
// }
//
// Resource bind info for g_lightIndexInput
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
// Resource bind info for g_compactTileGridBuffer
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_linearSampler sampler NA NA 0 1
// g_gbufferTexture0 texture float4 2d 0 1
// g_gbufferTexture1 texture float4 2d 1 1
// g_gbufferTexture2 texture float4 2d 2 1
// g_depthTexture texture float 2d 6 1
// g_diffuseOcclusionTexture texture float 2d 10 1
// g_lightCullInput texture struct r/o 19 1
// g_lightIndexInput texture struct r/o 20 1
// g_compactTileGridBuffer texture struct r/o 25 1
// g_outputTexture0 UAV float4 2d 0 1
// cb0 cbuffer NA NA 0 1
// cbLightInfo cbuffer NA NA 1 1
//


cb0[0-3] is the inverse of the ViewProjection Matrix as seen in the code above;)

Anyone has any idea on how to "solve this mystery"? :)

PS:
I tried all of the known formulas so far and the one in the shader fixes the shadows on the model as you can see in the images. I also tried calculate the normal ViewProx Matrix, apply the stereo to r4.x (after this line "div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.x") but makes no no difference :(

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


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

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

Posted 03/22/2017 10:09 PM   
Tiny bump;) Anyone, any ideas about the above problem?:)
Tiny bump;) Anyone, any ideas about the above problem?:)

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


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

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

Posted 03/31/2017 05:56 PM   
Sorry Helifax can not help you there :( I do have a problem I am trying to solve in War Thunder. Well what it is the clouds when flying are broke and not stereoised, I tried injecting the common codes to change it but mothering has an affect.. Now weird thing is same game but when Playing in the Tanks the sky there is perfect?? So what I would like to do is use the shader for the tank sky into the plane sky as I can do notjhing with the cumulus clouds while flying but disable them.. I have the 2 Files and was looking around but I am unsure if I can remove the cumulus from the Flying sky and inject the tank sky into the flying one I hope that makes cense. I seen the part about textures but that did not seem to gointo detail on how to replace the shader itself into the other.. Is this even possible wity Migoto?? IF not Guess I will have to live with it diabled but it is weird I can not affect the cloudsd at all in the Flying sky.. this first screenshot is of the Flying sky.. the 2nd picture is of the sky when in the tanks.. here is the number of the shader of the Good Clouds: 37b6391f0c32405e-vs_replace and here is the code for it: [code] // ---- Created with 3Dmigoto v1.2.56 on Thu Mar 30 21:38:17 2017 // Clouds sky daytime main menu.. cbuffer cb0 : register(b0) { float4 cb0[4]; } // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float2 v0 : POSITION0, out float4 o0 : SV_POSITION0, out float4 o1 : TEXCOORD0, out float3 o2 : TEXCOORD1) { float4 r0,r1; uint4 bitmask, uiDest; float4 fDest; o0.xy = v0.xy; o0.zw = float2(0,1); o1.xy = v0.xy * float2(0.5,-0.5) + float2(0.5,0.5); r0.x = cmp(0 < v0.y); r0.y = cmp(v0.x < 0); r1.xyz = r0.yyy ? cb0[0].xyz : cb0[1].xyz; r0.yzw = r0.yyy ? cb0[2].xyz : cb0[3].xyz; o2.xyz = r0.xxx ? r1.xyz : r0.yzw; float4 stereo = StereoParams.Load(0); float depth = stereo.x; float convergence = stereo.y; o0.x += depth * 0.99; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) D3D Shader Disassembler // // using 3Dmigoto v1.2.56 on Thu Mar 30 21:38:17 2017 // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // POSITION 0 xy 0 NONE float xy // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_POSITION 0 xyzw 0 POS float xyzw // TEXCOORD 0 xy 1 NONE float xy // TEXCOORD 1 xyz 2 NONE float xyz // vs_4_0 dcl_constantbuffer cb0[4], immediateIndexed dcl_input v0.xy dcl_output_siv o0.xyzw, position dcl_output o1.xy dcl_output o2.xyz dcl_temps 2 mov o0.xy, v0.xyxx mov o0.zw, l(0,0,0,1.000000) mad o1.xy, v0.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000) lt r0.x, l(0.000000), v0.y lt r0.y, v0.x, l(0.000000) movc r1.xyz, r0.yyyy, cb0[0].xyzx, cb0[1].xyzx movc r0.yzw, r0.yyyy, cb0[2].xxyz, cb0[3].xxyz movc o2.xyz, r0.xxxx, r1.xyzx, r0.yzwy ret // Approximately 0 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code] here is the code for the Bad clouds: [code] // ---- Created with 3Dmigoto v1.2.56 on Thu Mar 30 23:00:29 2017 // Cumulus clouds over ocean.. cbuffer cb0 : register(b0) { float4 cb0[5]; } // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float2 v0 : POSITION0, out float4 o0 : SV_POSITION0, out float3 o1 : TEXCOORD0) { float4 r0,r1; uint4 bitmask, uiDest; float4 fDest; o0.z = cb0[4].x * 20 + cb0[4].y; o0.xy = float2(20,20) * v0.xy; o0.w = 20; r0.x = cmp(0 < v0.y); r0.y = cmp(v0.x < 0); r1.xyz = r0.yyy ? cb0[0].xyz : cb0[1].xyz; r0.yzw = r0.yyy ? cb0[2].xyz : cb0[3].xyz; o1.xyz = r0.xxx ? r1.xyz : r0.yzw; // Cumulus Clouds to near infinity float4 stereo = StereoParams.Load(0); float depth = stereo.x; float convergence = stereo.y; o0.x += depth; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) D3D Shader Disassembler // // using 3Dmigoto v1.2.56 on Thu Mar 30 23:00:29 2017 // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // POSITION 0 xy 0 NONE float xy // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_POSITION 0 xyzw 0 POS float xyzw // TEXCOORD 0 xyz 1 NONE float xyz // vs_4_0 dcl_constantbuffer cb0[5], immediateIndexed dcl_input v0.xy dcl_output_siv o0.xyzw, position dcl_output o1.xyz dcl_temps 2 mad o0.z, cb0[4].x, l(20.000000), cb0[4].y mul o0.xy, v0.xyxx, l(20.000000, 20.000000, 0.000000, 0.000000) mov o0.w, l(20.000000) lt r0.x, l(0.000000), v0.y lt r0.y, v0.x, l(0.000000) movc r1.xyz, r0.yyyy, cb0[0].xyzx, cb0[1].xyzx movc r0.yzw, r0.yyyy, cb0[2].xxyz, cb0[3].xxyz movc o1.xyz, r0.xxxx, r1.xyzx, r0.yzwy ret // Approximately 0 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code]
Sorry Helifax can not help you there :(

I do have a problem I am trying to solve in War Thunder. Well what it is the clouds when flying are broke and not stereoised, I tried injecting the common codes to change it but mothering has an affect..

Now weird thing is same game but when Playing in the Tanks the sky there is perfect?? So what I would like to do is use the shader for the tank sky into the plane sky as I can do notjhing with the cumulus clouds while flying but disable them..

I have the 2 Files and was looking around but I am unsure if I can remove the cumulus from the Flying sky and inject the tank sky into the flying one I hope that makes cense.

I seen the part about textures but that did not seem to gointo detail on how to replace the shader itself into the other..

Is this even possible wity Migoto?? IF not Guess I will have to live with it diabled but it is weird I can not affect the cloudsd at all in the Flying sky..

this first screenshot is of the Flying sky.. the 2nd picture is of the sky when in the tanks..


here is the number of the shader of the Good Clouds:


37b6391f0c32405e-vs_replace and here is the code for it:


// ---- Created with 3Dmigoto v1.2.56 on Thu Mar 30 21:38:17 2017
// Clouds sky daytime main menu..
cbuffer cb0 : register(b0)
{
float4 cb0[4];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
float2 v0 : POSITION0,
out float4 o0 : SV_POSITION0,
out float4 o1 : TEXCOORD0,
out float3 o2 : TEXCOORD1)
{
float4 r0,r1;
uint4 bitmask, uiDest;
float4 fDest;

o0.xy = v0.xy;
o0.zw = float2(0,1);
o1.xy = v0.xy * float2(0.5,-0.5) + float2(0.5,0.5);
r0.x = cmp(0 < v0.y);
r0.y = cmp(v0.x < 0);
r1.xyz = r0.yyy ? cb0[0].xyz : cb0[1].xyz;
r0.yzw = r0.yyy ? cb0[2].xyz : cb0[3].xyz;
o2.xyz = r0.xxx ? r1.xyz : r0.yzw;

float4 stereo = StereoParams.Load(0);
float depth = stereo.x;
float convergence = stereo.y;
o0.x += depth * 0.99;


return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
// using 3Dmigoto v1.2.56 on Thu Mar 30 21:38:17 2017
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 xy 0 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xy 1 NONE float xy
// TEXCOORD 1 xyz 2 NONE float xyz
//
vs_4_0
dcl_constantbuffer cb0[4], immediateIndexed
dcl_input v0.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyz
dcl_temps 2
mov o0.xy, v0.xyxx
mov o0.zw, l(0,0,0,1.000000)
mad o1.xy, v0.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
lt r0.x, l(0.000000), v0.y
lt r0.y, v0.x, l(0.000000)
movc r1.xyz, r0.yyyy, cb0[0].xyzx, cb0[1].xyzx
movc r0.yzw, r0.yyyy, cb0[2].xxyz, cb0[3].xxyz
movc o2.xyz, r0.xxxx, r1.xyzx, r0.yzwy
ret
// Approximately 0 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/




here is the code for the Bad clouds:


// ---- Created with 3Dmigoto v1.2.56 on Thu Mar 30 23:00:29 2017
// Cumulus clouds over ocean..
cbuffer cb0 : register(b0)
{
float4 cb0[5];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
float2 v0 : POSITION0,
out float4 o0 : SV_POSITION0,
out float3 o1 : TEXCOORD0)
{
float4 r0,r1;
uint4 bitmask, uiDest;
float4 fDest;

o0.z = cb0[4].x * 20 + cb0[4].y;
o0.xy = float2(20,20) * v0.xy;
o0.w = 20;
r0.x = cmp(0 < v0.y);
r0.y = cmp(v0.x < 0);
r1.xyz = r0.yyy ? cb0[0].xyz : cb0[1].xyz;
r0.yzw = r0.yyy ? cb0[2].xyz : cb0[3].xyz;
o1.xyz = r0.xxx ? r1.xyz : r0.yzw;

// Cumulus Clouds to near infinity
float4 stereo = StereoParams.Load(0);
float depth = stereo.x;
float convergence = stereo.y;
o0.x += depth;



return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
// using 3Dmigoto v1.2.56 on Thu Mar 30 23:00:29 2017
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 xy 0 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xyz 1 NONE float xyz
//
vs_4_0
dcl_constantbuffer cb0[5], immediateIndexed
dcl_input v0.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_temps 2
mad o0.z, cb0[4].x, l(20.000000), cb0[4].y
mul o0.xy, v0.xyxx, l(20.000000, 20.000000, 0.000000, 0.000000)
mov o0.w, l(20.000000)
lt r0.x, l(0.000000), v0.y
lt r0.y, v0.x, l(0.000000)
movc r1.xyz, r0.yyyy, cb0[0].xyzx, cb0[1].xyzx
movc r0.yzw, r0.yyyy, cb0[2].xxyz, cb0[3].xxyz
movc o1.xyz, r0.xxxx, r1.xyzx, r0.yzwy
ret
// Approximately 0 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

Intel i5 7600K @ 4.8ghz / MSI Z270 SLI / Asus 1080GTX - 416.16 / Optoma HD142x Projector / 1 4'x10' Curved Screen PVC / TrackIR / HOTAS Cougar / Cougar MFD's / Track IR / NVidia 3D Vision / Win 10 64bit

Posted 04/01/2017 12:35 AM   
[quote="helifax"]Tiny bump;) Anyone, any ideas about the above problem?:)[/quote] If I'm understanding correctly, you are getting CS lights in one eye only. Or at least partly controlled by CS. If that's the case, the main thing is that you need to get it to stereoize the lights. The CS shader needs to be run twice, just like all the other pieces. I assume that you have already added the CS profile setting so that the driver will run CS twice in Automatic. If that's not working, I think you are out of luck until they fix the driver.
helifax said:Tiny bump;) Anyone, any ideas about the above problem?:)

If I'm understanding correctly, you are getting CS lights in one eye only. Or at least partly controlled by CS.

If that's the case, the main thing is that you need to get it to stereoize the lights. The CS shader needs to be run twice, just like all the other pieces.

I assume that you have already added the CS profile setting so that the driver will run CS twice in Automatic. If that's not working, I think you are out of luck until they fix the driver.

Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers

Posted 04/01/2017 01:41 AM   
[quote="The_Nephilim"]Sorry Helifax can not help you there :( I do have a problem I am trying to solve in War Thunder. Well what it is the clouds when flying are broke and not stereoised, I tried injecting the common codes to change it but mothering has an affect.. Now weird thing is same game but when Playing in the Tanks the sky there is perfect?? So what I would like to do is use the shader for the tank sky into the plane sky as I can do notjhing with the cumulus clouds while flying but disable them.. I have the 2 Files and was looking around but I am unsure if I can remove the cumulus from the Flying sky and inject the tank sky into the flying one I hope that makes cense. I seen the part about textures but that did not seem to gointo detail on how to replace the shader itself into the other.. Is this even possible wity Migoto?? IF not Guess I will have to live with it diabled but it is weird I can not affect the cloudsd at all in the Flying sky..[/quote] You should be able to completely replace the skybox using the one that works, but you'd need to replace *both* the VS and PS for that. You can't just do one piece because it's a pipeline, and the inputs must match the outputs. For the formula you are using there for skybox, that is still not quite right. Unless there is some other complexity you always want to use: [code]float separation = StereoParams.Load(0).x; float convergence = StereoParams.Load(0).y; vertex.x += separation * convergence * 0.99; [/code] This is a slight variant I'm now using, because I think it's more clear. Let's use 'separation' instead of 'depth', to more closely match other documentation. Your use of the depth/separation by itself is incorrect. There is no scenario where you would use separation by itself. Using o0 is the correct output however, as that is the SV_POSITION0 for that shader. You can make sure it is the correct shader by setting o0=0. It's easy to get confused and be working in the wrong shader, so sometimes it's necessary to backup and be sure you are having an effect at all.
The_Nephilim said:Sorry Helifax can not help you there :(

I do have a problem I am trying to solve in War Thunder. Well what it is the clouds when flying are broke and not stereoised, I tried injecting the common codes to change it but mothering has an affect..

Now weird thing is same game but when Playing in the Tanks the sky there is perfect?? So what I would like to do is use the shader for the tank sky into the plane sky as I can do notjhing with the cumulus clouds while flying but disable them..

I have the 2 Files and was looking around but I am unsure if I can remove the cumulus from the Flying sky and inject the tank sky into the flying one I hope that makes cense.

I seen the part about textures but that did not seem to gointo detail on how to replace the shader itself into the other..

Is this even possible wity Migoto?? IF not Guess I will have to live with it diabled but it is weird I can not affect the cloudsd at all in the Flying sky..

You should be able to completely replace the skybox using the one that works, but you'd need to replace *both* the VS and PS for that. You can't just do one piece because it's a pipeline, and the inputs must match the outputs.

For the formula you are using there for skybox, that is still not quite right. Unless there is some other complexity you always want to use:

float separation = StereoParams.Load(0).x;
float convergence = StereoParams.Load(0).y;

vertex.x += separation * convergence * 0.99;


This is a slight variant I'm now using, because I think it's more clear. Let's use 'separation' instead of 'depth', to more closely match other documentation.

Your use of the depth/separation by itself is incorrect. There is no scenario where you would use separation by itself.

Using o0 is the correct output however, as that is the SV_POSITION0 for that shader. You can make sure it is the correct shader by setting o0=0. It's easy to get confused and be working in the wrong shader, so sometimes it's necessary to backup and be sure you are having an effect at all.

Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers

Posted 04/01/2017 01:51 AM   
So do I take all the code in both the Good skyboa and replace it with bothe the bad skyboxes or is there morte involved then a simple cope paste over?? Please forgive me for not know but from what you said above that seems like what I have to do but my first attempt failed so I am retrying..
So do I take all the code in both the Good skyboa and replace it with bothe the bad skyboxes or is there morte involved then a simple cope paste over??

Please forgive me for not know but from what you said above that seems like what I have to do but my first attempt failed so I am retrying..

Intel i5 7600K @ 4.8ghz / MSI Z270 SLI / Asus 1080GTX - 416.16 / Optoma HD142x Projector / 1 4'x10' Curved Screen PVC / TrackIR / HOTAS Cougar / Cougar MFD's / Track IR / NVidia 3D Vision / Win 10 64bit

Posted 04/01/2017 04:27 AM   
[quote="helifax"]Right so made some progress on the CS and unlike how I initially believed, is not actually a CS but a part of the CS that renders those lights in what seems to be ONE eye. Once this is disabled I get this (SORRY for the Surround pictures! Look at the character): [url=http://www.iforce.co.nz/View.aspx?i=l1zto3nx.fiv.jpg][img]http://iforce.co.nz/i/l1zto3nx.fiv.jpg[/img][/url] Now this is how it looks be default! Lights showing in one eye: [url=http://www.iforce.co.nz/View.aspx?i=e42p04rm.mjv.jpg][img]http://iforce.co.nz/i/e42p04rm.mjv.jpg[/img][/url] Now the shader (Look for the comments in the shader): http://pastebin.com/bXrpW3dr (Too big to share it here) The fix I apply there fixes the model shadows, so that 100% works. However those lights are in one eye and can't figure it out who or what it does. I know this shader has the headers stripped, but cross-referencing with other FB3 games the buffers are like this: [code] // Buffer Definitions: // // cbuffer cbLightInfo // { // // struct AreaLightInfo // { // // struct BaseLightInfo // { // // float3 pos; // Offset: 0 // float invSqrAttenuationRadius;// Offset: 12 // float3 color; // Offset: 16 // float attenuationOffset; // Offset: 28 // float3 matrixForward; // Offset: 32 // float diffuseScale; // Offset: 44 // float3 matrixUp; // Offset: 48 // float specularScale; // Offset: 60 // float3 matrixLeft; // Offset: 64 // float shadowDimmer; // Offset: 76 // float angleScale; // Offset: 80 // float angleOffset; // Offset: 84 // float2 unused; // Offset: 88 // // } baseLight; // Offset: 0 // // struct BaseAreaLightInfo // { // // float3 virtualPos; // Offset: 96 // float occluderHeight; // Offset: 108 // float areaLightType; // Offset: 112 // float lightRadius0; // Offset: 116 // float lightRadius1; // Offset: 120 // float unused; // Offset: 124 // // } areaLight; // Offset: 96 // // struct VolumetricShadowInfo // { // // float enable; // Offset: 128 // float volumeShadowMapIndex;// Offset: 132 // float invAttenuationRadius;// Offset: 136 // float tanAngle; // Offset: 140 // // } vShadow; // Offset: 128 // // } g_lightInfoArea[128]; // Offset: 0 Size: 18432 // // } // // cbuffer cb0 // { // // float4x4 invViewProjectionMatrix; // Offset: 0 Size: 64 // float4 g_exposureMultipliers; // Offset: 64 Size: 16 // float localIblMipmapBias; // Offset: 80 Size: 4 [unused] // float screenAspectRatio; // Offset: 84 Size: 4 [unused] // float2 invResolution; // Offset: 88 Size: 8 // float4 shadowMapSizeAndInvSize; // Offset: 96 Size: 16 [unused] // uint forceSplitLighting; // Offset: 112 Size: 4 [unused] // uint sssScatteringEnables; // Offset: 116 Size: 4 [unused] // float volumetricShadowmapHalfTexelOffset;// Offset: 120 Size: 4 [unused] // float volumetricShadowmapOneMinusHalfTexelOffset;// Offset: 124 Size: 4 [unused] // float volumetricShadowmapInvMaxCount;// Offset: 128 Size: 4 [unused] // float dynamicAOFactor; // Offset: 132 Size: 4 // uint tileCountX; // Offset: 136 Size: 4 // uint pad1; // Offset: 140 Size: 4 [unused] // float4x3 g_normalBasisTransforms[6];// Offset: 144 Size: 288 // // } // // Resource bind info for g_lightCullInput // { // // uint4 $Element; // Offset: 0 Size: 16 // // } // // Resource bind info for g_lightIndexInput // { // // uint $Element; // Offset: 0 Size: 4 // // } // // Resource bind info for g_compactTileGridBuffer // { // // uint $Element; // Offset: 0 Size: 4 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // g_linearSampler sampler NA NA 0 1 // g_gbufferTexture0 texture float4 2d 0 1 // g_gbufferTexture1 texture float4 2d 1 1 // g_gbufferTexture2 texture float4 2d 2 1 // g_depthTexture texture float 2d 6 1 // g_diffuseOcclusionTexture texture float 2d 10 1 // g_lightCullInput texture struct r/o 19 1 // g_lightIndexInput texture struct r/o 20 1 // g_compactTileGridBuffer texture struct r/o 25 1 // g_outputTexture0 UAV float4 2d 0 1 // cb0 cbuffer NA NA 0 1 // cbLightInfo cbuffer NA NA 1 1 // [/code] cb0[0-3] is the inverse of the ViewProjection Matrix as seen in the code above;) Anyone has any idea on how to "solve this mystery"? :) PS: I tried all of the known formulas so far and the one in the shader fixes the shadows on the model as you can see in the images. I also tried calculate the normal ViewProx Matrix, apply the stereo to r4.x (after this line "div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.x") but makes no no difference :( [/quote] Is this telling you something and may help ??? https://github.com/baldurk/renderdoc/issues/143 http://richiesams.blogspot.de/2014/05/hlsl-turning-float4s-into-float4x4.html https://books.google.de/books?id=yphBBAAAQBAJ&pg=PA164&lpg=PA164&dq=ld_structured_indexable&source=bl&ots=zLWhQW-yfU&sig=wi9eugaC0vNx7DS1dJf9ieMYlL0&hl=de&sa=X&ved=0ahUKEwij2ZuQ8ILTAhUBWxQKHQ-bATgQ6AEINDAD#v=onepage&q=ld_structured_indexable&f=false http://xboxforums.create.msdn.com/forums/t/42896.aspx https://community.amd.com/thread/126444 http://gamedev.stackexchange.com/questions/137191/why-does-the-shader-compiler-reorganize-my-code-in-loops-and-branches/137212 https://forums.geforce.com/default/topic/839133/3d-vision/fallout-4/9/ https://pastebin.com/GX5sespP You may get ida looking @ this ??? [code]loop uge r0.y, r0.x, cb7[0].x breakc_nz r0.y ishl r0.y, r0.x, l(1) ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r1.xzw, r0.y, l(0), t3.xxyz bfi r0.y, l(31), l(1), r0.x, l(1) ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r4.xyz, r0.y, l(0), t3.xyzx lt r4.xyz, r2.xyzx, r4.xyzx and r0.y, r4.y, r4.x and r0.y, r4.z, r0.y lt r1.xzw, r1.xxzw, r3.xxyz and r1.x, r1.z, r1.x and r1.x, r1.w, r1.x and r0.y, r0.y, r1.x if_nz r0.y imm_atomic_iadd r4.x, g4, l(0), l(1) ult r0.y, r4.x, l(64) if_nz r0.y store_structured g5.x, r4.x, l(0), r0.x else break endif endif iadd r0.x, r0.x, l(64) endloop[/code]
helifax said:Right so made some progress on the CS and unlike how I initially believed, is not actually a CS but a part of the CS that renders those lights in what seems to be ONE eye.

Once this is disabled I get this (SORRY for the Surround pictures! Look at the character):
Image


Now this is how it looks be default! Lights showing in one eye:
Image

Now the shader (Look for the comments in the shader):
http://pastebin.com/bXrpW3dr
(Too big to share it here)

The fix I apply there fixes the model shadows, so that 100% works. However those lights are in one eye and can't figure it out who or what it does.

I know this shader has the headers stripped, but cross-referencing with other FB3 games the buffers are like this:

// Buffer Definitions: 
//
// cbuffer cbLightInfo
// {
//
// struct AreaLightInfo
// {
//
// struct BaseLightInfo
// {
//
// float3 pos; // Offset: 0
// float invSqrAttenuationRadius;// Offset: 12
// float3 color; // Offset: 16
// float attenuationOffset; // Offset: 28
// float3 matrixForward; // Offset: 32
// float diffuseScale; // Offset: 44
// float3 matrixUp; // Offset: 48
// float specularScale; // Offset: 60
// float3 matrixLeft; // Offset: 64
// float shadowDimmer; // Offset: 76
// float angleScale; // Offset: 80
// float angleOffset; // Offset: 84
// float2 unused; // Offset: 88
//
// } baseLight; // Offset: 0
//
// struct BaseAreaLightInfo
// {
//
// float3 virtualPos; // Offset: 96
// float occluderHeight; // Offset: 108
// float areaLightType; // Offset: 112
// float lightRadius0; // Offset: 116
// float lightRadius1; // Offset: 120
// float unused; // Offset: 124
//
// } areaLight; // Offset: 96
//
// struct VolumetricShadowInfo
// {
//
// float enable; // Offset: 128
// float volumeShadowMapIndex;// Offset: 132
// float invAttenuationRadius;// Offset: 136
// float tanAngle; // Offset: 140
//
// } vShadow; // Offset: 128
//
// } g_lightInfoArea[128]; // Offset: 0 Size: 18432
//
// }
//
// cbuffer cb0
// {
//
// float4x4 invViewProjectionMatrix; // Offset: 0 Size: 64
// float4 g_exposureMultipliers; // Offset: 64 Size: 16
// float localIblMipmapBias; // Offset: 80 Size: 4 [unused]
// float screenAspectRatio; // Offset: 84 Size: 4 [unused]
// float2 invResolution; // Offset: 88 Size: 8
// float4 shadowMapSizeAndInvSize; // Offset: 96 Size: 16 [unused]
// uint forceSplitLighting; // Offset: 112 Size: 4 [unused]
// uint sssScatteringEnables; // Offset: 116 Size: 4 [unused]
// float volumetricShadowmapHalfTexelOffset;// Offset: 120 Size: 4 [unused]
// float volumetricShadowmapOneMinusHalfTexelOffset;// Offset: 124 Size: 4 [unused]
// float volumetricShadowmapInvMaxCount;// Offset: 128 Size: 4 [unused]
// float dynamicAOFactor; // Offset: 132 Size: 4
// uint tileCountX; // Offset: 136 Size: 4
// uint pad1; // Offset: 140 Size: 4 [unused]
// float4x3 g_normalBasisTransforms[6];// Offset: 144 Size: 288
//
// }
//
// Resource bind info for g_lightCullInput
// {
//
// uint4 $Element; // Offset: 0 Size: 16
//
// }
//
// Resource bind info for g_lightIndexInput
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
// Resource bind info for g_compactTileGridBuffer
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_linearSampler sampler NA NA 0 1
// g_gbufferTexture0 texture float4 2d 0 1
// g_gbufferTexture1 texture float4 2d 1 1
// g_gbufferTexture2 texture float4 2d 2 1
// g_depthTexture texture float 2d 6 1
// g_diffuseOcclusionTexture texture float 2d 10 1
// g_lightCullInput texture struct r/o 19 1
// g_lightIndexInput texture struct r/o 20 1
// g_compactTileGridBuffer texture struct r/o 25 1
// g_outputTexture0 UAV float4 2d 0 1
// cb0 cbuffer NA NA 0 1
// cbLightInfo cbuffer NA NA 1 1
//


cb0[0-3] is the inverse of the ViewProjection Matrix as seen in the code above;)

Anyone has any idea on how to "solve this mystery"? :)

PS:
I tried all of the known formulas so far and the one in the shader fixes the shadows on the model as you can see in the images. I also tried calculate the normal ViewProx Matrix, apply the stereo to r4.x (after this line "div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.x") but makes no no difference :(



Is this telling you something and may help ???

https://github.com/baldurk/renderdoc/issues/143
http://richiesams.blogspot.de/2014/05/hlsl-turning-float4s-into-float4x4.html
https://books.google.de/books?id=yphBBAAAQBAJ&pg=PA164&lpg=PA164&dq=ld_structured_indexable&source=bl&ots=zLWhQW-yfU&sig=wi9eugaC0vNx7DS1dJf9ieMYlL0&hl=de&sa=X&ved=0ahUKEwij2ZuQ8ILTAhUBWxQKHQ-bATgQ6AEINDAD#v=onepage&q=ld_structured_indexable&f=false
http://xboxforums.create.msdn.com/forums/t/42896.aspx
https://community.amd.com/thread/126444
http://gamedev.stackexchange.com/questions/137191/why-does-the-shader-compiler-reorganize-my-code-in-loops-and-branches/137212
https://forums.geforce.com/default/topic/839133/3d-vision/fallout-4/9/
https://pastebin.com/GX5sespP

You may get ida looking @ this ???

loop
uge r0.y, r0.x, cb7[0].x
breakc_nz r0.y
ishl r0.y, r0.x, l(1)
ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r1.xzw, r0.y, l(0), t3.xxyz
bfi r0.y, l(31), l(1), r0.x, l(1)
ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r4.xyz, r0.y, l(0), t3.xyzx
lt r4.xyz, r2.xyzx, r4.xyzx
and r0.y, r4.y, r4.x
and r0.y, r4.z, r0.y
lt r1.xzw, r1.xxzw, r3.xxyz
and r1.x, r1.z, r1.x
and r1.x, r1.w, r1.x
and r0.y, r0.y, r1.x
if_nz r0.y
imm_atomic_iadd r4.x, g4, l(0), l(1)
ult r0.y, r4.x, l(64)
if_nz r0.y
store_structured g5.x, r4.x, l(0), r0.x
else
break
endif
endif
iadd r0.x, r0.x, l(64)
endloop

Like my work? Donations can be made via PayPal to: rauti@inetmx.de

Posted 04/01/2017 08:52 AM   
[quote="bo3b"][quote="helifax"]Tiny bump;) Anyone, any ideas about the above problem?:)[/quote] If I'm understanding correctly, you are getting CS lights in one eye only. Or at least partly controlled by CS. If that's the case, the main thing is that you need to get it to stereoize the lights. The CS shader needs to be run twice, just like all the other pieces. I assume that you have already added the CS profile setting so that the driver will run CS twice in Automatic. If that's not working, I think you are out of luck until they fix the driver.[/quote] Hi Bob, Yes, that is correct. I already put the DX10Stereo flag in the profile. I did actually check and all compute shaders run 2 times per frame! Allow me to explain, what I found so far: - The above CS runs twice per frame. The lights calculated by it are corrected here: [code] mad r3.yz, r1.zzwz, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000) mul r2.xy, r3.yzyy, l(1.000000, -1.000000, 0.000000, 0.000000) mov r2.w, l(1.000000) // depth dp4 r38.x, r2.xyzw, cb0[3].xyzw // stereo.y * depth mul r40.w, r40.y, r38.x // (stereo.y * depth - 1) add r40.w, r40.w, l(-1.000) // stereo.x * (stereo.y * depth - 1) mul r40.w, r40.x, r40.w // r2.x += stereo.x * (stereo.y * depth - 1) mov r38.x, r2.x add r38.x, r38.x, r40.w mov r2.x, r38.x // Original Code dp4 r4.x, r2.xyzw, cb0[0].xyzw dp4 r4.y, r2.xyzw, cb0[1].xyzw dp4 r4.z, r2.xyzw, cb0[2].xyzw dp4 r2.x, r2.xyzw, cb0[3].xyzw div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.x [/code] And this works perfectly fine! However, a bit down the shader samples a texture and "adds" it to the CS "output": [code] loop uge r10.w, r10.z, r2.z breakc_nz r10.w // THIS is where those lights come from!!! // Commenting the ld_structured_indexable will remove the light // same goes for the MAD operation. Thing is I want to fix it if possible. Any idea?:) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r10.w, r10.z, l(0), t20.xxxx imul null, r10.w, r10.w, l(7) mad r16.xyz, -r4.xyzx, r2.xxxx, cb1[r10.w + 0].xyzx [/code] The biggest problem is that it seems that for the LEFT eye (the one with "-stereo") this is blank - missing lights). I believe this t20 content is written in another CS a less then zero operation somewhere discards the content. I am not sure if is t20 that is empty (don't think so) as I think r4.x or r2.x is actually the one coming from "-stereo.x" and later down the line the content is discarded. Problem is, I have no idea where to look from here;)) I tried using Frame-Analysis but wasn't able to find out where that t20 is coming from. This is why I am asking for help, to those who understand and used 3Migoto with all features, to help me out fixing this CS problem;) I expect some Frame-Analysis is required and more than the current CS needs to be changed! (The same as in mostly other games, like ROTTR where the lights were actually using 3 CS shaders) ;))
bo3b said:
helifax said:Tiny bump;) Anyone, any ideas about the above problem?:)

If I'm understanding correctly, you are getting CS lights in one eye only. Or at least partly controlled by CS.

If that's the case, the main thing is that you need to get it to stereoize the lights. The CS shader needs to be run twice, just like all the other pieces.

I assume that you have already added the CS profile setting so that the driver will run CS twice in Automatic. If that's not working, I think you are out of luck until they fix the driver.


Hi Bob,

Yes, that is correct. I already put the DX10Stereo flag in the profile. I did actually check and all compute shaders run 2 times per frame!

Allow me to explain, what I found so far:
- The above CS runs twice per frame. The lights calculated by it are corrected here:

mad r3.yz, r1.zzwz, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
mul r2.xy, r3.yzyy, l(1.000000, -1.000000, 0.000000, 0.000000)
mov r2.w, l(1.000000)

// depth
dp4 r38.x, r2.xyzw, cb0[3].xyzw

// stereo.y * depth
mul r40.w, r40.y, r38.x

// (stereo.y * depth - 1)
add r40.w, r40.w, l(-1.000)

// stereo.x * (stereo.y * depth - 1)
mul r40.w, r40.x, r40.w

// r2.x += stereo.x * (stereo.y * depth - 1)
mov r38.x, r2.x
add r38.x, r38.x, r40.w
mov r2.x, r38.x

// Original Code
dp4 r4.x, r2.xyzw, cb0[0].xyzw
dp4 r4.y, r2.xyzw, cb0[1].xyzw
dp4 r4.z, r2.xyzw, cb0[2].xyzw
dp4 r2.x, r2.xyzw, cb0[3].xyzw
div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.x


And this works perfectly fine!

However, a bit down the shader samples a texture and "adds" it to the CS "output":

loop
uge r10.w, r10.z, r2.z
breakc_nz r10.w

// THIS is where those lights come from!!!
// Commenting the ld_structured_indexable will remove the light
// same goes for the MAD operation. Thing is I want to fix it if possible. Any idea?:)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r10.w, r10.z, l(0), t20.xxxx

imul null, r10.w, r10.w, l(7)
mad r16.xyz, -r4.xyzx, r2.xxxx, cb1[r10.w + 0].xyzx


The biggest problem is that it seems that for the LEFT eye (the one with "-stereo") this is blank - missing lights). I believe this t20 content is written in another CS a less then zero operation somewhere discards the content.

I am not sure if is t20 that is empty (don't think so) as I think r4.x or r2.x is actually the one coming from "-stereo.x" and later down the line the content is discarded.

Problem is, I have no idea where to look from here;)) I tried using Frame-Analysis but wasn't able to find out where that t20 is coming from.
This is why I am asking for help, to those who understand and used 3Migoto with all features, to help me out fixing this CS problem;) I expect some Frame-Analysis is required and more than the current CS needs to be changed! (The same as in mostly other games, like ROTTR where the lights were actually using 3 CS shaders) ;))

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


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

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

Posted 04/01/2017 09:47 AM   
  68 / 88    
Scroll To Top