Bo3b's School For Shaderhackers
  40 / 88    
GREAT information DarkStarSword!! i will add to my notes :)
GREAT information DarkStarSword!!

i will add to my notes :)

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

Like my fixes? you can donate to Paypal: dhr.donation@gmail.com

Posted 11/04/2015 12:23 PM   
So I've done my fair share of experimentation today based on DarkStarSword's suggestions, and unfortunately have not had successful results. First I'll include my own attempt at code based on DSS's comments. As you'll note, I have multiple variations in the code all commented out now, but I had tried each one individually. As per DSS's excellent suggestion, params.y is a transitional constant from 0 to 1 that I use in the test code that REALLY helps in seeing exactly what is changing. All of the below was done without any correction done in the VS, only in the suggested area of the PS. The results were nearly all identical: a slight shift, correcting some parts of the shadows on one axis while further separating other parts that were originally correct on another. Before fix: [img]https://forums.geforce.com/cmd/default/download-comment-attachment/66885/[/img] After fix: [img]https://forums.geforce.com/cmd/default/download-comment-attachment/66886/[/img] Code: [code]<snip> //r1.xyz = r1.xyz + camera_pos.xyz; /* My attempt at code // Adding code to fix lighting/shadows float4 params = IniParams.Load(0); float4 stereo = StereoParams.Load(0); float separation = stereo.x; float convergence = stereo.y; // Test shadows transition if (params.y > 0) { r1.xyz = r1.yzw * r1.xxx; /* Standard correction alone r1.x -= separation * (r1.w - convergence) * params.y; */ /* DSS - View space option 1 //Interpretation 1 r1.x -= separation * (r1.w - convergence) * camera_inv_projection._m00 * params.y; //Interpretation 2 r1.x = (r1.x - (separation * (r1.w - convergence))) * camera_inv_projection._m00 * params.y; */ /* DSS - View space option 2 //Interpretation 1 r1.x -= separation * (r1.w - convergence) / camera_projection._m00 * params.y; //Interpretation 2 r1.x = (r1.x - (separation * (r1.w - convergence))) / camera_projection._m00 * params.y; */ /* DSS - View space option 3 r1 = mul(camera_projection, r1); // Also tried with camera_view matrix r1.x -= separation * (r1.w - convergence) * params.y; r1 = mul(camera_inv_projection, r1); // Also tried with camera_inv_view matrix */ // All of above followed by: r1.xyz += camera_pos.xyz; } else { r1.xyz = r1.yzw * r1.xxx + camera_pos.xyz; } */[/code] I did not understand the 4th viewspace option to test that. Similarly, I could not determine what would have been different in the world space options vs what I had tried in the viewspace options, so didn't do any of those. After a while of experimenting on all this, I then read the rest of DSS's post and realized he provided his very own coding for me to try, which I did, and unfortunately that REALLY broke things. It made the lights shift all over the place as the camera moved around. I tried with and without the correction in the VS. I'll include the code I used of his (with his comments removed, and a few of mine added) to have checked to make sure I didn't make any mistake in utilizing it. [code]/* DarkStarSword's code r1.xyz = r1.yzw * r1.xxx; float4 stereo = StereoParams.Load(0); float4 tmp; tmp = mul(camera_view, float4(r1.xyz, 1)); // 0 made lights disappear tmp = mul(camera_projection, tmp); tmp = tmp / tmp.w; // Commenting this out changed the location, but still as broken as with it tmp.x -= stereo.x * (tmp.z - stereo.y); tmp = mul(camera_inv_projection, tmp); tmp = mul(camera_inv_view, tmp); r1.xyz = tmp.xyz / tmp.w; // Attempted without divide by tmp.w as well r1.xyz = r1.xyz + camera_pos.xyz; */[/code] I gotta say, this has been an excellent exercise. I've definitely learned a lot already... maybe not as much of "understanding how it works" but a fair bit of "learning how to do it" part (which, in my employment experience in IT support, that has always been the important part to come first and then the deeper understanding to follow), so I'm quite eager to keep at it.
So I've done my fair share of experimentation today based on DarkStarSword's suggestions, and unfortunately have not had successful results.

First I'll include my own attempt at code based on DSS's comments. As you'll note, I have multiple variations in the code all commented out now, but I had tried each one individually. As per DSS's excellent suggestion, params.y is a transitional constant from 0 to 1 that I use in the test code that REALLY helps in seeing exactly what is changing. All of the below was done without any correction done in the VS, only in the suggested area of the PS.

The results were nearly all identical: a slight shift, correcting some parts of the shadows on one axis while further separating other parts that were originally correct on another.

Before fix:
Image

After fix:
Image

Code:

<snip>
//r1.xyz = r1.xyz + camera_pos.xyz;

/* My attempt at code
// Adding code to fix lighting/shadows
float4 params = IniParams.Load(0); float4 stereo = StereoParams.Load(0);
float separation = stereo.x; float convergence = stereo.y;

// Test shadows transition
if (params.y > 0)
{
r1.xyz = r1.yzw * r1.xxx;

/* Standard correction alone
r1.x -= separation * (r1.w - convergence) * params.y;
*/

/* DSS - View space option 1
//Interpretation 1
r1.x -= separation * (r1.w - convergence) * camera_inv_projection._m00 * params.y;

//Interpretation 2
r1.x = (r1.x - (separation * (r1.w - convergence))) * camera_inv_projection._m00 * params.y;
*/

/* DSS - View space option 2
//Interpretation 1
r1.x -= separation * (r1.w - convergence) / camera_projection._m00 * params.y;

//Interpretation 2
r1.x = (r1.x - (separation * (r1.w - convergence))) / camera_projection._m00 * params.y;
*/

/* DSS - View space option 3
r1 = mul(camera_projection, r1); // Also tried with camera_view matrix
r1.x -= separation * (r1.w - convergence) * params.y;
r1 = mul(camera_inv_projection, r1); // Also tried with camera_inv_view matrix
*/

// All of above followed by:
r1.xyz += camera_pos.xyz;

}
else
{
r1.xyz = r1.yzw * r1.xxx + camera_pos.xyz;
}
*/


I did not understand the 4th viewspace option to test that. Similarly, I could not determine what would have been different in the world space options vs what I had tried in the viewspace options, so didn't do any of those.

After a while of experimenting on all this, I then read the rest of DSS's post and realized he provided his very own coding for me to try, which I did, and unfortunately that REALLY broke things. It made the lights shift all over the place as the camera moved around. I tried with and without the correction in the VS. I'll include the code I used of his (with his comments removed, and a few of mine added) to have checked to make sure I didn't make any mistake in utilizing it.

/* DarkStarSword's code

r1.xyz = r1.yzw * r1.xxx;

float4 stereo = StereoParams.Load(0);
float4 tmp;

tmp = mul(camera_view, float4(r1.xyz, 1)); // 0 made lights disappear
tmp = mul(camera_projection, tmp);
tmp = tmp / tmp.w; // Commenting this out changed the location, but still as broken as with it

tmp.x -= stereo.x * (tmp.z - stereo.y);

tmp = mul(camera_inv_projection, tmp);
tmp = mul(camera_inv_view, tmp);
r1.xyz = tmp.xyz / tmp.w; // Attempted without divide by tmp.w as well

r1.xyz = r1.xyz + camera_pos.xyz;
*/


I gotta say, this has been an excellent exercise. I've definitely learned a lot already... maybe not as much of "understanding how it works" but a fair bit of "learning how to do it" part (which, in my employment experience in IT support, that has always been the important part to come first and then the deeper understanding to follow), so I'm quite eager to keep at it.

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

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

Posted 11/04/2015 11:56 PM   
I for one would love to see a complete Vermintide fix, its a great game. Keep it up. I'm finally delving deeper into this and am learning a hell of a lot and have one more tricky issue (to me anyway) to resolve before I can release my first contribution and update for the Guild wars 2 Expansion. I have now made the fix 64x bit compatible, with the latest dll, removed the Sweet FX requirement and fixed the existing fixes presets to work with the later 64x dll, and improved the depth settings for various elements. I am now currently trying to out right disable 3 UI textures that are part of the shader I am using texture filtering on which I have decided are just more of an annoyance and not particularly useful to the game. (part of characters life bars which are correct in stereo above their heads.) A little confused how to go about this, since I am already using texture filtering on the offending shader to achieve crosshair to depth, and I don't see any particular mention to this scenario in the advanced features. https://forums.geforce.com/default/topic/888367/3d-vision/guild-wars-2-expac-wip-action-cam-crosshair-fixed-64x-client-compatible-/2/?offset=17#4719667 as usual any help is much appreciated
I for one would love to see a complete Vermintide fix, its a great game. Keep it up.

I'm finally delving deeper into this and am learning a hell of a lot and have one more tricky issue (to me anyway) to resolve before I can release my first contribution and update for the Guild wars 2 Expansion.

I have now made the fix 64x bit compatible, with the latest dll, removed the Sweet FX requirement and fixed the existing fixes presets to work with the later 64x dll, and improved the depth settings for various elements.

I am now currently trying to out right disable 3 UI textures that are part of the shader I am using texture filtering on which I have decided are just more of an annoyance and not particularly useful to the game. (part of characters life bars which are correct in stereo above their heads.)

A little confused how to go about this, since I am already using texture filtering on the offending shader to achieve crosshair to depth, and I don't see any particular mention to this scenario in the advanced features.

https://forums.geforce.com/default/topic/888367/3d-vision/guild-wars-2-expac-wip-action-cam-crosshair-fixed-64x-client-compatible-/2/?offset=17#4719667

as usual any help is much appreciated

i7-4790K CPU 4.8Ghz stable overclock.
16 GB RAM Corsair
ASUS Turbo 2080TI
Samsung SSD 840Pro
ASUS Z97-WS3D
Surround ASUS Rog Swift PG278Q(R), 2x PG278Q (yes it works)
Obutto R3volution.
Windows 10 pro 64x (Windows 7 Dual boot)

Posted 11/07/2015 11:53 PM   
[quote="necropants"]I am now currently trying to out right disable 3 UI textures that are part of the shader I am using texture filtering on which I have decided are just more of an annoyance and not particularly useful to the game. (part of characters life bars which are correct in stereo above their heads.) A little confused how to go about this, since I am already using texture filtering on the offending shader to achieve crosshair to depth, and I don't see any particular mention to this scenario in the advanced features. [/quote] To assign different values to different textures in a shader: Dx9Settings.ini- [code]//example shader [VSC1E56494] CheckTexCRC = true VBOffsetList = 0; ValForDefined = 2 ValNotDefined = 0 TexCounterReg = 254 UseDefinedOnly = false DefinedTexturesVS = FAFAA202;C0FF5C55;6EDCD2FF; [TEXC0FF5C55] Index = 3 [TEX6EDCD2FF] Index = 4 [VBC1E56494.0] PointsList = 554[/code] Here, FAFAA202 is assigned an index of 2, C0FF5C55 is assigned an index of 3, and 6EDCD2FF is assigned to 4. And in the shader file: [code] vs_3_0 def c100, 0, 0, 0, 0 def c247, 0.75, 2, 0.0625, 3 dcl_2d s0 .. .. texldl r24, c247.z, s0 mov r14.x, c254.x //move index value to temporary register if_eq r14.x, c247.y //if Index = 2- for Crosshair mul r24.x, r24.x, -c247.x add r10.x, r10.x, -r24.x //push into depth endif if_eq r14.x, c247.w //if Index = 3- for health bars mov r10, c100 //disable endif mov o0, r10 [/code] Let me know if this helps or not.
necropants said:I am now currently trying to out right disable 3 UI textures that are part of the shader I am using texture filtering on which I have decided are just more of an annoyance and not particularly useful to the game. (part of characters life bars which are correct in stereo above their heads.)

A little confused how to go about this, since I am already using texture filtering on the offending shader to achieve crosshair to depth, and I don't see any particular mention to this scenario in the advanced features.


To assign different values to different textures in a shader:

Dx9Settings.ini-

//example shader

[VSC1E56494]
CheckTexCRC = true
VBOffsetList = 0;
ValForDefined = 2
ValNotDefined = 0
TexCounterReg = 254
UseDefinedOnly = false
DefinedTexturesVS = FAFAA202;C0FF5C55;6EDCD2FF;

[TEXC0FF5C55]
Index = 3

[TEX6EDCD2FF]
Index = 4

[VBC1E56494.0]
PointsList = 554


Here, FAFAA202 is assigned an index of 2, C0FF5C55 is assigned an index of 3, and 6EDCD2FF is assigned to 4.

And in the shader file:

vs_3_0
def c100, 0, 0, 0, 0
def c247, 0.75, 2, 0.0625, 3
dcl_2d s0
..

..
texldl r24, c247.z, s0
mov r14.x, c254.x //move index value to temporary register

if_eq r14.x, c247.y //if Index = 2- for Crosshair
mul r24.x, r24.x, -c247.x
add r10.x, r10.x, -r24.x //push into depth
endif

if_eq r14.x, c247.w //if Index = 3- for health bars
mov r10, c100 //disable
endif

mov o0, r10


Let me know if this helps or not.

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

Posted 11/08/2015 02:19 PM   
[quote="DJ-RK"]So I've done my fair share of experimentation today based on DarkStarSword's suggestions, and unfortunately have not had successful results. First I'll include my own attempt at code based on DSS's comments. As you'll note, I have multiple variations in the code all commented out now, but I had tried each one individually. As per DSS's excellent suggestion, params.y is a transitional constant from 0 to 1 that I use in the test code that REALLY helps in seeing exactly what is changing. All of the below was done without any correction done in the VS, only in the suggested area of the PS. The results were nearly all identical: a slight shift, correcting some parts of the shadows on one axis while further separating other parts that were originally correct on another. Before fix: [img]https://forums.geforce.com/cmd/default/download-comment-attachment/66885/[/img] After fix: [img]https://forums.geforce.com/cmd/default/download-comment-attachment/66886/[/img] Code: [code]<snip> //r1.xyz = r1.xyz + camera_pos.xyz; /* My attempt at code // Adding code to fix lighting/shadows float4 params = IniParams.Load(0); float4 stereo = StereoParams.Load(0); float separation = stereo.x; float convergence = stereo.y; // Test shadows transition if (params.y > 0) { r1.xyz = r1.yzw * r1.xxx; /* Standard correction alone r1.x -= separation * (r1.w - convergence) * params.y; */ /* DSS - View space option 1 //Interpretation 1 r1.x -= separation * (r1.w - convergence) * camera_inv_projection._m00 * params.y; //Interpretation 2 r1.x = (r1.x - (separation * (r1.w - convergence))) * camera_inv_projection._m00 * params.y; */ /* DSS - View space option 2 //Interpretation 1 r1.x -= separation * (r1.w - convergence) / camera_projection._m00 * params.y; //Interpretation 2 r1.x = (r1.x - (separation * (r1.w - convergence))) / camera_projection._m00 * params.y; */ /* DSS - View space option 3 r1 = mul(camera_projection, r1); // Also tried with camera_view matrix r1.x -= separation * (r1.w - convergence) * params.y; r1 = mul(camera_inv_projection, r1); // Also tried with camera_inv_view matrix */ // All of above followed by: r1.xyz += camera_pos.xyz; } else { r1.xyz = r1.yzw * r1.xxx + camera_pos.xyz; } */[/code] I did not understand the 4th viewspace option to test that. Similarly, I could not determine what would have been different in the world space options vs what I had tried in the viewspace options, so didn't do any of those. After a while of experimenting on all this, I then read the rest of DSS's post and realized he provided his very own coding for me to try, which I did, and unfortunately that REALLY broke things. It made the lights shift all over the place as the camera moved around. I tried with and without the correction in the VS. I'll include the code I used of his (with his comments removed, and a few of mine added) to have checked to make sure I didn't make any mistake in utilizing it. [code]/* DarkStarSword's code r1.xyz = r1.yzw * r1.xxx; float4 stereo = StereoParams.Load(0); float4 tmp; tmp = mul(camera_view, float4(r1.xyz, 1)); // 0 made lights disappear tmp = mul(camera_projection, tmp); tmp = tmp / tmp.w; // Commenting this out changed the location, but still as broken as with it tmp.x -= stereo.x * (tmp.z - stereo.y); tmp = mul(camera_inv_projection, tmp); tmp = mul(camera_inv_view, tmp); r1.xyz = tmp.xyz / tmp.w; // Attempted without divide by tmp.w as well r1.xyz = r1.xyz + camera_pos.xyz; */[/code] I gotta say, this has been an excellent exercise. I've definitely learned a lot already... maybe not as much of "understanding how it works" but a fair bit of "learning how to do it" part (which, in my employment experience in IT support, that has always been the important part to come first and then the deeper understanding to follow), so I'm quite eager to keep at it.[/quote] I've not followed all this thread or what Darkstarsword posted, but there are a couple of errors in your different attempts. - In the various Viewspace options 1 & 2 you need to be correcting with r1.z, not r1.w - In Viewspace option 3 you need to make sure you set r1.w=1 before doing the matrix multiplication. - In the other attempt at doing the tarnsformation via View and Projection (the one you said goes all over the place), this has to be done on the World Coord, which is (r1.yzw * r1.xxx + camera_pos.xyz) Give each a go and see if you have any luck.
DJ-RK said:So I've done my fair share of experimentation today based on DarkStarSword's suggestions, and unfortunately have not had successful results.

First I'll include my own attempt at code based on DSS's comments. As you'll note, I have multiple variations in the code all commented out now, but I had tried each one individually. As per DSS's excellent suggestion, params.y is a transitional constant from 0 to 1 that I use in the test code that REALLY helps in seeing exactly what is changing. All of the below was done without any correction done in the VS, only in the suggested area of the PS.

The results were nearly all identical: a slight shift, correcting some parts of the shadows on one axis while further separating other parts that were originally correct on another.

Before fix:
Image

After fix:
Image

Code:

<snip>
//r1.xyz = r1.xyz + camera_pos.xyz;

/* My attempt at code
// Adding code to fix lighting/shadows
float4 params = IniParams.Load(0); float4 stereo = StereoParams.Load(0);
float separation = stereo.x; float convergence = stereo.y;

// Test shadows transition
if (params.y > 0)
{
r1.xyz = r1.yzw * r1.xxx;

/* Standard correction alone
r1.x -= separation * (r1.w - convergence) * params.y;
*/

/* DSS - View space option 1
//Interpretation 1
r1.x -= separation * (r1.w - convergence) * camera_inv_projection._m00 * params.y;

//Interpretation 2
r1.x = (r1.x - (separation * (r1.w - convergence))) * camera_inv_projection._m00 * params.y;
*/

/* DSS - View space option 2
//Interpretation 1
r1.x -= separation * (r1.w - convergence) / camera_projection._m00 * params.y;

//Interpretation 2
r1.x = (r1.x - (separation * (r1.w - convergence))) / camera_projection._m00 * params.y;
*/

/* DSS - View space option 3
r1 = mul(camera_projection, r1); // Also tried with camera_view matrix
r1.x -= separation * (r1.w - convergence) * params.y;
r1 = mul(camera_inv_projection, r1); // Also tried with camera_inv_view matrix
*/

// All of above followed by:
r1.xyz += camera_pos.xyz;

}
else
{
r1.xyz = r1.yzw * r1.xxx + camera_pos.xyz;
}
*/


I did not understand the 4th viewspace option to test that. Similarly, I could not determine what would have been different in the world space options vs what I had tried in the viewspace options, so didn't do any of those.

After a while of experimenting on all this, I then read the rest of DSS's post and realized he provided his very own coding for me to try, which I did, and unfortunately that REALLY broke things. It made the lights shift all over the place as the camera moved around. I tried with and without the correction in the VS. I'll include the code I used of his (with his comments removed, and a few of mine added) to have checked to make sure I didn't make any mistake in utilizing it.

/* DarkStarSword's code

r1.xyz = r1.yzw * r1.xxx;

float4 stereo = StereoParams.Load(0);
float4 tmp;

tmp = mul(camera_view, float4(r1.xyz, 1)); // 0 made lights disappear
tmp = mul(camera_projection, tmp);
tmp = tmp / tmp.w; // Commenting this out changed the location, but still as broken as with it

tmp.x -= stereo.x * (tmp.z - stereo.y);

tmp = mul(camera_inv_projection, tmp);
tmp = mul(camera_inv_view, tmp);
r1.xyz = tmp.xyz / tmp.w; // Attempted without divide by tmp.w as well

r1.xyz = r1.xyz + camera_pos.xyz;
*/


I gotta say, this has been an excellent exercise. I've definitely learned a lot already... maybe not as much of "understanding how it works" but a fair bit of "learning how to do it" part (which, in my employment experience in IT support, that has always been the important part to come first and then the deeper understanding to follow), so I'm quite eager to keep at it.

I've not followed all this thread or what Darkstarsword posted, but there are a couple of errors in your different attempts.
- In the various Viewspace options 1 & 2 you need to be correcting with r1.z, not r1.w
- In Viewspace option 3 you need to make sure you set r1.w=1 before doing the matrix multiplication.
- In the other attempt at doing the tarnsformation via View and Projection (the one you said goes all over the place), this has to be done on the World Coord, which is (r1.yzw * r1.xxx + camera_pos.xyz)

Give each a go and see if you have any luck.

Rig: Intel i7-8700K @4.7GHz, 16Gb Ram, SSD, GTX 1080Ti, Win10x64, Asus VG278

Posted 11/08/2015 04:00 PM   
[quote="mike_ar69"]I've not followed all this thread or what Darkstarsword posted, but there are a couple of errors in your different attempts. - In the various Viewspace options 1 & 2 you need to be correcting with r1.z, not r1.w - In Viewspace option 3 you need to make sure you set r1.w=1 before doing the matrix multiplication. - In the other attempt at doing the tarnsformation via View and Projection (the one you said goes all over the place), this has to be done on the World Coord, which is (r1.yzw * r1.xxx + camera_pos.xyz) Give each a go and see if you have any luck.[/quote] Thanks Mike, I really appreciate you taking a look and providing your feedback, but unfortunately I tried all your suggestions and none of them worked. I've tried experimenting more with the code on my own, without success, so at this point I'm back to researching bo3b's materials further to try to get a better understanding and then come back to it. I have, however, fixed another couple broken effects (broken water reflections), so I am still making progress on the fix, however these lights and shadows seem to be extremely stubborn.
mike_ar69 said:I've not followed all this thread or what Darkstarsword posted, but there are a couple of errors in your different attempts.
- In the various Viewspace options 1 & 2 you need to be correcting with r1.z, not r1.w
- In Viewspace option 3 you need to make sure you set r1.w=1 before doing the matrix multiplication.
- In the other attempt at doing the tarnsformation via View and Projection (the one you said goes all over the place), this has to be done on the World Coord, which is (r1.yzw * r1.xxx + camera_pos.xyz)

Give each a go and see if you have any luck.


Thanks Mike, I really appreciate you taking a look and providing your feedback, but unfortunately I tried all your suggestions and none of them worked.

I've tried experimenting more with the code on my own, without success, so at this point I'm back to researching bo3b's materials further to try to get a better understanding and then come back to it. I have, however, fixed another couple broken effects (broken water reflections), so I am still making progress on the fix, however these lights and shadows seem to be extremely stubborn.

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

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

Posted 11/09/2015 05:53 PM   
Now I am puzzled... I'm downloading this game just for the kicks:)) Can you post me the location where I can find your fix so far? And can you also please tell me what are the shaders that you found related to the shadows? I'll try to give a quick look;)) Cheers!
Now I am puzzled...
I'm downloading this game just for the kicks:))
Can you post me the location where I can find your fix so far? And can you also please tell me what are the shaders that you found related to the shadows?

I'll try to give a quick look;))

Cheers!

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


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

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

Posted 11/09/2015 06:44 PM   
[quote="DJ-RK"][quote="mike_ar69"]I've not followed all this thread or what Darkstarsword posted, but there are a couple of errors in your different attempts. - In the various Viewspace options 1 & 2 you need to be correcting with r1.z, not r1.w - In Viewspace option 3 you need to make sure you set r1.w=1 before doing the matrix multiplication. - In the other attempt at doing the tarnsformation via View and Projection (the one you said goes all over the place), this has to be done on the World Coord, which is (r1.yzw * r1.xxx + camera_pos.xyz) Give each a go and see if you have any luck.[/quote] Thanks Mike, I really appreciate you taking a look and providing your feedback, but unfortunately I tried all your suggestions and none of them worked. I've tried experimenting more with the code on my own, without success, so at this point I'm back to researching bo3b's materials further to try to get a better understanding and then come back to it. I have, however, fixed another couple broken effects (broken water reflections), so I am still making progress on the fix, however these lights and shadows seem to be extremely stubborn.[/quote] No problem - it was worth a try. Another thing I forgot to mention is that sometimes you need to use "-r1.z". Perhaps give that a whirl. Without the game I can't try it myself. As someone else mentioned, at some point it's a lot of trial and error. Good luck with it though :-)
DJ-RK said:
mike_ar69 said:I've not followed all this thread or what Darkstarsword posted, but there are a couple of errors in your different attempts.
- In the various Viewspace options 1 & 2 you need to be correcting with r1.z, not r1.w
- In Viewspace option 3 you need to make sure you set r1.w=1 before doing the matrix multiplication.
- In the other attempt at doing the tarnsformation via View and Projection (the one you said goes all over the place), this has to be done on the World Coord, which is (r1.yzw * r1.xxx + camera_pos.xyz)

Give each a go and see if you have any luck.


Thanks Mike, I really appreciate you taking a look and providing your feedback, but unfortunately I tried all your suggestions and none of them worked.

I've tried experimenting more with the code on my own, without success, so at this point I'm back to researching bo3b's materials further to try to get a better understanding and then come back to it. I have, however, fixed another couple broken effects (broken water reflections), so I am still making progress on the fix, however these lights and shadows seem to be extremely stubborn.

No problem - it was worth a try. Another thing I forgot to mention is that sometimes you need to use "-r1.z". Perhaps give that a whirl. Without the game I can't try it myself. As someone else mentioned, at some point it's a lot of trial and error. Good luck with it though :-)

Rig: Intel i7-8700K @4.7GHz, 16Gb Ram, SSD, GTX 1080Ti, Win10x64, Asus VG278

Posted 11/09/2015 07:28 PM   
Is it possible for you guys to fix some of this shaders ?
Is it possible for you guys to fix some of this shaders ?
[quote="SKAUT"]Is it possible for you guys to fix some of this shaders ?[/quote] and this one for Diablo 3 ?
SKAUT said:Is it possible for you guys to fix some of this shaders ?

and this one for Diablo 3 ?
Attachments

981D644B.txt.jpg

[quote="helifax"]Now I am puzzled... I'm downloading this game just for the kicks:)) Can you post me the location where I can find your fix so far? And can you also please tell me what are the shaders that you found related to the shadows? I'll try to give a quick look;)) Cheers![/quote] The window lighting on the table is in the inn, which is the hub for the game, so the first place you start in. The 2nd set of photos with the lights on the bridge are the first set of broken lights you come across in the first level. I can give you the shader CRC's or attach the files on here if you want. Not too hard to find them, though. Edit: Oh, I just realized you asked where my existing fix is, so here's the link: http://www.mediafire.com/download/mp146z24ofkzao1/Warhammer_Vermintide_Fix_v0.2.zip Doesn't contain any of the shaders that I haven't fixed yet, ie. the ones in these examples I've posted. @Mike: I gave that other last suggestion a try as well, on all the different variations and still nothing. Indeed, back to experimenting more.
helifax said:Now I am puzzled...
I'm downloading this game just for the kicks:))
Can you post me the location where I can find your fix so far? And can you also please tell me what are the shaders that you found related to the shadows?

I'll try to give a quick look;))

Cheers!


The window lighting on the table is in the inn, which is the hub for the game, so the first place you start in. The 2nd set of photos with the lights on the bridge are the first set of broken lights you come across in the first level.

I can give you the shader CRC's or attach the files on here if you want. Not too hard to find them, though.

Edit: Oh, I just realized you asked where my existing fix is, so here's the link: http://www.mediafire.com/download/mp146z24ofkzao1/Warhammer_Vermintide_Fix_v0.2.zip

Doesn't contain any of the shaders that I haven't fixed yet, ie. the ones in these examples I've posted.

@Mike: I gave that other last suggestion a try as well, on all the different variations and still nothing. Indeed, back to experimenting more.

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

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

Posted 11/09/2015 09:02 PM   
*praying Helifax gets into the game and is compelled to help fix it. I think its a blast. =)
*praying Helifax gets into the game and is compelled to help fix it. I think its a blast. =)

i7-4790K CPU 4.8Ghz stable overclock.
16 GB RAM Corsair
ASUS Turbo 2080TI
Samsung SSD 840Pro
ASUS Z97-WS3D
Surround ASUS Rog Swift PG278Q(R), 2x PG278Q (yes it works)
Obutto R3volution.
Windows 10 pro 64x (Windows 7 Dual boot)

Posted 11/09/2015 11:47 PM   
[quote="DJ-RK"][quote="helifax"]Now I am puzzled... I'm downloading this game just for the kicks:)) Can you post me the location where I can find your fix so far? And can you also please tell me what are the shaders that you found related to the shadows? I'll try to give a quick look;)) Cheers![/quote] The window lighting on the table is in the inn, which is the hub for the game, so the first place you start in. The 2nd set of photos with the lights on the bridge are the first set of broken lights you come across in the first level. I can give you the shader CRC's or attach the files on here if you want. Not too hard to find them, though. Edit: Oh, I just realized you asked where my existing fix is, so here's the link: http://www.mediafire.com/download/mp146z24ofkzao1/Warhammer_Vermintide_Fix_v0.2.zip Doesn't contain any of the shaders that I haven't fixed yet, ie. the ones in these examples I've posted. @Mike: I gave that other last suggestion a try as well, on all the different variations and still nothing. Indeed, back to experimenting more.[/quote] Big thanks for the WIP;)) It will have to wait a bit as I am having some hardware issues with my laptop currently. Once I'll fix it, I'll take a look;) cheers!
DJ-RK said:
helifax said:Now I am puzzled...
I'm downloading this game just for the kicks:))
Can you post me the location where I can find your fix so far? And can you also please tell me what are the shaders that you found related to the shadows?

I'll try to give a quick look;))

Cheers!


The window lighting on the table is in the inn, which is the hub for the game, so the first place you start in. The 2nd set of photos with the lights on the bridge are the first set of broken lights you come across in the first level.

I can give you the shader CRC's or attach the files on here if you want. Not too hard to find them, though.

Edit: Oh, I just realized you asked where my existing fix is, so here's the link: http://www.mediafire.com/download/mp146z24ofkzao1/Warhammer_Vermintide_Fix_v0.2.zip


Doesn't contain any of the shaders that I haven't fixed yet, ie. the ones in these examples I've posted.

@Mike: I gave that other last suggestion a try as well, on all the different variations and still nothing. Indeed, back to experimenting more.


Big thanks for the WIP;)) It will have to wait a bit as I am having some hardware issues with my laptop currently. Once I'll fix it, I'll take a look;)

cheers!

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


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

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

Posted 11/10/2015 08:36 PM   
I've slightly shifted my focus to working on another game as an easier example to help me learn (and will return to Vermintide shortly). It's a Dx9 game, and shadows are in 2D. I'm using Mike's comments in the Shogun discussion previously linked as a basis for the fix, and I believe I've located the correct location to fix. Problem is, I've only been able to locate the registers for the projection matrix, but there does not seem to be any for an inv projection matrix, and I'm confident I've done a thorough search through all the dumps. Is there any way for me to either build my own inv proj matrix, or otherwise perform equivalent calculations in ASM, using the existing projection matrix as a basis? I've included the code from the PS that I've implemented up to this point. [code]//Title screen - Helicopter shadow // // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // Parameters: // // float4 CascadeScale; // float4 CascadeTextureSplitsEnd; // sampler2D DepthSpecBuffer; // float3 DownDir; // float3 EyePos; // float4 FadeoutParameters; // float4 InvScreenSize; // float2 InvShadowMapSize; // float4x4 LightProjectionTex[4]; // float3 RightDir; // float4 ShadowParameters; // sampler2D ShadowTex; // float3 UpperLeftCorner; // // // Registers: // // Name Reg Size // ----------------------- ----- ---- // InvShadowMapSize c34 1 // CascadeScale c36 1 // CascadeTextureSplitsEnd c37 1 // FadeoutParameters c38 1 // LightProjectionTex c40 8 // ShadowParameters c60 1 // InvScreenSize c61 1 // UpperLeftCorner c62 1 // RightDir c63 1 // DownDir c64 1 // EyePos c65 1 // DepthSpecBuffer s0 1 // ShadowTex s2 1 // ps_3_0 def c0, 0.5, 0.999989986, 0, 1 def c1, -0, -1, -2, -3 def c2, 0.0625, 0, 0, 0 def c3, -0.81409955, 0.914375901, 0.199841261, 0.78641367 def c4, 0.791975141, 0.190901875, -0.241888404, 0.997065067 def c5, 0.53742981, -0.4737342, -0.26496911, -0.418930233 def c6, 0.974843979, 0.756483793, 0.443233252, -0.975115538 def c7, -0.815442324, -0.879124641, -0.382775426, 0.276768446 def c8, 0.344959378, 0.293877602, -0.915885806, 0.457714319 def c9, 0.945586085, -0.768907249, -0.0941841006, -0.929388702 def c10, 0.143831611, -0.1410079, -0.942016244, -0.399062157 dcl vPos.xy dcl_2d s0 dcl_2d s2 dcl_2d s13 mov r0.x, c0.x mul r0.xy, r0.x, c61 mad r0.xy, vPos, c61, r0 texld r1, r0, s0 add r2, -r1.x, c0.y texkill r2 mov r2.xyz, c63 mad r0.xzw, r2.xyyz, r0.x, c62.xyyz mad r0.xyz, c64, r0.y, r0.xzww mul r1.yzw, r0.xxyz, r1.x mad r0.xyz, r1.x, r0, c65 //c65 is eyepos register, r1.x contains depth value /* mov r0.w, c0.w mov r10, r0 dp4 r11.x, r10, c102 <--Am using the VPM here dp4 r11.y, r10, c103 dp4 r11.z, r10, c104 dp4 r11.w, r10, c105 texldl r24, c2.x, s13 //c2.x is an already defined constant with stereo fix value add r24.y, r11.w, -r24.y mul r24.x, r24.x, r24.y add r11.x, r11.x, -r24.x //Here is where inverse VPM should occur, but no registers exist for it. The following is code from Mike's example dp4 r10.x, r11, c20 <-- Use the inverse VPM here dp4 r10.y, r11, c21 dp4 r10.z, r11, c22 dp4 r10.w, r11, c23 mov r0, r10 */ dp3 r0.w, r1.yzww, r1.yzww rsq r0.w, r0.w rcp r0.w, r0.w add r1, -r0.w, c37 add r0.w, -r0.w, c38.x mul_sat r0.w, r0.w, c38.y cmp r1, r1, c0.z, c0.w dp4 r1.x, r1, c0.w mul r1.yzw, r0.y, c41.xxyz mad r1.yzw, c40.xxyz, r0.x, r1 mad r1.yzw, c42.xxyz, r0.z, r1 add r1.yzw, r1, c43.xxyz mul r2.xyz, r0.y, c45 mad r2.xyz, c44, r0.x, r2 mad r0.xyz, c46, r0.z, r2 add r0.xyz, r0, c47 cmp r0.xyz, -r1.x, r1.yzww, r0 add r1, r1.x, c1 cmp r1, -r1_abs, c0.w, c0.z dp4 r1.x, c36, r1 mov r2.xy, c34 mul r2, r2.xyxy, c60.x mul r1, r1.x, r2 mad r2, r1.zwzw, c10, r0.xyxy texld r3, r2, s2 texld r2, r2.zwzw, s2 mov r3.y, r2.x mad r2, r1.zwzw, c9, r0.xyxy texld r4, r2, s2 texld r2, r2.zwzw, s2 mov r3.w, r2.x mov r3.z, r4.x add r2, r0.z, -r3 cmp r2, r2, c0.z, c0.w dp4 r2.x, r2, c2.x mad r3, r1.zwzw, c8, r0.xyxy texld r4, r3, s2 //Slightly shifts on y axis texld r3, r3.zwzw, s2 mov r4.y, r3.x mad r3, r1.zwzw, c7, r0.xyxy texld r5, r3, s2 texld r3, r3.zwzw, s2 mov r4.w, r3.x mov r4.z, r5.x add r3, r0.z, -r4 cmp r3, r3, c0.z, c0.w dp4 r2.y, r3, c2.x add r2.x, r2.y, r2.x mad r3, r1.zwzw, c6, r0.xyxy texld r4, r3, s2 texld r3, r3.zwzw, s2 mov r4.y, r3.x mad r3, r1.zwzw, c5, r0.xyxy texld r5, r3, s2 texld r3, r3.zwzw, s2 mov r4.w, r3.x mov r4.z, r5.x add r3, r0.z, -r4 cmp r3, r3, c0.z, c0.w dp4 r2.y, r3, c2.x add r2.x, r2.y, r2.x mad r3, r1.zwzw, c4, r0.xyxy mad r1, r1, c3, r0.xyxy texld r4, r3, s2 texld r3, r3.zwzw, s2 mov r4.y, r3.x texld r3, r1, s2 texld r1, r1.zwzw, s2 mov r4.w, r1.x mov r4.z, r3.x add r1, r0.z, -r4 cmp r1, r1, c0.z, c0.w dp4 r0.x, r1, c2.x add r0.x, r0.x, r2.x add r0.x, -r0.w, r0.x add r0.x, r0.x, c0.w mov_sat oC0, r0.x //Disable broken shadows //mov oC0.xyzw, c0.zzzz // approximately 88 instruction slots used (17 texture, 71 arithmetic) [/code] Edit: Also, how do you divide in ASM shader code for Christ's sake? I managed to fix some lights rendered at depth/in 2D, but I did it by multiplying the correction by a fixed value of 0.25, which I'm assuming would be the same as dividing by the projection matrix m00 component, but for the life of me I can't find the correct operand for division, if one even exists. In one of my resources it says there is an operand DIV in ASM, but that doesn't seem to work, and the MSDN library for shader ASM doesn't provide any operands for division. Really starting to hate working with Dx9 games and wishing HLSL/3DMigoto was usable instead. *Bangs face on keyboard*
I've slightly shifted my focus to working on another game as an easier example to help me learn (and will return to Vermintide shortly). It's a Dx9 game, and shadows are in 2D. I'm using Mike's comments in the Shogun discussion previously linked as a basis for the fix, and I believe I've located the correct location to fix. Problem is, I've only been able to locate the registers for the projection matrix, but there does not seem to be any for an inv projection matrix, and I'm confident I've done a thorough search through all the dumps. Is there any way for me to either build my own inv proj matrix, or otherwise perform equivalent calculations in ASM, using the existing projection matrix as a basis?

I've included the code from the PS that I've implemented up to this point.

//Title screen - Helicopter shadow
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
// float4 CascadeScale;
// float4 CascadeTextureSplitsEnd;
// sampler2D DepthSpecBuffer;
// float3 DownDir;
// float3 EyePos;
// float4 FadeoutParameters;
// float4 InvScreenSize;
// float2 InvShadowMapSize;
// float4x4 LightProjectionTex[4];
// float3 RightDir;
// float4 ShadowParameters;
// sampler2D ShadowTex;
// float3 UpperLeftCorner;
//
//
// Registers:
//
// Name Reg Size
// ----------------------- ----- ----
// InvShadowMapSize c34 1
// CascadeScale c36 1
// CascadeTextureSplitsEnd c37 1
// FadeoutParameters c38 1
// LightProjectionTex c40 8
// ShadowParameters c60 1
// InvScreenSize c61 1
// UpperLeftCorner c62 1
// RightDir c63 1
// DownDir c64 1
// EyePos c65 1
// DepthSpecBuffer s0 1
// ShadowTex s2 1
//

ps_3_0
def c0, 0.5, 0.999989986, 0, 1
def c1, -0, -1, -2, -3
def c2, 0.0625, 0, 0, 0
def c3, -0.81409955, 0.914375901, 0.199841261, 0.78641367
def c4, 0.791975141, 0.190901875, -0.241888404, 0.997065067
def c5, 0.53742981, -0.4737342, -0.26496911, -0.418930233
def c6, 0.974843979, 0.756483793, 0.443233252, -0.975115538
def c7, -0.815442324, -0.879124641, -0.382775426, 0.276768446
def c8, 0.344959378, 0.293877602, -0.915885806, 0.457714319
def c9, 0.945586085, -0.768907249, -0.0941841006, -0.929388702
def c10, 0.143831611, -0.1410079, -0.942016244, -0.399062157

dcl vPos.xy
dcl_2d s0
dcl_2d s2
dcl_2d s13
mov r0.x, c0.x
mul r0.xy, r0.x, c61
mad r0.xy, vPos, c61, r0
texld r1, r0, s0
add r2, -r1.x, c0.y
texkill r2
mov r2.xyz, c63
mad r0.xzw, r2.xyyz, r0.x, c62.xyyz
mad r0.xyz, c64, r0.y, r0.xzww
mul r1.yzw, r0.xxyz, r1.x
mad r0.xyz, r1.x, r0, c65 //c65 is eyepos register, r1.x contains depth value
/*
mov r0.w, c0.w
mov r10, r0

dp4 r11.x, r10, c102 <--Am using the VPM here
dp4 r11.y, r10, c103
dp4 r11.z, r10, c104
dp4 r11.w, r10, c105

texldl r24, c2.x, s13 //c2.x is an already defined constant with stereo fix value
add r24.y, r11.w, -r24.y
mul r24.x, r24.x, r24.y
add r11.x, r11.x, -r24.x

//Here is where inverse VPM should occur, but no registers exist for it. The following is code from Mike's example
dp4 r10.x, r11, c20 <-- Use the inverse VPM here
dp4 r10.y, r11, c21
dp4 r10.z, r11, c22
dp4 r10.w, r11, c23

mov r0, r10
*/
dp3 r0.w, r1.yzww, r1.yzww
rsq r0.w, r0.w
rcp r0.w, r0.w
add r1, -r0.w, c37
add r0.w, -r0.w, c38.x
mul_sat r0.w, r0.w, c38.y
cmp r1, r1, c0.z, c0.w
dp4 r1.x, r1, c0.w
mul r1.yzw, r0.y, c41.xxyz
mad r1.yzw, c40.xxyz, r0.x, r1
mad r1.yzw, c42.xxyz, r0.z, r1
add r1.yzw, r1, c43.xxyz
mul r2.xyz, r0.y, c45
mad r2.xyz, c44, r0.x, r2
mad r0.xyz, c46, r0.z, r2
add r0.xyz, r0, c47
cmp r0.xyz, -r1.x, r1.yzww, r0
add r1, r1.x, c1
cmp r1, -r1_abs, c0.w, c0.z
dp4 r1.x, c36, r1
mov r2.xy, c34
mul r2, r2.xyxy, c60.x
mul r1, r1.x, r2
mad r2, r1.zwzw, c10, r0.xyxy
texld r3, r2, s2
texld r2, r2.zwzw, s2
mov r3.y, r2.x
mad r2, r1.zwzw, c9, r0.xyxy
texld r4, r2, s2
texld r2, r2.zwzw, s2
mov r3.w, r2.x
mov r3.z, r4.x
add r2, r0.z, -r3
cmp r2, r2, c0.z, c0.w
dp4 r2.x, r2, c2.x
mad r3, r1.zwzw, c8, r0.xyxy
texld r4, r3, s2 //Slightly shifts on y axis
texld r3, r3.zwzw, s2
mov r4.y, r3.x
mad r3, r1.zwzw, c7, r0.xyxy
texld r5, r3, s2
texld r3, r3.zwzw, s2
mov r4.w, r3.x
mov r4.z, r5.x
add r3, r0.z, -r4
cmp r3, r3, c0.z, c0.w
dp4 r2.y, r3, c2.x
add r2.x, r2.y, r2.x
mad r3, r1.zwzw, c6, r0.xyxy
texld r4, r3, s2
texld r3, r3.zwzw, s2
mov r4.y, r3.x
mad r3, r1.zwzw, c5, r0.xyxy
texld r5, r3, s2
texld r3, r3.zwzw, s2
mov r4.w, r3.x
mov r4.z, r5.x
add r3, r0.z, -r4
cmp r3, r3, c0.z, c0.w
dp4 r2.y, r3, c2.x
add r2.x, r2.y, r2.x
mad r3, r1.zwzw, c4, r0.xyxy
mad r1, r1, c3, r0.xyxy
texld r4, r3, s2
texld r3, r3.zwzw, s2
mov r4.y, r3.x
texld r3, r1, s2
texld r1, r1.zwzw, s2
mov r4.w, r1.x
mov r4.z, r3.x
add r1, r0.z, -r4
cmp r1, r1, c0.z, c0.w
dp4 r0.x, r1, c2.x
add r0.x, r0.x, r2.x
add r0.x, -r0.w, r0.x
add r0.x, r0.x, c0.w
mov_sat oC0, r0.x

//Disable broken shadows
//mov oC0.xyzw, c0.zzzz

// approximately 88 instruction slots used (17 texture, 71 arithmetic)


Edit: Also, how do you divide in ASM shader code for Christ's sake? I managed to fix some lights rendered at depth/in 2D, but I did it by multiplying the correction by a fixed value of 0.25, which I'm assuming would be the same as dividing by the projection matrix m00 component, but for the life of me I can't find the correct operand for division, if one even exists. In one of my resources it says there is an operand DIV in ASM, but that doesn't seem to work, and the MSDN library for shader ASM doesn't provide any operands for division. Really starting to hate working with Dx9 games and wishing HLSL/3DMigoto was usable instead.

*Bangs face on keyboard*

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

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

Posted 11/10/2015 10:59 PM   
Where has c102-c105 come from in that shader? It's not defined in the shader and I don't see it listed in the headers, so the game isn't passing it in. If you are copying that matrix from another shader with Helix Mod, you can use Helix mod to inverse it for you (unless it's a 3x4 matrix like Unity 5 has started using). e.g. if you were copying the view-projection matrix from c4-c7 in vertex shader 11111111 you could do something like this: [code] [VS11111111] GetMatrixFromReg = 4 InverseMatrix = true DoubleInverseMatrix = true [VS22222222] UseMatrix = true MatrixReg = 200 [/code] Then you would have the inverse view-projection matrix in c200-c203 and the forward view-projection matrix in c204-c207 (because DoubleInverseMatrix will inverse the inverse, which is almost the same as not inversing it, but means we can use just one of the two available matrix copy slots in Helix Mod to effectively copy two matrices). If you just want to inverse a matrix that is already available in a shader you can do much the same thing, just put everything in a single section for the shader (and in that case you probably wouldn't bother with DoubleInverseMatrix since you already have the forwards matrix). http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List As for division - in SM3/DX9 there is no division operation (that's SM4/DX10 and above), but there is a reciprocal instruction you can use instead to multiply by 1/x, which is effectively the same thing as a division. e.g. to divide r31.x by r4.x you would do: [code] rcp r31.w, r4.x mul r31.x, r31.x, r31.w [/code] If you are wondering why, it's because a "division" is a *very* slow operation, many times slower than a multiplication, so it is best avoided. But, thanks to a really interesting properly of how floating point numbers are encoded for IEEE 754, the reciprocal can be approximated very quickly by using an integer subtraction (I'd guess that the hardware might do something a little more accurate than this unless the partial precision modifier is used, but still should be many times faster than a true division): [url]https://en.wikipedia.org/wiki/Floating_point#Piecewise_linear_approximation_to_exponential_and_logarithm[/url]
Where has c102-c105 come from in that shader? It's not defined in the shader and I don't see it listed in the headers, so the game isn't passing it in.

If you are copying that matrix from another shader with Helix Mod, you can use Helix mod to inverse it for you (unless it's a 3x4 matrix like Unity 5 has started using). e.g. if you were copying the view-projection matrix from c4-c7 in vertex shader 11111111 you could do something like this:
[VS11111111]
GetMatrixFromReg = 4
InverseMatrix = true
DoubleInverseMatrix = true

[VS22222222]
UseMatrix = true
MatrixReg = 200

Then you would have the inverse view-projection matrix in c200-c203 and the forward view-projection matrix in c204-c207 (because DoubleInverseMatrix will inverse the inverse, which is almost the same as not inversing it, but means we can use just one of the two available matrix copy slots in Helix Mod to effectively copy two matrices).

If you just want to inverse a matrix that is already available in a shader you can do much the same thing, just put everything in a single section for the shader (and in that case you probably wouldn't bother with DoubleInverseMatrix since you already have the forwards matrix).

http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List


As for division - in SM3/DX9 there is no division operation (that's SM4/DX10 and above), but there is a reciprocal instruction you can use instead to multiply by 1/x, which is effectively the same thing as a division. e.g. to divide r31.x by r4.x you would do:
rcp r31.w, r4.x
mul r31.x, r31.x, r31.w


If you are wondering why, it's because a "division" is a *very* slow operation, many times slower than a multiplication, so it is best avoided. But, thanks to a really interesting properly of how floating point numbers are encoded for IEEE 754, the reciprocal can be approximated very quickly by using an integer subtraction (I'd guess that the hardware might do something a little more accurate than this unless the partial precision modifier is used, but still should be many times faster than a true division):
https://en.wikipedia.org/wiki/Floating_point#Piecewise_linear_approximation_to_exponential_and_logarithm

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/11/2015 01:11 AM   
  40 / 88    
Scroll To Top