[quote="4everAwake"]I have two more problems I need assistance with. In the d3d11 log, I'm getting the fault "error X3018: invalid subscript 'xyzw'", but this time, the line reads:
r0.xyzw = LightMaskTexture.Load(r0.xyz).xyzw;
I tried a number of combinations including:
r0 = LightMaskTexture.Load(r0.xyz); //override passes, but lights are missing
r0 = LightMaskTexture.Load(r0); //override passes, but lights are missing
r0 = LightMaskTexture.Load(r0.xyz).xyzw; //override fails
r0.xyz = LightMaskTexture.Load(r0.xyz); //override passes, but lights are missing
r0.xyz = LightMaskTexture.Load(r0.xyz).xyz; //override fails
r0.xyzw = LightMaskTexture.Load(r0.xyzw); //override passes, but lights are missing
r0.xyzw = LightMaskTexture.Load(r0); //override passes, but lights are missing[/quote]
For this one, the problem is that the ASM is only looking for a single uint to load.
It will compile to the same code if you do:
[code] r0.x = LightMaskTexture.Load(r0.xyz).x; //---------------------------invalid subscript
r1.x = LinearDepthBuffer.SampleLevel(PointSampler_s, v1.xy, 0).x; //-invalid subscript
[/code]
4everAwake said:I have two more problems I need assistance with. In the d3d11 log, I'm getting the fault "error X3018: invalid subscript 'xyzw'", but this time, the line reads:
r0.xyzw = LightMaskTexture.Load(r0.xyz).xyzw;
I tried a number of combinations including:
r0 = LightMaskTexture.Load(r0.xyz); //override passes, but lights are missing
r0 = LightMaskTexture.Load(r0); //override passes, but lights are missing
r0 = LightMaskTexture.Load(r0.xyz).xyzw; //override fails
r0.xyz = LightMaskTexture.Load(r0.xyz); //override passes, but lights are missing
r0.xyz = LightMaskTexture.Load(r0.xyz).xyz; //override fails
r0.xyzw = LightMaskTexture.Load(r0.xyzw); //override passes, but lights are missing
r0.xyzw = LightMaskTexture.Load(r0); //override passes, but lights are missing
For this one, the problem is that the ASM is only looking for a single uint to load.
[quote="DarkStarSword"][quote="helifax"]How exactly do I copy a cbuffer from one shader to another? I know how to filter on a texture (for the depth UI) but never tried to copy a cbuffer from one shader to another before;)[/quote][url]https://github.com/bo3b/3Dmigoto/wiki/Resource-Copying[/url]
BTW can you all edit that wiki? @Helifax if memory serves we gave you commit access to 3DMigoto some time back so you should be able to (or was that someone else I'm thinking of?), but I'm not sure if it allows people without commit access like @Oomek to edit it directly. If you can't edit it I suppose you can clone it locally, edit it there then send us a pull request, or you can ask bo3b for commit access.
Some of the pages are fairly out of date by now and many of the recent features are not documented on it at all, and it would be good if people could try to update it a little.[/quote]
The edit button seems to be working for me.
helifax said:How exactly do I copy a cbuffer from one shader to another? I know how to filter on a texture (for the depth UI) but never tried to copy a cbuffer from one shader to another before;)
BTW can you all edit that wiki? @Helifax if memory serves we gave you commit access to 3DMigoto some time back so you should be able to (or was that someone else I'm thinking of?), but I'm not sure if it allows people without commit access like @Oomek to edit it directly. If you can't edit it I suppose you can clone it locally, edit it there then send us a pull request, or you can ask bo3b for commit access.
Some of the pages are fairly out of date by now and many of the recent features are not documented on it at all, and it would be good if people could try to update it a little.
[quote="DarkStarSword"][center][size="L"][color="orange"]3DMigoto 1.2.31 is out:[/color]
[/quote]
Hello,
There is still VS shaders no decompiled with DCS World, like the one I posted. Is it expected ?
DarkStarSword said:[center][size="L"]3DMigoto 1.2.31 is out:
Hello,
There is still VS shaders no decompiled with DCS World, like the one I posted. Is it expected ?
No, sorry, these ld_structured_indexable instructions are complicated, and I don't yet have a way to handle all the struct and embedded struct variants that they provide.
In the meantime, if it's only a few shaders needed, we can fix them by hand. I'm happy to do that.
Here is the one from post #810, fixed:
// ---- Created with 3Dmigoto v1.2.21 on Fri Feb 05 23:11:15 2016
Thanks for the suggestion, bo3b. But it's still not working, unfortunately (override passes with no faults, lights missing). Anyways it's no biggie. I decided to use ASM instead and now everything works.
Also, I was wondering if I can bother you with another ld_structured_indexable problem?
// ---- Created with 3Dmigoto v1.2.31 on Sat Feb 20 12:26:45 2016
[quote="bo3b"]
In the meantime, if it's only a few shaders needed, we can fix them by hand. I'm happy to do that.
[/quote]
Thanks for the shader, it allows me to fix the HDR effect. I only have another shader to fix not decompiled, this is [url=http://www.mediafire.com/view/m516om3l9pqa37t/1ebdb3925859d5f6-vs.txt]this one [/url](night illumination only seen by one eye). So if you have some spare time...
I have another request. I wonder if I can use depth buffer in order to not draw labels behind cockpit frame, because as, they are at infinite depth, this is annoying for the brain to see them in the same area than things that are less than 1 meter in front of you (I put a picture in [url=https://forums.geforce.com/default/topic/685657/3d-vision/3dmigoto-now-open-source-/post/4772327/#4772327]this post[/url]).
So I droped all shaders and started to look in ShaderUsage.txt. I found that 5 textures may be used fo depth buffer, some of them have the size of the screen, it may be good for may purpose.
[code]<DepthTarget orig_hash=225e9333 type=Texture2D Width=1920 Height=1080 MipLevels=1 ArraySize=1 RawFormat=19 Format="R32G8X24_TYPELESS" SampleDesc.Count=4 SampleDesc.Quality=8 Usage=0 BindFlags=0x48 CPUAccessFlags=0x0 MiscFlags=0x0></DepthTarget>
<DepthTarget orig_hash=5707ec7d type=Texture2D Width=512 Height=512 MipLevels=1 ArraySize=1 RawFormat=19 Format="R32G8X24_TYPELESS" SampleDesc.Count=4 SampleDesc.Quality=8 Usage=0 BindFlags=0x48 CPUAccessFlags=0x0 MiscFlags=0x0></DepthTarget>
<DepthTarget orig_hash=a98c980a type=Texture2D Width=1920 Height=1080 MipLevels=1 ArraySize=1 RawFormat=44 Format="R24G8_TYPELESS" SampleDesc.Count=1 SampleDesc.Quality=0 Usage=0 BindFlags=0x48 CPUAccessFlags=0x0 MiscFlags=0x0></DepthTarget>
<DepthTarget orig_hash=c5057d7e type=Texture2D Width=1920 Height=1080 MipLevels=1 ArraySize=1 RawFormat=19 Format="R32G8X24_TYPELESS" SampleDesc.Count=1 SampleDesc.Quality=0 Usage=0 BindFlags=0x48 CPUAccessFlags=0x0 MiscFlags=0x0></DepthTarget>
<DepthTarget orig_hash=dcd5e744 type=Texture2D Width=512 Height=512 MipLevels=1 ArraySize=1 RawFormat=44 Format="R24G8_TYPELESS" SampleDesc.Count=1 SampleDesc.Quality=0 Usage=0 BindFlags=0x48 CPUAccessFlags=0x0 MiscFlags=0x0></DepthTarget>[/code]
A lot of shaders have the lines "<DepthTarget handle", but I did not find the register used for the depth texture, like darkStarSword previously, and when I looked into shaders related to "<DepthTarget handle" lines, they do not refer at all at depth buffers if the source code...
So I made a search for "depth" in all shaders, and found 9 shaders using either
[code]// depthTex texture float4 2d 1 1
Texture2D<float4> depthTex : register(t1);
r0.xyzw = depthTex.SampleLevel(gPointClampSampler_s, r0.xy, 0).xyzw;
[/code]
or [code]// depthMap texture float 2dMS4 1 1
Texture2DMS<float,4> depthMap : register(t1);
r2.xyzw = depthMap.Load(r2.xy, 0).yzxw;
[/code]
My problem is that none of them is in "ShaderUsage.txt" and they all have error in d3d11_log.txt...
The error looks always the same :
[code]D:\jeux\DCS World 2 OpenAlpha\wrapper1349(90,14-19): error X3018: invalid subscript 'xyz'[/code] and the line 90 for this particular shader is
[code]r2.xyz = v3.xyz;[/code]
so I think I only have to replace it by [code] r2 = v3;[/code]
My questions are : why aren't the 9 shaders in ShaderUsage.txt ? How can I know which texture they load ? Could I use one of them to get the depth buffer texture ? If this is the case, what is it best to use : the depthTex or the depthMap ?
bo3b said:
In the meantime, if it's only a few shaders needed, we can fix them by hand. I'm happy to do that.
Thanks for the shader, it allows me to fix the HDR effect. I only have another shader to fix not decompiled, this is this one (night illumination only seen by one eye). So if you have some spare time...
I have another request. I wonder if I can use depth buffer in order to not draw labels behind cockpit frame, because as, they are at infinite depth, this is annoying for the brain to see them in the same area than things that are less than 1 meter in front of you (I put a picture in this post).
So I droped all shaders and started to look in ShaderUsage.txt. I found that 5 textures may be used fo depth buffer, some of them have the size of the screen, it may be good for may purpose.
A lot of shaders have the lines "<DepthTarget handle", but I did not find the register used for the depth texture, like darkStarSword previously, and when I looked into shaders related to "<DepthTarget handle" lines, they do not refer at all at depth buffers if the source code...
So I made a search for "depth" in all shaders, and found 9 shaders using either
My problem is that none of them is in "ShaderUsage.txt" and they all have error in d3d11_log.txt...
The error looks always the same :
D:\jeux\DCS World 2 OpenAlpha\wrapper1349(90,14-19): error X3018: invalid subscript 'xyz'
and the line 90 for this particular shader is
r2.xyz = v3.xyz;
so I think I only have to replace it by
r2 = v3;
My questions are : why aren't the 9 shaders in ShaderUsage.txt ? How can I know which texture they load ? Could I use one of them to get the depth buffer texture ? If this is the case, what is it best to use : the depthTex or the depthMap ?
[quote="DarkStarSword"][quote="helifax"]How exactly do I copy a cbuffer from one shader to another? I know how to filter on a texture (for the depth UI) but never tried to copy a cbuffer from one shader to another before;)[/quote][url]https://github.com/bo3b/3Dmigoto/wiki/Resource-Copying[/url]
BTW can you all edit that wiki? @Helifax if memory serves we gave you commit access to 3DMigoto some time back so you should be able to (or was that someone else I'm thinking of?), but I'm not sure if it allows people without commit access like @Oomek to edit it directly. If you can't edit it I suppose you can clone it locally, edit it there then send us a pull request, or you can ask bo3b for commit access.
Some of the pages are fairly out of date by now and many of the recent features are not documented on it at all, and it would be good if people could try to update it a little.[/quote]
Yes;) I have access;)
I will update the wiki SOON (rather than later) will all the stuff that I learned and have stickied/bookmarked;)
Sorry, I just saw the post....been so busy with Rise of Tomb Raider fixing (it's become quite a bit of an obsession lol) as I want to make it as 3D Vision ready as possible... (those DAMN endless shaders prove it difficult:) ) Definitely the BIGGEST and time consuming fix I ever worked on:))
Still need to read on those a bit;) But BIG thanks for the link!
helifax said:How exactly do I copy a cbuffer from one shader to another? I know how to filter on a texture (for the depth UI) but never tried to copy a cbuffer from one shader to another before;)
BTW can you all edit that wiki? @Helifax if memory serves we gave you commit access to 3DMigoto some time back so you should be able to (or was that someone else I'm thinking of?), but I'm not sure if it allows people without commit access like @Oomek to edit it directly. If you can't edit it I suppose you can clone it locally, edit it there then send us a pull request, or you can ask bo3b for commit access.
Some of the pages are fairly out of date by now and many of the recent features are not documented on it at all, and it would be good if people could try to update it a little.
Yes;) I have access;)
I will update the wiki SOON (rather than later) will all the stuff that I learned and have stickied/bookmarked;)
Sorry, I just saw the post....been so busy with Rise of Tomb Raider fixing (it's become quite a bit of an obsession lol) as I want to make it as 3D Vision ready as possible... (those DAMN endless shaders prove it difficult:) ) Definitely the BIGGEST and time consuming fix I ever worked on:))
Still need to read on those a bit;) But BIG thanks for the link!
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
Thanks for the suggestion, bo3b. But it's still not working, unfortunately (override passes with no faults, lights missing). Anyways it's no biggie. I decided to use ASM instead and now everything works.
Also, I was wondering if I can bother you with another ld_structured_indexable problem?
OK, that's odd, because the code created as above had the same ASM. Might be a different problem in the file.
For this second shader, this looks right:
// ---- Created with 3Dmigoto v1.2.31 on Sat Feb 20 12:26:45 2016
[quote="lefuneste"][quote="bo3b"]
In the meantime, if it's only a few shaders needed, we can fix them by hand. I'm happy to do that.
[/quote]
Thanks for the shader, it allows me to fix the HDR effect. I only have another shader to fix not decompiled, this is [url=http://www.mediafire.com/view/m516om3l9pqa37t/1ebdb3925859d5f6-vs.txt]this one [/url](night illumination only seen by one eye). So if you have some spare time...[/quote]
For doing these hand-tweaks, I need the shader as dumped by the Decompiler, during Copy-on-Mark. This one is only ASM, and I need both halves, the HLSL Decompiled code, and the matching ASM.
Also, please just post them inline here in code blocks, going to external sites is undesirable.
bo3b said:
In the meantime, if it's only a few shaders needed, we can fix them by hand. I'm happy to do that.
Thanks for the shader, it allows me to fix the HDR effect. I only have another shader to fix not decompiled, this is this one (night illumination only seen by one eye). So if you have some spare time...
For doing these hand-tweaks, I need the shader as dumped by the Decompiler, during Copy-on-Mark. This one is only ASM, and I need both halves, the HLSL Decompiled code, and the matching ASM.
Also, please just post them inline here in code blocks, going to external sites is undesirable.
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
@bo3b I believe lefuneste reported that shader crashes the decompiler, hence no HLSL until we fix it. The binary (export_binary=1) could be useful to use cmd_Decompiler against.
I already tried assembling the shader he posted and decompiling the result of that, which did not crash, but is missing type information (because the stand-alone assembler currently does not parse the resource comments, only the signatures), so there is a strong possibility the crash is coming from the resource info parsing in 3DMigoto.
@bo3b I believe lefuneste reported that shader crashes the decompiler, hence no HLSL until we fix it. The binary (export_binary=1) could be useful to use cmd_Decompiler against.
I already tried assembling the shader he posted and decompiling the result of that, which did not crash, but is missing type information (because the stand-alone assembler currently does not parse the resource comments, only the signatures), so there is a strong possibility the crash is coming from the resource info parsing in 3DMigoto.
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
[quote="DarkStarSword"]@bo3b I believe lefuneste reported that shader crashes the decompiler, hence no HLSL until we fix it. The binary (export_binary=1) could be useful to use cmd_Decompiler against.[/quote]
Right. I do not know how to have anything else than the sended shader and the binary export [url=http://www.mediafire.com/download/c6kzk8nzmcca0ua/1ebdb3925859d5f6-vs.bin]here[/url]. Sorry for storing the shader in an external site, but this is a binary...I tried to add in as a jps file, but it seems that the scanning is not working.
DarkStarSword said:@bo3b I believe lefuneste reported that shader crashes the decompiler, hence no HLSL until we fix it. The binary (export_binary=1) could be useful to use cmd_Decompiler against.
Right. I do not know how to have anything else than the sended shader and the binary export here. Sorry for storing the shader in an external site, but this is a binary...I tried to add in as a jps file, but it seems that the scanning is not working.
[quote="lefuneste"][quote="DarkStarSword"]@bo3b I believe lefuneste reported that shader crashes the decompiler, hence no HLSL until we fix it. The binary (export_binary=1) could be useful to use cmd_Decompiler against.[/quote]
Right. I do not know how to have anything else than the sended shader and the binary export [url=http://www.mediafire.com/download/c6kzk8nzmcca0ua/1ebdb3925859d5f6-vs.bin]here[/url]. Sorry for storing the shader in an external site, but this is a binary...I tried to add in as a jps file, but it seems that the scanning is not working.[/quote]
I see. As a general approach, I really want the Decompiler to not generate exceptions, as then we have nothing we can even hand patch. So, I've put in a fair amount of effort to get everything past that stage.
Since this is free-to-play, I went ahead and downloaded the game and ran it with the latest 3Dmigoto.
I'm seeing a couple of exceptions, but only for HullShaders and GeometryShaders. Our support for those shader models is not very good, so I've not put much effort into getting past those, even when they have exceptions. If you actually need a HullShader or GeometryShader, you should use the Assembler instead.
I don't see any other exceptions. Your crc 1ebdb3925859d5f6-vs.bin I don't see when I run the game and do Instant Action or first campaign.
Edit: Flying a night mission, I see a glitching shader, but it can be hunted normally, no errors reported.
Looks like:
[img]https://forums.geforce.com/cmd/default/download-comment-attachment/68371/[/img]
Two shaders:
f862578dabae93f1-vs_replace
f73dbee620619e84-ps_replace
DarkStarSword said:@bo3b I believe lefuneste reported that shader crashes the decompiler, hence no HLSL until we fix it. The binary (export_binary=1) could be useful to use cmd_Decompiler against.
Right. I do not know how to have anything else than the sended shader and the binary export here. Sorry for storing the shader in an external site, but this is a binary...I tried to add in as a jps file, but it seems that the scanning is not working.
I see. As a general approach, I really want the Decompiler to not generate exceptions, as then we have nothing we can even hand patch. So, I've put in a fair amount of effort to get everything past that stage.
Since this is free-to-play, I went ahead and downloaded the game and ran it with the latest 3Dmigoto.
I'm seeing a couple of exceptions, but only for HullShaders and GeometryShaders. Our support for those shader models is not very good, so I've not put much effort into getting past those, even when they have exceptions. If you actually need a HullShader or GeometryShader, you should use the Assembler instead.
I don't see any other exceptions. Your crc 1ebdb3925859d5f6-vs.bin I don't see when I run the game and do Instant Action or first campaign.
Edit: Flying a night mission, I see a glitching shader, but it can be hunted normally, no errors reported.
Looks like:
Two shaders:
f862578dabae93f1-vs_replace
f73dbee620619e84-ps_replace
Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607 Latest 3Dmigoto Release Bo3b's School for ShaderHackers
[quote="bo3b"]
I don't see any other exceptions. Your crc 1ebdb3925859d5f6-vs.bin I don't see when I run the game and do Instant Action or first campaign.
[/quote]
It's because this shader is coming from the 2.0 alpha version. Unfortunately for the moment, this version is linked to a map that is not free ($50 !) and protected, so it is not worth to download it...
I though that the last 1.5.3 version used the same shader than the 2.0, because when they deploy the last 1.5.2 => 1.5.3 update, I had to rename all the fixed shaders with the same names used for 2.0 version. But I just checked: the problem with the night illumination is not present on 1.5.3 and is on the 2.0...
I also checked that, even if there are a lot of shaders with the " Known bad code for instruction", all are now dumped.
I am sorry for having make you spend your time...I know that I am annoying and clumsy, but as you have DCS on your PC, maybe you could have a look on my problem with the usage of depth buffer for label filtering ?
And I also did not manage to solve efficiently the problem with the horizon (use free flight with Su25T and roll plane to the right or the left to see it). I had to find from another shader the view matrix and add additional fix for left or right eye regarding the roll angle of the plane). I'm not proud of that fix...
In which mission did you find the glitching shader when at night ?
bo3b said:
I don't see any other exceptions. Your crc 1ebdb3925859d5f6-vs.bin I don't see when I run the game and do Instant Action or first campaign.
It's because this shader is coming from the 2.0 alpha version. Unfortunately for the moment, this version is linked to a map that is not free ($50 !) and protected, so it is not worth to download it...
I though that the last 1.5.3 version used the same shader than the 2.0, because when they deploy the last 1.5.2 => 1.5.3 update, I had to rename all the fixed shaders with the same names used for 2.0 version. But I just checked: the problem with the night illumination is not present on 1.5.3 and is on the 2.0...
I also checked that, even if there are a lot of shaders with the " Known bad code for instruction", all are now dumped.
I am sorry for having make you spend your time...I know that I am annoying and clumsy, but as you have DCS on your PC, maybe you could have a look on my problem with the usage of depth buffer for label filtering ?
And I also did not manage to solve efficiently the problem with the horizon (use free flight with Su25T and roll plane to the right or the left to see it). I had to find from another shader the view matrix and add additional fix for left or right eye regarding the roll angle of the plane). I'm not proud of that fix...
In which mission did you find the glitching shader when at night ?
[quote="lefuneste"]I have another request. I wonder if I can use depth buffer in order to not draw labels behind cockpit frame, because as, they are at infinite depth, this is annoying for the brain to see them in the same area than things that are less than 1 meter in front of you (I put a picture in [url=https://forums.geforce.com/default/topic/685657/3d-vision/3dmigoto-now-open-source-/post/4772327/#4772327]this post[/url]).[/quote]
Sorry, I meant to respond to this earlier. For this the depth buffer may not work as it is very common for transparent effects like glass not to write to it. If you did want to go down that path, you could take a look at the approach I used in The Witness and have a custom shader render depth information to a custom resource and then use that from the HUD shader to position the text. This also avoids the problem of having to work out how the depth buffer is scaled as you can simply write W values directly to the custom resource (provided that it's format is suitable, like R32_FLOAT. Avoid UNORM or integer formats).
Another option is to try to copy position information (a constant buffer with the MVP matrix, the vertex buffer and (if it uses one) the index buffer) from the glass shader to the HUD shader to get the position of the glass vertices and use them to position the HUD. Another more involved option would be to really mess with the rendering pipeline and render the HUD to an offscreen buffer then render the glass with the HUD overlayed on it (I haven't done anything like this yet, but between the arbitrary resource copying, arbitrary resource creation and custom shader injection this might just be possible, but would most likely run into issues).
It might however be a lot simpler to just move the HUD to a fixed depth roughly lined up with the glass. There's a few approaches you can take for this - the easiest is to first move it to screen depth by subtracting the nvidia formula, then move it back to a fixed depth. Since you are trying to make it line up with something in the world you probably don't want to use the usual HUD adjustment formula as you need it to vary with convergence, and also since it's already at depth you will need to account for the difference in the perspective divide as well.
Off the top of my head, it should be something like this:
[code]
o0.x -= separation * (o0.w - convergence);
o0.x += separation * (desired_depth - convergence) / desired_depth * o0.w;
[/code]
Which mathomatic tells me simplifies to:
[code]
o0.x += separation * convergence * (1 - (o0.w / desired_depth));
[/code]
Another option since they are already rendered at depth is to scale the output coordinate to adjust where the driver will draw them - if the HUD happens to already be 3D (but just a long way away) this can preserve relative differences between HUD elements.
[code]
o0 *= 0.2;
[/code]
Adjust the constant to find something suitable. Between 0 and 1 (not inclusive) moves it closer to the camera, > 1 moves further away.
See how you go with that, but I'll answer the rest of your questions anyway:
[quote]A lot of shaders have the lines "<DepthTarget handle", but I did not find the register used for the depth texture, like darkStarSword previously, and when I looked into shaders related to "<DepthTarget handle" lines, they do not refer at all at depth buffers if the source code...[/quote]
The DepthTarget here refers to the active depth target, and it won't be referred to in the shader (usually - there are some exceptions that use the SV_Depth semantic) as it comes into play in the rasterizer, not the shaders. If you see a texture called depth buffer that will be a shader that is reading the depth buffer, not writing to it (or in the event it is doing both it will be reading from a copy). In the 3DMigoto arbitrary resource copying feature, the active depth target is referred to as 'oD' (output Depth).
[quote]So I made a search for "depth" in all shaders, and found 9 shaders using either[/quote]These will be shaders that read from the depth buffer. If you did copy it these are good choices as the fact they are reading it suggests that they are in the deferred or transparent rendering phases and the depth buffer will be final at that point. There's also a really good chance that they will contain the necessary code and constants to scale the depth buffer to world coordinates which is required for the auto crosshair code to work (however if they don't figuring out the right scaling is really *really* difficult).
[quote]My problem is that none of them is in "ShaderUsage.txt" and they all have error in d3d11_log.txt...[/quote]That's not necessarily a problem - the arbitrary resource copying feature only needs their hash to work (or the hash of the corresponding vertex/pixel shader), the shaders only have to be included if you actually modify them.
[quote]The error looks always the same :
[code]D:\jeux\DCS World 2 OpenAlpha\wrapper1349(90,14-19): error X3018: invalid subscript 'xyz'[/code] and the line 90 for this particular shader is
[code]r2.xyz = v3.xyz;[/code]
so I think I only have to replace it by [code] r2 = v3;[/code][/quote]
Yeah, that error is fairly common and that will usually work, though if v3 was split into two variables like v3 and w3 you might need to do something like:
[code]
r2.xy = v3.xy;
r2.z = w3.x;
[/code]
[quote]My questions are : why aren't the 9 shaders in ShaderUsage.txt ?[/quote]ShaderUsage.txt is only updated when dumping out a shader, so it might just be outdated. Another possibility is that those shaders are not always active (which would be a problem if you try to copy anything from them). Also, if you are using hunting=2 (as opposed to hunting=1) 3DMigoto won't collect usage statistics while the overlay is disabled (this is why you may notice a difference in fps when toggling the overlay in some games), which can allow for some shaders/textures to be missed in the ShaderUsage.txt (but if they were active when you dumped the last shader this won't be it).
[quote]How can I know which texture they load ?[/quote]Studying their code and/or assembly is the best way.
[quote]Could I use one of them to get the depth buffer texture ?[/quote]Yes, but as I mentioned above I think there are better options for this case.
[quote]If this is the case, what is it best to use : the depthTex or the depthMap ?[/quote]My guess is depthTex based on the name, but without looking at the game I can't be sure. You could dump them out with frame analysis to see what they contain.
lefuneste said:I have another request. I wonder if I can use depth buffer in order to not draw labels behind cockpit frame, because as, they are at infinite depth, this is annoying for the brain to see them in the same area than things that are less than 1 meter in front of you (I put a picture in this post).
Sorry, I meant to respond to this earlier. For this the depth buffer may not work as it is very common for transparent effects like glass not to write to it. If you did want to go down that path, you could take a look at the approach I used in The Witness and have a custom shader render depth information to a custom resource and then use that from the HUD shader to position the text. This also avoids the problem of having to work out how the depth buffer is scaled as you can simply write W values directly to the custom resource (provided that it's format is suitable, like R32_FLOAT. Avoid UNORM or integer formats).
Another option is to try to copy position information (a constant buffer with the MVP matrix, the vertex buffer and (if it uses one) the index buffer) from the glass shader to the HUD shader to get the position of the glass vertices and use them to position the HUD. Another more involved option would be to really mess with the rendering pipeline and render the HUD to an offscreen buffer then render the glass with the HUD overlayed on it (I haven't done anything like this yet, but between the arbitrary resource copying, arbitrary resource creation and custom shader injection this might just be possible, but would most likely run into issues).
It might however be a lot simpler to just move the HUD to a fixed depth roughly lined up with the glass. There's a few approaches you can take for this - the easiest is to first move it to screen depth by subtracting the nvidia formula, then move it back to a fixed depth. Since you are trying to make it line up with something in the world you probably don't want to use the usual HUD adjustment formula as you need it to vary with convergence, and also since it's already at depth you will need to account for the difference in the perspective divide as well.
Off the top of my head, it should be something like this:
Another option since they are already rendered at depth is to scale the output coordinate to adjust where the driver will draw them - if the HUD happens to already be 3D (but just a long way away) this can preserve relative differences between HUD elements.
o0 *= 0.2;
Adjust the constant to find something suitable. Between 0 and 1 (not inclusive) moves it closer to the camera, > 1 moves further away.
See how you go with that, but I'll answer the rest of your questions anyway:
A lot of shaders have the lines "<DepthTarget handle", but I did not find the register used for the depth texture, like darkStarSword previously, and when I looked into shaders related to "<DepthTarget handle" lines, they do not refer at all at depth buffers if the source code...
The DepthTarget here refers to the active depth target, and it won't be referred to in the shader (usually - there are some exceptions that use the SV_Depth semantic) as it comes into play in the rasterizer, not the shaders. If you see a texture called depth buffer that will be a shader that is reading the depth buffer, not writing to it (or in the event it is doing both it will be reading from a copy). In the 3DMigoto arbitrary resource copying feature, the active depth target is referred to as 'oD' (output Depth).
So I made a search for "depth" in all shaders, and found 9 shaders using either
These will be shaders that read from the depth buffer. If you did copy it these are good choices as the fact they are reading it suggests that they are in the deferred or transparent rendering phases and the depth buffer will be final at that point. There's also a really good chance that they will contain the necessary code and constants to scale the depth buffer to world coordinates which is required for the auto crosshair code to work (however if they don't figuring out the right scaling is really *really* difficult).
My problem is that none of them is in "ShaderUsage.txt" and they all have error in d3d11_log.txt...
That's not necessarily a problem - the arbitrary resource copying feature only needs their hash to work (or the hash of the corresponding vertex/pixel shader), the shaders only have to be included if you actually modify them.
The error looks always the same :
D:\jeux\DCS World 2 OpenAlpha\wrapper1349(90,14-19): error X3018: invalid subscript 'xyz'
and the line 90 for this particular shader is
r2.xyz = v3.xyz;
so I think I only have to replace it by
r2 = v3;
Yeah, that error is fairly common and that will usually work, though if v3 was split into two variables like v3 and w3 you might need to do something like:
r2.xy = v3.xy;
r2.z = w3.x;
My questions are : why aren't the 9 shaders in ShaderUsage.txt ?
ShaderUsage.txt is only updated when dumping out a shader, so it might just be outdated. Another possibility is that those shaders are not always active (which would be a problem if you try to copy anything from them). Also, if you are using hunting=2 (as opposed to hunting=1) 3DMigoto won't collect usage statistics while the overlay is disabled (this is why you may notice a difference in fps when toggling the overlay in some games), which can allow for some shaders/textures to be missed in the ShaderUsage.txt (but if they were active when you dumped the last shader this won't be it).
How can I know which texture they load ?
Studying their code and/or assembly is the best way.
Could I use one of them to get the depth buffer texture ?
Yes, but as I mentioned above I think there are better options for this case.
If this is the case, what is it best to use : the depthTex or the depthMap ?
My guess is depthTex based on the name, but without looking at the game I can't be sure. You could dump them out with frame analysis to see what they contain.
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
[quote="DarkStarSword"] For this the depth buffer may not work as it is very common for transparent effects like glass not to write to it.
Thanks for your answer.
Maybe I was not very clear, this is not the HUD that I want to fix, I already did that with the simplest way. But I will try your formula to get ride of convergence settings (I had to introduce a parameter in d3dx.ini in order to make users fit the HUD with their conv/sep. settings).
I want to filter the blue labels if they are behind the cockpit frame. So this should be great if there is no depth information for glass, so I should only get the frame cockpit or the ground depth.
So I will try to use a shader with depthTex. I already try to dump the texture (with a global FrameAnalysis option), but it dumps only one of the 9 depthTarget as dds texture. It is a 3840*1080 texture and, using Xnconvert, I can see that there are things like illumination, glasses,.. in it
[/quote]
DarkStarSword said: For this the depth buffer may not work as it is very common for transparent effects like glass not to write to it.
Thanks for your answer.
Maybe I was not very clear, this is not the HUD that I want to fix, I already did that with the simplest way. But I will try your formula to get ride of convergence settings (I had to introduce a parameter in d3dx.ini in order to make users fit the HUD with their conv/sep. settings).
I want to filter the blue labels if they are behind the cockpit frame. So this should be great if there is no depth information for glass, so I should only get the frame cockpit or the ground depth.
So I will try to use a shader with depthTex. I already try to dump the texture (with a global FrameAnalysis option), but it dumps only one of the 9 depthTarget as dds texture. It is a 3840*1080 texture and, using Xnconvert, I can see that there are things like illumination, glasses,.. in it
For this one, the problem is that the ASM is only looking for a single uint to load.
It will compile to the same code if you do:
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
The edit button seems to be working for me.
EVGA GeForce GTX 980 SC
Core i5 2500K
MSI Z77A-G45
8GB DDR3
Windows 10 x64
Hello,
There is still VS shaders no decompiled with DCS World, like the one I posted. Is it expected ?
No, sorry, these ld_structured_indexable instructions are complicated, and I don't yet have a way to handle all the struct and embedded struct variants that they provide.
In the meantime, if it's only a few shaders needed, we can fix them by hand. I'm happy to do that.
Here is the one from post #810, fixed:
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
Thanks for the suggestion, bo3b. But it's still not working, unfortunately (override passes with no faults, lights missing). Anyways it's no biggie. I decided to use ASM instead and now everything works.
Also, I was wondering if I can bother you with another ld_structured_indexable problem?
Dual boot Win 7 x64 & Win 10 (1809) | Geforce Drivers 417.35
Thanks for the shader, it allows me to fix the HDR effect. I only have another shader to fix not decompiled, this is this one (night illumination only seen by one eye). So if you have some spare time...
I have another request. I wonder if I can use depth buffer in order to not draw labels behind cockpit frame, because as, they are at infinite depth, this is annoying for the brain to see them in the same area than things that are less than 1 meter in front of you (I put a picture in this post).
So I droped all shaders and started to look in ShaderUsage.txt. I found that 5 textures may be used fo depth buffer, some of them have the size of the screen, it may be good for may purpose.
A lot of shaders have the lines "<DepthTarget handle", but I did not find the register used for the depth texture, like darkStarSword previously, and when I looked into shaders related to "<DepthTarget handle" lines, they do not refer at all at depth buffers if the source code...
So I made a search for "depth" in all shaders, and found 9 shaders using either
or
My problem is that none of them is in "ShaderUsage.txt" and they all have error in d3d11_log.txt...
The error looks always the same :
and the line 90 for this particular shader is
so I think I only have to replace it by
My questions are : why aren't the 9 shaders in ShaderUsage.txt ? How can I know which texture they load ? Could I use one of them to get the depth buffer texture ? If this is the case, what is it best to use : the depthTex or the depthMap ?
Yes;) I have access;)
I will update the wiki SOON (rather than later) will all the stuff that I learned and have stickied/bookmarked;)
Sorry, I just saw the post....been so busy with Rise of Tomb Raider fixing (it's become quite a bit of an obsession lol) as I want to make it as 3D Vision ready as possible... (those DAMN endless shaders prove it difficult:) ) Definitely the BIGGEST and time consuming fix I ever worked on:))
Still need to read on those a bit;) But BIG thanks for the link!
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)
OK, that's odd, because the code created as above had the same ASM. Might be a different problem in the file.
For this second shader, this looks right:
BTW, I'm happy to take a look at these, but people should send me a PM to get my attention (email notifies me). I'm likely to miss forum posts.
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
For doing these hand-tweaks, I need the shader as dumped by the Decompiler, during Copy-on-Mark. This one is only ASM, and I need both halves, the HLSL Decompiled code, and the matching ASM.
Also, please just post them inline here in code blocks, going to external sites is undesirable.
Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers
I already tried assembling the shader he posted and decompiling the result of that, which did not crash, but is missing type information (because the stand-alone assembler currently does not parse the resource comments, only the signatures), so there is a strong possibility the crash is coming from the resource info parsing in 3DMigoto.
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
Right. I do not know how to have anything else than the sended shader and the binary export here. Sorry for storing the shader in an external site, but this is a binary...I tried to add in as a jps file, but it seems that the scanning is not working.
I see. As a general approach, I really want the Decompiler to not generate exceptions, as then we have nothing we can even hand patch. So, I've put in a fair amount of effort to get everything past that stage.
Since this is free-to-play, I went ahead and downloaded the game and ran it with the latest 3Dmigoto.
I'm seeing a couple of exceptions, but only for HullShaders and GeometryShaders. Our support for those shader models is not very good, so I've not put much effort into getting past those, even when they have exceptions. If you actually need a HullShader or GeometryShader, you should use the Assembler instead.
I don't see any other exceptions. Your crc 1ebdb3925859d5f6-vs.bin I don't see when I run the game and do Instant Action or first campaign.
Edit: Flying a night mission, I see a glitching shader, but it can be hunted normally, no errors reported.
Looks like:
Two shaders:
f862578dabae93f1-vs_replace
f73dbee620619e84-ps_replace
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
It's because this shader is coming from the 2.0 alpha version. Unfortunately for the moment, this version is linked to a map that is not free ($50 !) and protected, so it is not worth to download it...
I though that the last 1.5.3 version used the same shader than the 2.0, because when they deploy the last 1.5.2 => 1.5.3 update, I had to rename all the fixed shaders with the same names used for 2.0 version. But I just checked: the problem with the night illumination is not present on 1.5.3 and is on the 2.0...
I also checked that, even if there are a lot of shaders with the " Known bad code for instruction", all are now dumped.
I am sorry for having make you spend your time...I know that I am annoying and clumsy, but as you have DCS on your PC, maybe you could have a look on my problem with the usage of depth buffer for label filtering ?
And I also did not manage to solve efficiently the problem with the horizon (use free flight with Su25T and roll plane to the right or the left to see it). I had to find from another shader the view matrix and add additional fix for left or right eye regarding the roll angle of the plane). I'm not proud of that fix...
In which mission did you find the glitching shader when at night ?
Sorry, I meant to respond to this earlier. For this the depth buffer may not work as it is very common for transparent effects like glass not to write to it. If you did want to go down that path, you could take a look at the approach I used in The Witness and have a custom shader render depth information to a custom resource and then use that from the HUD shader to position the text. This also avoids the problem of having to work out how the depth buffer is scaled as you can simply write W values directly to the custom resource (provided that it's format is suitable, like R32_FLOAT. Avoid UNORM or integer formats).
Another option is to try to copy position information (a constant buffer with the MVP matrix, the vertex buffer and (if it uses one) the index buffer) from the glass shader to the HUD shader to get the position of the glass vertices and use them to position the HUD. Another more involved option would be to really mess with the rendering pipeline and render the HUD to an offscreen buffer then render the glass with the HUD overlayed on it (I haven't done anything like this yet, but between the arbitrary resource copying, arbitrary resource creation and custom shader injection this might just be possible, but would most likely run into issues).
It might however be a lot simpler to just move the HUD to a fixed depth roughly lined up with the glass. There's a few approaches you can take for this - the easiest is to first move it to screen depth by subtracting the nvidia formula, then move it back to a fixed depth. Since you are trying to make it line up with something in the world you probably don't want to use the usual HUD adjustment formula as you need it to vary with convergence, and also since it's already at depth you will need to account for the difference in the perspective divide as well.
Off the top of my head, it should be something like this:
Which mathomatic tells me simplifies to:
Another option since they are already rendered at depth is to scale the output coordinate to adjust where the driver will draw them - if the HUD happens to already be 3D (but just a long way away) this can preserve relative differences between HUD elements.
Adjust the constant to find something suitable. Between 0 and 1 (not inclusive) moves it closer to the camera, > 1 moves further away.
See how you go with that, but I'll answer the rest of your questions anyway:
The DepthTarget here refers to the active depth target, and it won't be referred to in the shader (usually - there are some exceptions that use the SV_Depth semantic) as it comes into play in the rasterizer, not the shaders. If you see a texture called depth buffer that will be a shader that is reading the depth buffer, not writing to it (or in the event it is doing both it will be reading from a copy). In the 3DMigoto arbitrary resource copying feature, the active depth target is referred to as 'oD' (output Depth).
These will be shaders that read from the depth buffer. If you did copy it these are good choices as the fact they are reading it suggests that they are in the deferred or transparent rendering phases and the depth buffer will be final at that point. There's also a really good chance that they will contain the necessary code and constants to scale the depth buffer to world coordinates which is required for the auto crosshair code to work (however if they don't figuring out the right scaling is really *really* difficult).
That's not necessarily a problem - the arbitrary resource copying feature only needs their hash to work (or the hash of the corresponding vertex/pixel shader), the shaders only have to be included if you actually modify them.
Yeah, that error is fairly common and that will usually work, though if v3 was split into two variables like v3 and w3 you might need to do something like:
ShaderUsage.txt is only updated when dumping out a shader, so it might just be outdated. Another possibility is that those shaders are not always active (which would be a problem if you try to copy anything from them). Also, if you are using hunting=2 (as opposed to hunting=1) 3DMigoto won't collect usage statistics while the overlay is disabled (this is why you may notice a difference in fps when toggling the overlay in some games), which can allow for some shaders/textures to be missed in the ShaderUsage.txt (but if they were active when you dumped the last shader this won't be it).
Studying their code and/or assembly is the best way.
Yes, but as I mentioned above I think there are better options for this case.
My guess is depthTex based on the name, but without looking at the game I can't be sure. You could dump them out with frame analysis to see what they contain.
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