Thanks for responding Helifax.
Regarding your suggestions for method 1: I'm actually already quite familiar with the concept of taking a world space coordinate, using a VPM to convert to projection space, doing a stereo correction, and then using an iVPM to convert back to world space after the correction. Wouldn't have been able to complete most of my existing fixes without that! ;)
Assuming you're referring to the matrix multiplication that occurs on lines 72-75, you'd actually be incorrect: That is definitely not an inverse view projection matrix, that is either a projection or view projection matrix that is converting the coordinates to projection space. I'm certain of this because of the following calculations on lines 80 and 81 (which as per DSS's comments that explains the various transformation calculations here: [url]https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4715553/#4715553[/url]) are converting from projection space into pixel coordinates (I should also mention that from using frame analysis I could tell that cb1[15] that was used on line 81 was the resolution, which helped me to confirm this). Strangely enough, theoretically a standard stereo fix there should be exactly what is needed right after that, but as per my comments in the code for some reason a) the X and Y coordinates seem to be reversed, and b) the correction value was way more than it should have been. I also attempted to do a VPM/iVPM fix at the line 57 section as well, but that just broke things big time!
As for your suggestion to use your ROTTR fix as a study measure for scenario 2, I would love to, however there's what, like 25000 shaders in that fix? It would be like finding a needle in a haystack for me to find which shader you're referring to! LOL.
Regarding your suggestions for method 1: I'm actually already quite familiar with the concept of taking a world space coordinate, using a VPM to convert to projection space, doing a stereo correction, and then using an iVPM to convert back to world space after the correction. Wouldn't have been able to complete most of my existing fixes without that! ;)
Assuming you're referring to the matrix multiplication that occurs on lines 72-75, you'd actually be incorrect: That is definitely not an inverse view projection matrix, that is either a projection or view projection matrix that is converting the coordinates to projection space. I'm certain of this because of the following calculations on lines 80 and 81 (which as per DSS's comments that explains the various transformation calculations here: https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4715553/#4715553) are converting from projection space into pixel coordinates (I should also mention that from using frame analysis I could tell that cb1[15] that was used on line 81 was the resolution, which helped me to confirm this). Strangely enough, theoretically a standard stereo fix there should be exactly what is needed right after that, but as per my comments in the code for some reason a) the X and Y coordinates seem to be reversed, and b) the correction value was way more than it should have been. I also attempted to do a VPM/iVPM fix at the line 57 section as well, but that just broke things big time!
As for your suggestion to use your ROTTR fix as a study measure for scenario 2, I would love to, however there's what, like 25000 shaders in that fix? It would be like finding a needle in a haystack for me to find which shader you're referring to! LOL.
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
You can pick any of the Pixel Shaders in ROTTR and give it a look.
Most of them are using the same patterns to fix things;) There should should be 2 correction points;) in the shaders;)
Hope this helps.
You can pick any of the Pixel Shaders in ROTTR and give it a look.
Most of them are using the same patterns to fix things;) There should should be 2 correction points;) in the shaders;)
Hope this helps.
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
[quote="DJ-RK"]Scenario 1: You apply a stereo correction, but it only works at certain depth and/or convergence values.
My understanding was that this generally means the coordinates are in view space, rather than projection space, and therefore you also need to multiply by the FOV (in most cases either divide by a projection matrix m00 or multiply by an inverse_projection matrix m00). Sometimes the above works... but I've also come across a few occasions where it hasn't[/quote]Typically that is correct, but I always try to keep an open mind when I'm fixing a game so I don't get caught out by an incorrect assumption. I've also had corrections slightly out because of mixing up .w and .z for the depth values, or where there was some game specific scaling that was applied or where something needed to be normalised after a matrix multiplication (or not).
[quote]or where it might not be possible to easily find a projection/inverse_projection matrix. What then? Are there alternative ways to obtain the FOV, or is there anything else that could be the cause/solution to this situation?[/quote]There's a few strategies I've used when the projection matrix is not available, depending on what is available:
a) Use an inverse model-view matrix and a model-view-projection matrix to derive the projection matrix (e.g. old style Unity fixes)
b) Use the camera frustum to derive the horizontal FOV (e.g. The Last Tinker)
c) Use the absolute value of a world-space correction as a view-space correction (relies on the camera scale being 1:1)
d) Find an alternate place that a fix can be applied in world-space coordinates instead (e.g. New style Unity fixes) or clip-space
e) The FOV may be passed into another shader constant
Depending on the game there might be other options - if there's nothing obvious study whatever is available or could be copied from elsewhere to see if there is anything that could be used.
[quote]
Here's an example of a lighting shader from Hard Reset Redux where finding the location to fix was simple enough, but it's as explained in scenario 1 as only being correct at certain depth/convergence values. No shader headers, so I had to use frame analysis constant buffer output to locate an inverse_projection matrix, but it's close but not quite right.
[code]...
r1.xyzw = t15.SampleLevel(s8_s, r0.xy, 0).xyzw;
r1.x = r1.x * cb0[18].x + cb0[18].z;
r1.x = 1 / r1.x;
r2.xy = v0.xy * cb0[16].zw + cb0[17].zw;
r2.z = 1;
r1.yzw = -r2.xyz * r1.xxx + cb1[8].xyz;
r2.xyz = r2.xyz * r1.xxx;
float4 stereo = StereoParams.Load(0);
float4 params = IniParams.Load(0);
r2.x += stereo.x * (r2.z - stereo.y)*cb0[0].x;
// Standard stereo correction is not right. Need FOV. Found cb0[0] through frame analysis appears to be an inverse projection matrix, however it only brings it close, not correctly fixed
[/code]
[/quote]I notice the coordinate you are correcting is also used to calculate r1.yzw, so it might be worth trying the corrected coordinate there, by adding this after your stereo correction:
[code]
r1.yzw = -r2.xyz + cb1[8].xyz;
[/code]
[quote]
Scenario 2: You need to stereo correct a set of coordinate with only an xy coordinate, no zw available.
Basically, how do you obtain a correct depth value when one isn't immediately available? I've seen DSS derive a depth value in some pixel shaders before using other constant buffer values, but couldn't quite get a handle on how he figured that out.
[/quote]If there's no depth value things get tricky - you might be looking at the wrong place to do a correction, or you might need to remove a stereo correction (if the driver applied one) or apply a correction at a fixed depth that is close enough. You may be able to use the depth buffer to get a depth value, but depending on the effect this may or may not be suitable (and may or may not be good enough - I've used this in a couple of UE3 games to approximate the depth of halos around lights to varying degrees of success). In at least one case (MGSV halos around lights) the depth value had been passed to the shader, but was in a separate constant.
[quote]
I just came across this one in Transformers - Devastation, where in this game shadows are correct, but create halos around characters & objects. I found the shader and the o1 output is the one needed to be correction, but it's only got an .xy output (Does this mean that these are pixel coordinates?) and the very first line sets the o1.xy output that needs to be corrected which doesn't leave much room to be corrected.
[/quote]This one is a bit hard to call - from the code alone I would not expect that any adjustments would be needed in the vertex shader and everything should be done in the pixel shader, but depending on what has been passed in v0.w and v1.xy there might be something needed. Notably the output position is essentially being passed straight through from the input, which makes me suspect that is only a 2D coordinate and is unlikely the driver would be adjusting it.
DJ-RK said:Scenario 1: You apply a stereo correction, but it only works at certain depth and/or convergence values.
My understanding was that this generally means the coordinates are in view space, rather than projection space, and therefore you also need to multiply by the FOV (in most cases either divide by a projection matrix m00 or multiply by an inverse_projection matrix m00). Sometimes the above works... but I've also come across a few occasions where it hasn't
Typically that is correct, but I always try to keep an open mind when I'm fixing a game so I don't get caught out by an incorrect assumption. I've also had corrections slightly out because of mixing up .w and .z for the depth values, or where there was some game specific scaling that was applied or where something needed to be normalised after a matrix multiplication (or not).
or where it might not be possible to easily find a projection/inverse_projection matrix. What then? Are there alternative ways to obtain the FOV, or is there anything else that could be the cause/solution to this situation?
There's a few strategies I've used when the projection matrix is not available, depending on what is available:
a) Use an inverse model-view matrix and a model-view-projection matrix to derive the projection matrix (e.g. old style Unity fixes)
b) Use the camera frustum to derive the horizontal FOV (e.g. The Last Tinker)
c) Use the absolute value of a world-space correction as a view-space correction (relies on the camera scale being 1:1)
d) Find an alternate place that a fix can be applied in world-space coordinates instead (e.g. New style Unity fixes) or clip-space
e) The FOV may be passed into another shader constant
Depending on the game there might be other options - if there's nothing obvious study whatever is available or could be copied from elsewhere to see if there is anything that could be used.
Here's an example of a lighting shader from Hard Reset Redux where finding the location to fix was simple enough, but it's as explained in scenario 1 as only being correct at certain depth/convergence values. No shader headers, so I had to use frame analysis constant buffer output to locate an inverse_projection matrix, but it's close but not quite right.
...
r1.xyzw = t15.SampleLevel(s8_s, r0.xy, 0).xyzw;
r1.x = r1.x * cb0[18].x + cb0[18].z;
r1.x = 1 / r1.x;
r2.xy = v0.xy * cb0[16].zw + cb0[17].zw;
r2.z = 1;
r1.yzw = -r2.xyz * r1.xxx + cb1[8].xyz;
r2.xyz = r2.xyz * r1.xxx;
float4 stereo = StereoParams.Load(0);
float4 params = IniParams.Load(0);
r2.x += stereo.x * (r2.z - stereo.y)*cb0[0].x;
// Standard stereo correction is not right. Need FOV. Found cb0[0] through frame analysis appears to be an inverse projection matrix, however it only brings it close, not correctly fixed
I notice the coordinate you are correcting is also used to calculate r1.yzw, so it might be worth trying the corrected coordinate there, by adding this after your stereo correction:
r1.yzw = -r2.xyz + cb1[8].xyz;
Scenario 2: You need to stereo correct a set of coordinate with only an xy coordinate, no zw available.
Basically, how do you obtain a correct depth value when one isn't immediately available? I've seen DSS derive a depth value in some pixel shaders before using other constant buffer values, but couldn't quite get a handle on how he figured that out.
If there's no depth value things get tricky - you might be looking at the wrong place to do a correction, or you might need to remove a stereo correction (if the driver applied one) or apply a correction at a fixed depth that is close enough. You may be able to use the depth buffer to get a depth value, but depending on the effect this may or may not be suitable (and may or may not be good enough - I've used this in a couple of UE3 games to approximate the depth of halos around lights to varying degrees of success). In at least one case (MGSV halos around lights) the depth value had been passed to the shader, but was in a separate constant.
I just came across this one in Transformers - Devastation, where in this game shadows are correct, but create halos around characters & objects. I found the shader and the o1 output is the one needed to be correction, but it's only got an .xy output (Does this mean that these are pixel coordinates?) and the very first line sets the o1.xy output that needs to be corrected which doesn't leave much room to be corrected.
This one is a bit hard to call - from the code alone I would not expect that any adjustments would be needed in the vertex shader and everything should be done in the pixel shader, but depending on what has been passed in v0.w and v1.xy there might be something needed. Notably the output position is essentially being passed straight through from the input, which makes me suspect that is only a 2D coordinate and is unlikely the driver would be adjusting it.
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
Hi, just asking in future if people can use either 3dvisionlive or different service for image hosting.
I am going to be moving most of the embeded stereoscopic images that are on my host[amazon] currently on mainsite to 3dvisionlive.
If you want to link to image or just store images thats 100% fine but 10+ megs for every time someone visits site is crazy [3840x1080 is huge and theree is 0 compression on these images]. Especially since some of these images wind up tracking a 100,000ish loads according to 3dvisionlive.
If other admins can do there best to try reinforce that I'd be grateful.
Hi, just asking in future if people can use either 3dvisionlive or different service for image hosting.
I am going to be moving most of the embeded stereoscopic images that are on my host[amazon] currently on mainsite to 3dvisionlive.
If you want to link to image or just store images thats 100% fine but 10+ megs for every time someone visits site is crazy [3840x1080 is huge and theree is 0 compression on these images]. Especially since some of these images wind up tracking a 100,000ish loads according to 3dvisionlive.
If other admins can do there best to try reinforce that I'd be grateful.
hi, i am working with totalwar Warhammer,
i can fix shadows and lights but i have a problem with the particles, smoke, fire,.. i only can see them for one eye,
the problem it is that it affect to a lots effects.
i found a verter shader that call to 3 pixel shaders, and i think it is the responsible, because i disable it and disable all the effects.
i have can fix 5204e031b4a1009d and 4831160c5c836214, but imposible put in stereo e9617846f5ecf04d, i have try a lot combinations in the vs, and i only have move the the effect at the left or center
Testing frame analysis ( i would like some tips ),
TEST 1:
---------
o1-001500=868ffd29-vs=61cfe8e9ff44f072-ps=5204e031b4a1009d OK
o2-001500=07f0c88e-vs=61cfe8e9ff44f072-ps=5204e031b4a1009d OK
(...)
o0-001509=4ce8bfab-vs=61cfe8e9ff44f072-ps=e9617846f5ecf04d NO STEREO MONO grrr
i see that o0 output from VS in mono ( black backgroung with the flames ),
result:
effects MONO
shadows OK Fantastics !!
The game would be playable if i disable the particles effects but grrrrrr.
TEST 2:
--------
(...)
using stereoflagDX10 in profile, and fame analysis again
Setting ID_0x702442fc = 0x1c220024 InternalSettingFlag=V0
o0-001509=4ce8bfab-vs=61cfe8e9ff44f072-ps=e9617846f5ecf04d OK in stereo !!!!!!
result:
effects OK Fantastics!!!!!!
shadows but shadows are now totally broken imposible to fix them, in MONO GRRRRRR
The game would be playable if i disable shadows in options.
I try different combinations and different profiles, maxpayne3, battlefield,.... and combinations ( bono loto ), but the result it is always the same, either fix the particles or shadows, but not both at the same time.
- is is problem of the driver? any idea, i am using windows 10 with last version from nvidia
- If i try,
[TextureOverrideAAAAAA]
hash = 4ce8bfab
StereoMode=2
the result it is, the effect, particles, smoke, fire... at screen depth
- if 4ce8bfab it is a rendertarget as can i put it in stereo, some tips or override or
i would must continue searching for another shader ?
- i found 1 Geometry GS and 2 Computer Shaders CS, with EMITTER_CONSTANTS... but i have not idea as to change it.
playing with the CS i disabled all the effects too.
- some tips for frameanalys,? i can not open the dds, with gimp, and anothers viewers,.
- i read a post with DDS talking about monobuffers and mono textures, how can put them in stereo, and how i know if are in stereo or not?
Please use the [ code ] [ /code ] tags for code.
No one likes to sit and scroll endless pages of text like that;)
It makes the code much more readable as well...
Please use the [ code ] [ /code ] tags for code.
No one likes to sit and scroll endless pages of text like that;)
It makes the code much more readable as well...
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 helifax ))
DHR,
yes i try and no effect, only stereomode=2 put it in screendepth
different tests i was using by playing with the bits of stereoflagDX10 0x1c22..24 from 00,.. to FE Witcher3 .... looking for the dif,
Setting ID_0x702442fc = 0x1c220e24 InternalSettingFlag=V0
[code]
0x1c220e24
0x1C220024 Metro: Last Light sombras particles ok
0x1C21FE24 Metro: Last Light sombras ok particles
0x1C22AE24 Passion Leads Army Benchmark sombras particles ok
FE 1111 1110
AE 1010 1110
prueba1 11101110 EE sombras particles ok
prueba3 10101110 AE sombras particles ok
prueba3 00000000 00 sombras particles ok
prueba2 10111110 BE sombras ok particles
prueba3 11111110 FE sombras ok particles
prueba3 11110000 F0 sombras ok particles
prueba3 00010000 10 sombras ok particles
prueba3 00100000 20 sombras ?F particles ok
prueba3 00110000 30 sombras ok particles
prueba3 01000000 40 sombras particles
prueba3 01010000 50 sombras particles
prueba3 01100000 60 sombras particles ok
prueba3 01110000 0 sombras particles
prueba3 10000000 0 sombras particles
prueba3 10010000 0 sombras particles
prueba3 10100000 A0 sombras particles ok
prueba3 10110000 0 sombras particles
prueba3 11000000 0 sombras particles
prueba3 11010000 0 sombras particles
prueba3 11100000 E0 sombras particles ok
prueba3 11110000 F0 sombras ok particles
[/code]
I test too to disable tesselation in preferences_script of the game, but not result
here it is the output with stereoflagdx10 0x1c220e24, the particles are ok but shadows bad
[url]https://s3.amazonaws.com/kankgeforce99/STEREO+o0-001594%3D4ce8bfab-vs%3D61cfe8e9ff44f072-ps%3De9617846f5ecf04d.jps[/url]
without stereoflag, default profile
[url]https://s3.amazonaws.com/kankgeforce99/NOSTEREO+o0-001509%3D4ce8bfab-vs%3D61cfe8e9ff44f072-ps%3De9617846f5ecf04d.jps[/url]
original photo without stereoflag, all fixes applied, shadows ok but ...
[url]https://s3.amazonaws.com/kankgeforce99/Warhammer03_50.jps[/url]
- hull geometry domain shaders go after verter shaders no? if vs output it is bad then?¿
- driver version?? i am using windows 10 and last driver from nvidia, why witcher3 for example need the before?,
now thinking i have a similar problem with attila with the reflections in the sea, only in mono, i can not fix them, only disable
another test with no result that i did..
[code]
0x00008000 STEREO_COMPUTE_SAME_RESOURCES_AS_GRAPHICS - "stereorize the same resources as for graphics (do not mark all UAVs as stereorizable)"
0x00004000 STEREO_COMPUTE_ENABLE - enables running compute shaders once for each eye. Fixes mono depth buffer issue in Far Cry 4 (SLI users can alternatively resolve this with custom SLI compatibility bits), Witcher 3, and other games
[/code]
0x1C220024 Metro: Last Light sombras particles ok
0x1C21FE24 Metro: Last Light sombras ok particles
0x1C22AE24 Passion Leads Army Benchmark sombras particles ok
FE 1111 1110
AE 1010 1110
prueba1 11101110 EE sombras particles ok
prueba3 10101110 AE sombras particles ok
prueba3 00000000 00 sombras particles ok
prueba2 10111110 BE sombras ok particles
prueba3 11111110 FE sombras ok particles
prueba3 11110000 F0 sombras ok particles
prueba3 00010000 10 sombras ok particles
prueba3 00100000 20 sombras ?F particles ok
prueba3 00110000 30 sombras ok particles
- hull geometry domain shaders go after verter shaders no? if vs output it is bad then?¿
- driver version?? i am using windows 10 and last driver from nvidia, why witcher3 for example need the before?,
now thinking i have a similar problem with attila with the reflections in the sea, only in mono, i can not fix them, only disable
another test with no result that i did..
0x00008000 STEREO_COMPUTE_SAME_RESOURCES_AS_GRAPHICS - "stereorize the same resources as for graphics (do not mark all UAVs as stereorizable)"
0x00004000 STEREO_COMPUTE_ENABLE - enables running compute shaders once for each eye. Fixes mono depth buffer issue in Far Cry 4 (SLI users can alternatively resolve this with custom SLI compatibility bits), Witcher 3, and other games
For testing:
If you use this code the particles are in mono and shadows OK, right:
[code]
[TextureOverrideAAAAAA]
hash = 4ce8bfab
StereoMode=2[/code]
If you add some code to the VS? make all particles goes to a fixed depth? Works?
For example: o0.x += stereo.x * 0.6; (o0 been the output)
I see that in the VS you have the Inverse Proj Matrix, so if the expirement works you can pass that Matrix to the PS and fix the particles in the PS to the correct depth.
If you add some code to the VS? make all particles goes to a fixed depth? Works?
For example: o0.x += stereo.x * 0.6; (o0 been the output)
I see that in the VS you have the Inverse Proj Matrix, so if the expirement works you can pass that Matrix to the PS and fix the particles in the PS to the correct depth.
this it is the ps, more easy because it have too all the matrices
but i am new fixing yet, and i dont know as apply it, all i try it didnt work,
and when a see that doing changes in driver all was ok ( thanks to bob ),... i dont know as continue
i dont know if mono at screen depth would can be corrected.
That it is different to shogun2, or rome2 for example where i had to fix the vs before and after fix the ps to coorrect halos and ...
i will try only with separation in vs not stereo.y... but the vs its complicated you see )))
i think i tried it before and after each view/inv projection and with different options and the more usual was not effect.. or broken all totally but no in stereo never
i dont understand well as fix a simple vpos.xy that i have seen in many fixes grrrr
in totalwar normally
cb0[0] camera position
cb0[1-4] view
cb0[9-12] view-projection ....
you can see in tags
too the other output texcord from vs, o1 o2,.. for the others pixel shaders, i can see in frame analysis that are ok, in stereo, only o0 it is the problematic
This doesn't have anything to do with stereoscopic 3D, but it's related to helixmod and 3Dmigoto.
In Castlevania Lords of Shadow, there is one thing that reduces my enjoyment, and it's the forced motion blur. So I thought: "This should be easy now that I know how to disable vertex and pixel shaders with the helixmod wrapper!".
However, the pixel shader that controls motion blur is also linked to part of the brightness in the game. Just disabling the pixel shader makes the image darker, and I haven't found a constant that affects only motion blur. I tried creating a constant (c200) with values "0, 0, 0, 0", but trying it around the shader didn't work (it either did nothing, or made the image totally black or white, or did the same as disabling the shader completely).
I've also found this problem in FFX (Besaid island beach) and Persona 4 (using the DX11 renderer).
Here is the code of the pixel shader (69C39902.txt), in case someone wants to look at it and is interested in disabling motion blur too:
[code]//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
// float RenderMult;
// sampler2D bloom;
// float fExposure;
// float4 g_LevelsColorShift;
// float g_LevelsContrast;
// sampler2D luminance;
// sampler2D original_scene;
//
//
// Registers:
//
// Name Reg Size
// ------------------ ----- ----
// RenderMult c0 1
// fExposure c1 1
// g_LevelsColorShift c2 1
// g_LevelsContrast c3 1
// original_scene s0 1
// luminance s1 1
// bloom s2 1
//
ps_3_0
def c4, 0.5, 0.298999995, 0.587000012, 0.114
def c5, 1, 0, 0, 0
dcl_texcoord v0.xy
dcl_2d s0
dcl_2d s1
dcl_2d s2
texld r0, v0, s0
texld r1, v0, s2
mad r0.xyz, r0, c0.x, r1
texld r1, c4.x, s1
rcp r0.w, r1.x
mul r0.w, r0.w, c1.x
mul r0.xyz, r0.w, r0
dp3 r0.w, r0, c4.yzww
mad r1.xyz, r0.w, c2, -r0
add r0.w, -r0.w, c5.x
mul_sat r0.w, r0.w, c2.w
mad r0.xyz, r0.w, r1, r0
add r0.xyz, r0, -c4.x
mov r1.x, c4.x
mad_sat oC0.xyz, c3.x, r0, r1.x
mov oC0.w, c5.x
// approximately 16 instruction slots used (3 texture, 13 arithmetic)
[/code]
The vertex shader (4E4FAB8D.txt) is:
[code]//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
vs_3_0
def c0, 1, -1, 0, 0
dcl_position v0
dcl_texcoord v1
dcl_color v2
dcl_position o0
dcl_texcoord o1.xy
dcl_color o2
mad o0, v0.xyxx, c0.xyzz, c0.zzzx
mov o1.xy, v1
mov o2, v2
// approximately 3 instruction slots used
[/code]
This doesn't have anything to do with stereoscopic 3D, but it's related to helixmod and 3Dmigoto.
In Castlevania Lords of Shadow, there is one thing that reduces my enjoyment, and it's the forced motion blur. So I thought: "This should be easy now that I know how to disable vertex and pixel shaders with the helixmod wrapper!".
However, the pixel shader that controls motion blur is also linked to part of the brightness in the game. Just disabling the pixel shader makes the image darker, and I haven't found a constant that affects only motion blur. I tried creating a constant (c200) with values "0, 0, 0, 0", but trying it around the shader didn't work (it either did nothing, or made the image totally black or white, or did the same as disabling the shader completely).
I've also found this problem in FFX (Besaid island beach) and Persona 4 (using the DX11 renderer).
Here is the code of the pixel shader (69C39902.txt), in case someone wants to look at it and is interested in disabling motion blur too:
so............
http://helixmod.blogspot.com.es/2016/07/totalwar-warhammer.html
i can not believe yet, imposible to fix the default profile, inverse strategy with stereoflagdx10 and...
unsteriorized shadows and .... i think that was in mono too as the particles but...
a lots thanks bobs dhr helifax
@kankgeforce99
I converted all your images to 3dvisionlive. Please either use 3dvisionlive or a different image host. 3500 views a day + 2MB of images per post = 7gb of file transfer each post per day.
If you dont want to use 3dvision live just change from jps -> to jpg and upload to any image service.
I am more then happy to host fixes + necessary files but stereoscopic images bring costs WAY up.
I converted all your images to 3dvisionlive. Please either use 3dvisionlive or a different image host. 3500 views a day + 2MB of images per post = 7gb of file transfer each post per day.
If you dont want to use 3dvision live just change from jps -> to jpg and upload to any image service.
I am more then happy to host fixes + necessary files but stereoscopic images bring costs WAY up.
[quote="eqzitara"]@kankgeforce99
I converted all your images to 3dvisionlive. Please either use 3dvisionlive or a different image host. 3500 views a day + 2MB of images per post = 7gb of file transfer each post per day.
If you dont want to use 3dvision live just change from jps -> to jpg and upload to any image service.
I am more then happy to host fixes + necessary files but stereoscopic images bring costs WAY up.
[/quote]
Oh... I should do the same with my Shadow Complex post. Or at least the trick I did with FFX (uploading an image to the post (which converts is to a small image), and changing the link inside the thumbnail to the corresponding cubeupload image, so it redirects to the big image).
I converted all your images to 3dvisionlive. Please either use 3dvisionlive or a different image host. 3500 views a day + 2MB of images per post = 7gb of file transfer each post per day.
If you dont want to use 3dvision live just change from jps -> to jpg and upload to any image service.
I am more then happy to host fixes + necessary files but stereoscopic images bring costs WAY up.
Oh... I should do the same with my Shadow Complex post. Or at least the trick I did with FFX (uploading an image to the post (which converts is to a small image), and changing the link inside the thumbnail to the corresponding cubeupload image, so it redirects to the big image).
Regarding your suggestions for method 1: I'm actually already quite familiar with the concept of taking a world space coordinate, using a VPM to convert to projection space, doing a stereo correction, and then using an iVPM to convert back to world space after the correction. Wouldn't have been able to complete most of my existing fixes without that! ;)
Assuming you're referring to the matrix multiplication that occurs on lines 72-75, you'd actually be incorrect: That is definitely not an inverse view projection matrix, that is either a projection or view projection matrix that is converting the coordinates to projection space. I'm certain of this because of the following calculations on lines 80 and 81 (which as per DSS's comments that explains the various transformation calculations here: https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4715553/#4715553) are converting from projection space into pixel coordinates (I should also mention that from using frame analysis I could tell that cb1[15] that was used on line 81 was the resolution, which helped me to confirm this). Strangely enough, theoretically a standard stereo fix there should be exactly what is needed right after that, but as per my comments in the code for some reason a) the X and Y coordinates seem to be reversed, and b) the correction value was way more than it should have been. I also attempted to do a VPM/iVPM fix at the line 57 section as well, but that just broke things big time!
As for your suggestion to use your ROTTR fix as a study measure for scenario 2, I would love to, however there's what, like 25000 shaders in that fix? It would be like finding a needle in a haystack for me to find which shader you're referring to! LOL.
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
Most of them are using the same patterns to fix things;) There should should be 2 correction points;) in the shaders;)
Hope this helps.
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)
There's a few strategies I've used when the projection matrix is not available, depending on what is available:
a) Use an inverse model-view matrix and a model-view-projection matrix to derive the projection matrix (e.g. old style Unity fixes)
b) Use the camera frustum to derive the horizontal FOV (e.g. The Last Tinker)
c) Use the absolute value of a world-space correction as a view-space correction (relies on the camera scale being 1:1)
d) Find an alternate place that a fix can be applied in world-space coordinates instead (e.g. New style Unity fixes) or clip-space
e) The FOV may be passed into another shader constant
Depending on the game there might be other options - if there's nothing obvious study whatever is available or could be copied from elsewhere to see if there is anything that could be used.
I notice the coordinate you are correcting is also used to calculate r1.yzw, so it might be worth trying the corrected coordinate there, by adding this after your stereo correction:
If there's no depth value things get tricky - you might be looking at the wrong place to do a correction, or you might need to remove a stereo correction (if the driver applied one) or apply a correction at a fixed depth that is close enough. You may be able to use the depth buffer to get a depth value, but depending on the effect this may or may not be suitable (and may or may not be good enough - I've used this in a couple of UE3 games to approximate the depth of halos around lights to varying degrees of success). In at least one case (MGSV halos around lights) the depth value had been passed to the shader, but was in a separate constant.
This one is a bit hard to call - from the code alone I would not expect that any adjustments would be needed in the vertex shader and everything should be done in the pixel shader, but depending on what has been passed in v0.w and v1.xy there might be something needed. Notably the output position is essentially being passed straight through from the input, which makes me suspect that is only a 2D coordinate and is unlikely the driver would be adjusting it.
2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit
Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD
Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword
I am going to be moving most of the embeded stereoscopic images that are on my host[amazon] currently on mainsite to 3dvisionlive.
If you want to link to image or just store images thats 100% fine but 10+ megs for every time someone visits site is crazy [3840x1080 is huge and theree is 0 compression on these images]. Especially since some of these images wind up tracking a 100,000ish loads according to 3dvisionlive.
If other admins can do there best to try reinforce that I'd be grateful.
Co-founder/Web host of helixmod.blog.com
Donations for web hosting @ paypal -eqzitara@yahoo.com
or
https://www.patreon.com/user?u=791918
i can fix shadows and lights but i have a problem with the particles, smoke, fire,.. i only can see them for one eye,
the problem it is that it affect to a lots effects.
i found a verter shader that call to 3 pixel shaders, and i think it is the responsible, because i disable it and disable all the effects.
i have can fix 5204e031b4a1009d and 4831160c5c836214, but imposible put in stereo e9617846f5ecf04d, i have try a lot combinations in the vs, and i only have move the the effect at the left or center
Testing frame analysis ( i would like some tips ),
TEST 1:
---------
o1-001500=868ffd29-vs=61cfe8e9ff44f072-ps=5204e031b4a1009d OK
o2-001500=07f0c88e-vs=61cfe8e9ff44f072-ps=5204e031b4a1009d OK
(...)
o0-001509=4ce8bfab-vs=61cfe8e9ff44f072-ps=e9617846f5ecf04d NO STEREO MONO grrr
i see that o0 output from VS in mono ( black backgroung with the flames ),
result:
effects MONO
shadows OK Fantastics !!
The game would be playable if i disable the particles effects but grrrrrr.
TEST 2:
--------
(...)
using stereoflagDX10 in profile, and fame analysis again
Setting ID_0x702442fc = 0x1c220024 InternalSettingFlag=V0
o0-001509=4ce8bfab-vs=61cfe8e9ff44f072-ps=e9617846f5ecf04d OK in stereo !!!!!!
result:
effects OK Fantastics!!!!!!
shadows but shadows are now totally broken imposible to fix them, in MONO GRRRRRR
The game would be playable if i disable shadows in options.
I try different combinations and different profiles, maxpayne3, battlefield,.... and combinations ( bono loto ), but the result it is always the same, either fix the particles or shadows, but not both at the same time.
- is is problem of the driver? any idea, i am using windows 10 with last version from nvidia
- If i try,
[TextureOverrideAAAAAA]
hash = 4ce8bfab
StereoMode=2
the result it is, the effect, particles, smoke, fire... at screen depth
- if 4ce8bfab it is a rendertarget as can i put it in stereo, some tips or override or
i would must continue searching for another shader ?
- i found 1 Geometry GS and 2 Computer Shaders CS, with EMITTER_CONSTANTS... but i have not idea as to change it.
playing with the CS i disabled all the effects too.
- some tips for frameanalys,? i can not open the dds, with gimp, and anothers viewers,.
- i read a post with DDS talking about monobuffers and mono textures, how can put them in stereo, and how i know if are in stereo or not?
thanks i am learning yet and a lot question uff
<RenderTarget orig_hash=4ce8bfab type=Texture2D Width=960 Height=540 MipLevels=1 ArraySize=1 RawFormat=10 Format="R16G16B16A16_FLOAT" SampleDesc.Count=1 SampleDesc.Quality=0 Usage=0 BindFlags=0x28 CPUAccessFlags=0x0 MiscFlags=0x0></RenderTarget>
SHADER 61cfe8e9ff44f072-vs.txt
Windows 7 64bit, i7, GTX680, 16GB, Benq 120hz
No one likes to sit and scroll endless pages of text like that;)
It makes the code much more readable as well...
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)
Try using StereoMode=1, as 2 is for create mono surface.
[TextureOverrideAAAAAA]
hash = 4ce8bfab
StereoMode=1
MY WEB
Helix Mod - Making 3D Better
My 3D Screenshot Gallery
Like my fixes? you can donate to Paypal: dhr.donation@gmail.com
DHR,
yes i try and no effect, only stereomode=2 put it in screendepth
different tests i was using by playing with the bits of stereoflagDX10 0x1c22..24 from 00,.. to FE Witcher3 .... looking for the dif,
Setting ID_0x702442fc = 0x1c220e24 InternalSettingFlag=V0
I test too to disable tesselation in preferences_script of the game, but not result
here it is the output with stereoflagdx10 0x1c220e24, the particles are ok but shadows bad
https://s3.amazonaws.com/kankgeforce99/STEREO+o0-001594%3D4ce8bfab-vs%3D61cfe8e9ff44f072-ps%3De9617846f5ecf04d.jps
without stereoflag, default profile
https://s3.amazonaws.com/kankgeforce99/NOSTEREO+o0-001509%3D4ce8bfab-vs%3D61cfe8e9ff44f072-ps%3De9617846f5ecf04d.jps
original photo without stereoflag, all fixes applied, shadows ok but ...
https://s3.amazonaws.com/kankgeforce99/Warhammer03_50.jps
- hull geometry domain shaders go after verter shaders no? if vs output it is bad then?¿
- driver version?? i am using windows 10 and last driver from nvidia, why witcher3 for example need the before?,
now thinking i have a similar problem with attila with the reflections in the sea, only in mono, i can not fix them, only disable
another test with no result that i did..
Windows 7 64bit, i7, GTX680, 16GB, Benq 120hz
If you use this code the particles are in mono and shadows OK, right:
If you add some code to the VS? make all particles goes to a fixed depth? Works?
For example: o0.x += stereo.x * 0.6; (o0 been the output)
I see that in the VS you have the Inverse Proj Matrix, so if the expirement works you can pass that Matrix to the PS and fix the particles in the PS to the correct depth.
MY WEB
Helix Mod - Making 3D Better
My 3D Screenshot Gallery
Like my fixes? you can donate to Paypal: dhr.donation@gmail.com
but i am new fixing yet, and i dont know as apply it, all i try it didnt work,
and when a see that doing changes in driver all was ok ( thanks to bob ),... i dont know as continue
i dont know if mono at screen depth would can be corrected.
That it is different to shogun2, or rome2 for example where i had to fix the vs before and after fix the ps to coorrect halos and ...
i will try only with separation in vs not stereo.y... but the vs its complicated you see )))
i think i tried it before and after each view/inv projection and with different options and the more usual was not effect.. or broken all totally but no in stereo never
i dont understand well as fix a simple vpos.xy that i have seen in many fixes grrrr
in totalwar normally
cb0[0] camera position
cb0[1-4] view
cb0[9-12] view-projection ....
you can see in tags
too the other output texcord from vs, o1 o2,.. for the others pixel shaders, i can see in frame analysis that are ok, in stereo, only o0 it is the problematic
e9617846f5ecf04d-ps.txt
Windows 7 64bit, i7, GTX680, 16GB, Benq 120hz
[TextureOverrideAAAAAA]
hash = 4ce8bfab
StereoMode=2
( at screen depth )
and
(...)
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r13.xyzw, l(0, 0, 0, 0), t125.xyzw
mov r13.w, r13.x
mul r13.w, r13.w, l(0.6)
add r5.x, r5.x, r13.w
mov o0.xyw, r5.xyxz
mov o0.z, l(0)
mov o6.xyz, l(0,0,0,0)
endif
endif
(...)
https://s3.amazonaws.com/kankgeforce99/Warhammer04_50.jps
but always mono
Windows 7 64bit, i7, GTX680, 16GB, Benq 120hz
In Castlevania Lords of Shadow, there is one thing that reduces my enjoyment, and it's the forced motion blur. So I thought: "This should be easy now that I know how to disable vertex and pixel shaders with the helixmod wrapper!".
However, the pixel shader that controls motion blur is also linked to part of the brightness in the game. Just disabling the pixel shader makes the image darker, and I haven't found a constant that affects only motion blur. I tried creating a constant (c200) with values "0, 0, 0, 0", but trying it around the shader didn't work (it either did nothing, or made the image totally black or white, or did the same as disabling the shader completely).
I've also found this problem in FFX (Besaid island beach) and Persona 4 (using the DX11 renderer).
Here is the code of the pixel shader (69C39902.txt), in case someone wants to look at it and is interested in disabling motion blur too:
The vertex shader (4E4FAB8D.txt) is:
CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: MSI GeForce RTX 2080Ti Gaming X Trio
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com
http://helixmod.blogspot.com.es/2016/07/totalwar-warhammer.html
i can not believe yet, imposible to fix the default profile, inverse strategy with stereoflagdx10 and...
unsteriorized shadows and .... i think that was in mono too as the particles but...
a lots thanks bobs dhr helifax
Windows 7 64bit, i7, GTX680, 16GB, Benq 120hz
I converted all your images to 3dvisionlive. Please either use 3dvisionlive or a different image host. 3500 views a day + 2MB of images per post = 7gb of file transfer each post per day.
If you dont want to use 3dvision live just change from jps -> to jpg and upload to any image service.
I am more then happy to host fixes + necessary files but stereoscopic images bring costs WAY up.
Co-founder/Web host of helixmod.blog.com
Donations for web hosting @ paypal -eqzitara@yahoo.com
or
https://www.patreon.com/user?u=791918
Oh... I should do the same with my Shadow Complex post. Or at least the trick I did with FFX (uploading an image to the post (which converts is to a small image), and changing the link inside the thumbnail to the corresponding cubeupload image, so it redirects to the big image).
CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: MSI GeForce RTX 2080Ti Gaming X Trio
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com