Bo3b's School For Shaderhackers
  54 / 87    
I'm using the newest 32-bit debug DLL (March 2, 2014). Also, GameOverlayRenderer should be in the Steam directory.
I'm using the newest 32-bit debug DLL (March 2, 2014). Also, GameOverlayRenderer should be in the Steam directory.

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

Posted 02/27/2016 02:53 PM   
Ok this is weird. I don't think i am doing anything wrong. I even tried it in another game and I got the shaderhunting text in game. *edit* Ok some reason I had to get rid of those files regardless for this game for it to hook in right. Is there anything you can do if a game doesn't even create a log? Thanks
Ok this is weird. I don't think i am doing anything wrong. I even tried it in another game and I got the shaderhunting text in game.

*edit*

Ok some reason I had to get rid of those files regardless for this game for it to hook in right.

Is there anything you can do if a game doesn't even create a log?

Thanks

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

Posted 02/28/2016 01:05 AM   
I'm almost done with the Van Helsing Final Cut fix (DX11). I am a few hours into the second part of the game and I haven't found a new shader to fix so far, so I'll release the fix and keep playing. If I find something new, I'll update the fix. I know there is already a DX9 fix, but I wanted to do this for a few reasons: for fun, because I saw that it has some extra graphical effects and for easy HUD depth control. So far, I have only had 3 problems: 1- The most important one is the one I described here (I won't copy andpaste to not make a huge post): https://forums.geforce.com/default/topic/544828/3d-vision/van-helsing/post/4809031/#4809031 2- Water shaders (2 vertex shaders, 2 pixel shaders) have a texture as a reflection background (so far I've seen two different ones: clouds and sky, and indoors reflection), which was covering the water at surface depth before I fixed the texcoord I needed to fix for the water in general. After applying the fix, water has correct position and refraction, and 3D reflections are correct too. But the texture is now at screen depth, and it's annoying. What can be the best approach after that? I did a frame analysis to dump the texture of one of the pixel shaders (6aa2fd2aab228272-ps_replace.txt, its vertex shader is 262152733f61426b-vs_replace.txt. The other water VS is 31b2c31d9db3e5d9-vs_replace.txt) and I got 3 textures. The names are "ps-t7-001204=aa511f93-vs=262152733f61426b-ps=6aa2fd2aab228272.dds", "ps-t7-001205=aa511f93-vs=262152733f61426b-ps=6aa2fd2aab228272.dds" and "ps-t7-001206=aa511f93-vs=262152733f61426b-ps=6aa2fd2aab228272.dds". You can download them here if you want: https://www.dropbox.com/s/ovug9um09pgkafw/VanHelsing_waterreflectiontextures.7z?dl=0 What should I do? Texture filtering to not apply the fix to the textures or to give them 100% depth? I know I have asked it in the past, but I still don't know how to do it. I know the "d3dx.ini" part, but I don't know what condition I have to write in the shader. By the way, I tried this but it didn't work: [code][TextureOverride1] Hash = aa511f93 deny_cpu_read=1[/code] Screenshots of the water with two convergence settings (look at the annoying cloud at the left): [img]http://u.cubeupload.com/masterotaku/vanhelsingwaterlowde.jpg[/img] [img]http://u.cubeupload.com/masterotaku/vanhelsingwaterhighd.jpg[/img] 3- Menu bars are overflowing their limits with 3Dmigoto loaded (it isn't a problem of dumping or altering the shader), and the minimap and skills screens also don't care about their containers. You can see the map problem a bit in the previous screenshots, but it's worse in big locations. Here is the fix I have for now (hunting disabled in "d3dx.ini"): https://www.dropbox.com/s/0trjsji839beovv/VanHelsingFinalCut_pre_fix.7z?dl=0 Hotkeys: - F1: HUD depth cycle. - F2: convergence 0 (for testing). - F3: convergence 1 (for testing). - F4: normal convergence setting. - F5: high convergence setting. - F6: toggle off/on the HUD (default: on). - F7: toggle on/off the lighting shader that is giving me problems (default: off); I recommend using the F4 preset with high HUD depth or F5 preset with HUD at screen depth. Any help will be greatly appreciated :).
I'm almost done with the Van Helsing Final Cut fix (DX11). I am a few hours into the second part of the game and I haven't found a new shader to fix so far, so I'll release the fix and keep playing. If I find something new, I'll update the fix.

I know there is already a DX9 fix, but I wanted to do this for a few reasons: for fun, because I saw that it has some extra graphical effects and for easy HUD depth control.

So far, I have only had 3 problems:

1- The most important one is the one I described here (I won't copy andpaste to not make a huge post): https://forums.geforce.com/default/topic/544828/3d-vision/van-helsing/post/4809031/#4809031

2- Water shaders (2 vertex shaders, 2 pixel shaders) have a texture as a reflection background (so far I've seen two different ones: clouds and sky, and indoors reflection), which was covering the water at surface depth before I fixed the texcoord I needed to fix for the water in general.

After applying the fix, water has correct position and refraction, and 3D reflections are correct too. But the texture is now at screen depth, and it's annoying. What can be the best approach after that?

I did a frame analysis to dump the texture of one of the pixel shaders (6aa2fd2aab228272-ps_replace.txt, its vertex shader is 262152733f61426b-vs_replace.txt. The other water VS is 31b2c31d9db3e5d9-vs_replace.txt) and I got 3 textures. The names are "ps-t7-001204=aa511f93-vs=262152733f61426b-ps=6aa2fd2aab228272.dds", "ps-t7-001205=aa511f93-vs=262152733f61426b-ps=6aa2fd2aab228272.dds" and "ps-t7-001206=aa511f93-vs=262152733f61426b-ps=6aa2fd2aab228272.dds". You can download them here if you want: https://www.dropbox.com/s/ovug9um09pgkafw/VanHelsing_waterreflectiontextures.7z?dl=0

What should I do? Texture filtering to not apply the fix to the textures or to give them 100% depth? I know I have asked it in the past, but I still don't know how to do it. I know the "d3dx.ini" part, but I don't know what condition I have to write in the shader.

By the way, I tried this but it didn't work:

[TextureOverride1]
Hash = aa511f93
deny_cpu_read=1


Screenshots of the water with two convergence settings (look at the annoying cloud at the left):

Image

Image


3- Menu bars are overflowing their limits with 3Dmigoto loaded (it isn't a problem of dumping or altering the shader), and the minimap and skills screens also don't care about their containers. You can see the map problem a bit in the previous screenshots, but it's worse in big locations.


Here is the fix I have for now (hunting disabled in "d3dx.ini"): https://www.dropbox.com/s/0trjsji839beovv/VanHelsingFinalCut_pre_fix.7z?dl=0

Hotkeys:

- F1: HUD depth cycle.
- F2: convergence 0 (for testing).
- F3: convergence 1 (for testing).
- F4: normal convergence setting.
- F5: high convergence setting.
- F6: toggle off/on the HUD (default: on).
- F7: toggle on/off the lighting shader that is giving me problems (default: off);

I recommend using the F4 preset with high HUD depth or F5 preset with HUD at screen depth.

Any help will be greatly appreciated :).

CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: Gainward Phoenix 1080 GLH
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com

Posted 02/28/2016 06:36 PM   
[quote="masterotaku"]1- The most important one is the one I described here (I won't copy andpaste to not make a huge post): https://forums.geforce.com/default/topic/544828/3d-vision/van-helsing/post/4809031/#4809031[/quote]Answered in the original thread. [quote]2- Water shaders (2 vertex shaders, 2 pixel shaders) have a texture as a reflection background (so far I've seen two different ones: clouds and sky, and indoors reflection), which was covering the water at surface depth before I fixed the texcoord I needed to fix for the water in general. After applying the fix, water has correct position and refraction, and 3D reflections are correct too. But the texture is now at screen depth, and it's annoying. What can be the best approach after that?[/quote]You will likely need to make two copies of whatever coordinate you adjusted - one corrected, one uncorrected. Then experiment with using each everywhere they are used in the shader to see if you can find a combination that fixes the broken effects, and leaves the working ones alone. If you did the correction in the vertex shader you may need to pass the extra output through to the pixel shader. If the shader is sufficiently complex you may also need to duplicate any code that modifies the original coordinate as well. [quote]What should I do? Texture filtering to not apply the fix to the textures or to give them 100% depth?[/quote]No, you wouldn't use texture filtering for this - a single pass of the shader would draw all the effects at once, whereas texture filtering is more for separating out HUD elements drawn in separate passes. [quote]I know the "d3dx.ini" part, but I don't know what condition I have to write in the shader.[/quote]It just goes in IniParams, so something like IniParams.Load(0).x depending on which one you chose. [quote]By the way, I tried this but it didn't work: [code][TextureOverride1] Hash = aa511f93 deny_cpu_read=1[/code] [/quote]Hmmm, is the comment in the d3dx.ini misleading? I can't think of any reason you would be trying to prevent the CPU reading a texture here since this isn't an occlusion buffer... [quote]3- Menu bars are overflowing their limits with 3Dmigoto loaded (it isn't a problem of dumping or altering the shader), and the minimap and skills screens also don't care about their containers. You can see the map problem a bit in the previous screenshots, but it's worse in big locations.[/quote]This sounds like a problem caused by disabling scissor clipping, which we made the default at some point when it seemed to be harmless. You can enable it again with: [code] rasterizer_disable_scissor=0 [/code] But you may then run into clipping issues if you try to adjust the depth of those HUD elements. I've considered an alternative approach that I could probably add to 3DMigoto if necessary - I could pass the bounds of the scissor rectangle into the pixel shader then you could apply the clipping yourself with the discard instruction and have the ability to adjust it as necessary.
masterotaku said:1- The most important one is the one I described here (I won't copy andpaste to not make a huge post): https://forums.geforce.com/default/topic/544828/3d-vision/van-helsing/post/4809031/#4809031
Answered in the original thread.

2- Water shaders (2 vertex shaders, 2 pixel shaders) have a texture as a reflection background (so far I've seen two different ones: clouds and sky, and indoors reflection), which was covering the water at surface depth before I fixed the texcoord I needed to fix for the water in general.

After applying the fix, water has correct position and refraction, and 3D reflections are correct too. But the texture is now at screen depth, and it's annoying. What can be the best approach after that?
You will likely need to make two copies of whatever coordinate you adjusted - one corrected, one uncorrected. Then experiment with using each everywhere they are used in the shader to see if you can find a combination that fixes the broken effects, and leaves the working ones alone. If you did the correction in the vertex shader you may need to pass the extra output through to the pixel shader. If the shader is sufficiently complex you may also need to duplicate any code that modifies the original coordinate as well.

What should I do? Texture filtering to not apply the fix to the textures or to give them 100% depth?
No, you wouldn't use texture filtering for this - a single pass of the shader would draw all the effects at once, whereas texture filtering is more for separating out HUD elements drawn in separate passes.

I know the "d3dx.ini" part, but I don't know what condition I have to write in the shader.
It just goes in IniParams, so something like IniParams.Load(0).x depending on which one you chose.

By the way, I tried this but it didn't work:

[TextureOverride1]
Hash = aa511f93
deny_cpu_read=1

Hmmm, is the comment in the d3dx.ini misleading? I can't think of any reason you would be trying to prevent the CPU reading a texture here since this isn't an occlusion buffer...

3- Menu bars are overflowing their limits with 3Dmigoto loaded (it isn't a problem of dumping or altering the shader), and the minimap and skills screens also don't care about their containers. You can see the map problem a bit in the previous screenshots, but it's worse in big locations.
This sounds like a problem caused by disabling scissor clipping, which we made the default at some point when it seemed to be harmless. You can enable it again with:

rasterizer_disable_scissor=0


But you may then run into clipping issues if you try to adjust the depth of those HUD elements. I've considered an alternative approach that I could probably add to 3DMigoto if necessary - I could pass the bounds of the scissor rectangle into the pixel shader then you could apply the clipping yourself with the discard instruction and have the ability to adjust it as necessary.

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 03/01/2016 01:43 AM   
I've run into a bit of a challenge with XCom 2. Most of the lighting is all handled by a single compute shader. Finding the spot to correct, and fixing the stereo position was easy, but the spotlights all get clipped on the sides at a distance (can provide screenshot if necessary). My past experience of working with lighting in a standard PS/VS setup has taught me that this would involve a fix in the VS, however that certainly doesn't apply here with it being a CS, so I'm at a bit of a loss after trying a few different fix variations. 2 things will probably come as no surprise: 1) The shader is extremely long and complex 2) There were HLSL decompiler issues, so I've been having to work with the ASM code Here's the ASM of the shader that I've got so far (let me know if you want to see the broken HLSL for whatever reason): [code]// Lighting CS-FIXED (but clips) // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // using 3Dmigoto v1.2.31 on Thu Feb 25 21:58:55 2016 // // // Buffer Definitions: // // cbuffer $Globals // { // // float4x4 ScreenToWorldMatrix; // Offset: 0 Size: 64 // float4 SpherePositionRadius; // Offset: 64 Size: 16 [unused] // bool bDecompressSceneColor; // Offset: 80 Size: 4 [unused] // float4 LightColorAndFalloffExponent;// Offset: 96 Size: 16 [unused] // float3 DistanceFieldParameters; // Offset: 112 Size: 12 [unused] // float4x4 ScreenToShadowMatrix; // Offset: 128 Size: 64 [unused] // float4 ShadowBufferAndTexelSize; // Offset: 192 Size: 16 [unused] // float ShadowOverrideFactor; // Offset: 208 Size: 4 [unused] // bool bReceiveDynamicShadows; // Offset: 212 Size: 4 [unused] // bool bEnableDistanceShadowFading; // Offset: 216 Size: 4 [unused] // float2 DistanceFadeParameters; // Offset: 224 Size: 8 [unused] // float4 DeferredRenderingParameters;// Offset: 240 Size: 16 [unused] // float4 UVScaleBias; // Offset: 256 Size: 16 [unused] // int MinZ; // Offset: 272 Size: 4 [unused] // float4 ClearColor; // Offset: 288 Size: 16 [unused] // float4 LevelVolumeDimensions; // Offset: 304 Size: 16 // float4 LevelVolumePosition; // Offset: 320 Size: 16 // float4 VoxelSizeUVW; // Offset: 336 Size: 16 [unused] // float4 VoxelSizeXYZ; // Offset: 352 Size: 16 // uint LightID; // Offset: 368 Size: 4 [unused] // // struct LightData // { // // float3 WorldPosition; // Offset: 384 // float InvRadius; // Offset: 396 // float3 Color; // Offset: 400 // float FallOffExponent; // Offset: 412 // float3 Direction; // Offset: 416 // float SourceLength; // Offset: 428 // float2 SpotAngles; // Offset: 432 // float2 MinShadowOpacity; // Offset: 440 // float SourceRadius; // Offset: 448 // float MinRoughness; // Offset: 452 // float CharacterLight; // Offset: 456 // float InvSquaredFalloff; // Offset: 460 // uint LightID; // Offset: 464 // float3 Padding; // Offset: 468 // // } LightProperties; // Offset: 384 Size: 96 [unused] // float LightingOptions; // Offset: 480 Size: 4 [unused] // uint4 ViewDimensions; // Offset: 496 Size: 16 // float2 BufferDimensions; // Offset: 512 Size: 8 // float4x4 ProjMatrix; // Offset: 528 Size: 64 // float4x4 ViewMatrix; // Offset: 592 Size: 64 [unused] // float4 MinZ_MaxZRatioCB; // Offset: 656 Size: 16 // float3 CameraPositionCB; // Offset: 672 Size: 12 // uint NumLights; // Offset: 684 Size: 4 // // } // // cbuffer TileDeferredLightBase // { // // struct LightDataBase // { // // float3 ViewPosition; // Offset: 0 // float Radius; // Offset: 12 // // } LightBufferBase[682]; // Offset: 0 Size: 10912 // // } // // cbuffer TileDeferredLight // { // // struct LightData // { // // float3 WorldPosition; // Offset: 0 // float InvRadius; // Offset: 12 // float3 Color; // Offset: 16 // float FallOffExponent; // Offset: 28 // float3 Direction; // Offset: 32 // float SourceLength; // Offset: 44 // float2 SpotAngles; // Offset: 48 // float2 MinShadowOpacity; // Offset: 56 // float SourceRadius; // Offset: 64 // float MinRoughness; // Offset: 68 // float CharacterLight; // Offset: 72 // float InvSquaredFalloff; // Offset: 76 // uint LightID; // Offset: 80 // float3 Padding; // Offset: 84 // // } LightBuffer[682]; // Offset: 0 Size: 65472 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // WorldNormalGBufferTexture sampler NA NA 0 1 // SpecularGBufferTexture sampler NA NA 1 1 // DiffuseGBufferTexture sampler NA NA 2 1 // TransmissionGBufferTexture sampler NA NA 3 1 // SceneDepthTexture sampler NA NA 4 1 // LightAttenuationTexture sampler NA NA 5 1 // sSHCoeffs0 sampler NA NA 6 1 // sSHCoeffs1 sampler NA NA 7 1 // sSHCoeffs2 sampler NA NA 8 1 // PreIntegratedBRDFTexture sampler NA NA 9 1 // EmissiveGBufferTexture sampler NA NA 10 1 // WorldNormalGBufferTexture texture float4 2d 0 1 // DiffuseGBufferTexture texture float4 2d 1 1 // SceneDepthTexture texture float4 2d 2 1 // SpecularGBufferTexture texture float4 2d 3 1 // TransmissionGBufferTexture texture float4 2d 4 1 // EmissiveGBufferTexture texture float4 2d 5 1 // LightAttenuationTexture texture float4 2d 6 1 // PreIntegratedBRDFTexture texture float4 2d 7 1 // sSHCoeffs0 texture float4 3d 8 1 // sSHCoeffs1 texture float4 3d 9 1 // sSHCoeffs2 texture float4 3d 10 1 // LightVolumeClippingTexture texture uint 3d 11 1 // VisBlockingTexture texture uint 3d 12 1 // OutputBuffer UAV float4 2d 0 1 // $Globals cbuffer NA NA 0 1 // TileDeferredLightBase cbuffer NA NA 8 1 // TileDeferredLight cbuffer NA NA 9 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // no Input // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // no Output // cb12 - VPM passed using resource copying // { // float4x4 ViewProjectionMatrix; // Offset: 0 // } // cb13 - iVPM passed using resource copying // { // float4x4 InvViewProjectionMatrix; // Offset: 13 // } cs_5_0 dcl_resource_texture2d (float,float,float,float) t125 dcl_resource_texture1d (float,float,float,float) t120 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[43], immediateIndexed dcl_constantbuffer cb8[682], dynamicIndexed dcl_constantbuffer cb9[4092], dynamicIndexed dcl_sampler s0, mode_default dcl_sampler s1, mode_default dcl_sampler s2, mode_default dcl_sampler s3, mode_default dcl_sampler s4, mode_default dcl_sampler s5, mode_default dcl_sampler s6, mode_default dcl_sampler s7, mode_default dcl_sampler s8, mode_default dcl_sampler s9, mode_default dcl_sampler s10, mode_default dcl_resource_texture2d (float,float,float,float) t0 dcl_resource_texture2d (float,float,float,float) t1 dcl_resource_texture2d (float,float,float,float) t2 dcl_resource_texture2d (float,float,float,float) t3 dcl_resource_texture2d (float,float,float,float) t4 dcl_resource_texture2d (float,float,float,float) t5 dcl_resource_texture2d (float,float,float,float) t6 dcl_resource_texture2d (float,float,float,float) t7 dcl_resource_texture3d (float,float,float,float) t8 dcl_resource_texture3d (float,float,float,float) t9 dcl_resource_texture3d (float,float,float,float) t10 dcl_resource_texture3d (uint,uint,uint,uint) t11 dcl_resource_texture3d (uint,uint,uint,uint) t12 dcl_uav_typed_texture2d (float,float,float,float) u0 dcl_input vThreadGroupID.xy dcl_input vThreadIDInGroup.xy dcl_input vThreadID.xy dcl_temps 31 dcl_tgsm_raw g0, 4 dcl_tgsm_raw g1, 4 dcl_tgsm_raw g2, 4 dcl_tgsm_structured g3, 4, 682 dcl_thread_group 16, 16, 1 utof r0.xy, vThreadID.xyxx add r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000) utof r0.zw, cb0[31].xxxy rcp r1.xy, r0.zwzz mad r0.xy, r0.xyxx, r1.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000) mul r0.xy, r0.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000) iadd r1.xy, vThreadID.xyxx, cb0[31].zwzz utof r1.xy, r1.xyxx add r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000) rcp r1.zw, cb0[32].xxxy mul r1.xy, r1.zwzz, r1.xyxx sample_l_indexable(texture2d)(float,float,float,float) r2.xyzw, r1.xyxx, t0.xyzw, s0, l(0.000000) mad r2.xyz, r2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000) sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r1.xyxx, t1.xyzw, s2, l(0.000000) sample_l_indexable(texture2d)(float,float,float,float) r1.z, r1.xyxx, t2.yzxw, s4, l(0.000000) mul r1.w, r2.w, l(255.000000) round_pi r1.w, r1.w ftou r1.w, r1.w min r1.z, r1.z, l(0.999000) mad r1.z, r1.z, cb0[41].z, -cb0[41].w div r1.z, l(1.000000, 1.000000, 1.000000, 1.000000), r1.z mul r0.xy, r0.xyxx, r1.zzzz //Working fix here but clips at distance ld_indexable(texture2d)(float,float,float,float) r29.xyzw, l(0, 0, 0, 0), t125.xyzw ld_indexable(texture1d)(float,float,float,float) r30.xyzw, l(0, 0, 0, 0), t120.xyzw add r29.w, r1.z, -r29.y div r29.w, r29.w, cb0[33].x mad r0.x, -r29.w, r29.x, r0.x mul r4.xyz, r0.yyyy, cb0[1].xyzx mad r4.xyz, cb0[0].xyzx, r0.xxxx, r4.xyzx mad r4.xyz, cb0[2].xyzx, r1.zzzz, r4.xyzx add r4.xyz, r4.xyzx, cb0[3].xyzx // Attempted VPM fix here since fixing in screen space before clips. // mov r4.w, l(1) // mul r5.xyzw, r4.yyyy, cb12[1].xyzw // mad r5.xyzw, cb12[0].xyzw, r4.xxxx, r5.xyzw // mad r5.xyzw, cb12[2].xyzw, r4.zzzz, r5.xyzw // mad r5.xyzw, cb12[3].xyzw, r4.wwww, r5.xyzw // div r5.xyzw, r5.xyzw, r5.wwww // add r29.w, r5.w, -r29.y // mul r29.w, r29.w, r29.x // add r5.x, r5.x, -r29.w // mul r4.xyzw, r5.yyyy, cb13[14].xyzw // mad r4.xyzw, cb13[13].xyzw, r5.xxxx, r4.xyzw // mad r4.xyzw, cb13[15].xyzw, r5.zzzz, r4.xyzw // mad r4.xyzw, cb13[16].xyzw, r5.wwww, r4.xyzw // div r4.xyzw, r4.xyzw, r4.wwww dp3 r0.x, r2.xyzx, r2.xyzx rsq r0.x, r0.x mul r2.xyz, r0.xxxx, r2.xyzx // Attempt WorldSpace correction here. Lights go dancing all over the screen! // mov r5.xyzw, l(0,0,0,0) // add r29.w, r0.x, -r29.y // mul r5.x, r29.w, -r29.x // mul r6, r5.x, cb13[13] // mad r6, r5.y, cb13[14], r6 // mad r6, r5.z, cb13[15], r6 // mad r6, r5.w, cb13[16], r6 // add r2.xyz, r2, r6.xyz min r0.x, r1.z, l(2139095040.000000) max r0.y, r1.z, l(0.000000) imad r1.z, vThreadIDInGroup.y, l(16), vThreadIDInGroup.x if_z r1.z store_raw g0.x, l(0), r0.x store_raw g1.x, l(0), r0.y store_raw g2.x, l(0), l(0) endif sync_g_t ge r2.w, r0.y, r0.x if_nz r2.w atomic_umin g0, l(0), r0.x atomic_umax g1, l(0), r0.y endif sync_g_t ld_raw r0.x, l(0), g0.xxxx ld_raw r5.y, l(0), g1.xxxx mul r5.zw, r0.zzzw, l(0.000000, 0.000000, 0.031250, 0.031250) utof r6.xy, vThreadGroupID.xyxx mad r6.zw, r0.zzzw, l(0.000000, 0.000000, 0.031250, 0.031250), -r6.xxxy mul r6.y, r5.z, cb0[33].x mul r6.x, r5.w, -cb0[34].y add r7.xyzw, -r6.yzxw, l(0.000000, 1.000000, 0.000000, 1.000000) add r6.xyzw, r6.yzxw, l(0.000000, 1.000000, 0.000000, 1.000000) mov r0.w, -r0.x dp2 r2.w, r7.xyxx, r7.xyxx sqrt r2.w, r2.w rcp r2.w, r2.w mul r5.zw, r2.wwww, r7.xxxy dp2 r2.w, r6.xyxx, r6.xyxx sqrt r2.w, r2.w rcp r2.w, r2.w mul r6.xy, r2.wwww, r6.xyxx dp2 r2.w, r7.zwzz, r7.zwzz sqrt r2.w, r2.w rcp r2.w, r2.w mul r7.xy, r2.wwww, r7.zwzz dp2 r2.w, r6.zwzz, r6.zwzz sqrt r2.w, r2.w rcp r2.w, r2.w mul r6.zw, r2.wwww, r6.zzzw mov r2.w, r1.z loop uge r4.w, r2.w, cb0[42].w breakc_nz r4.w mov r0.x, |cb8[r2.w + 0].z| mov r0.yz, cb8[r2.w + 0].xxyx dp2 r4.w, r5.wzww, r0.xyxx ge r4.w, r4.w, -cb8[r2.w + 0].w dp2 r0.y, r6.yxyy, r0.xyxx ge r0.y, r0.y, -cb8[r2.w + 0].w and r0.y, r0.y, r4.w dp2 r4.w, r7.yxyy, r0.xzxx ge r4.w, r4.w, -cb8[r2.w + 0].w and r0.y, r0.y, r4.w dp2 r0.z, r6.wzww, r0.xzxx ge r0.z, r0.z, -cb8[r2.w + 0].w and r0.y, r0.z, r0.y dp2 r0.z, l(1.000000, 1.000000, 0.000000, 0.000000), r0.xwxx ge r0.z, r0.z, -cb8[r2.w + 0].w and r0.y, r0.z, r0.y mov r5.x, r0.x dp2 r0.x, l(-1.000000, 1.000000, 0.000000, 0.000000), r5.xyxx ge r0.x, r0.x, -cb8[r2.w + 0].w and r0.x, r0.x, r0.y if_nz r0.x imm_atomic_iadd r8.x, g2, l(0), l(1) store_structured g3.x, r8.x, l(0), r2.w endif iadd r2.w, r2.w, l(256) endloop sync_g_t ld_raw r0.x, l(0), g2.xxxx sample_l_indexable(texture2d)(float,float,float,float) r5.xyzw, r1.xyxx, t3.xyzw, s1, l(0.000000) add r5.xyzw, r5.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000) mul r6.xyzw, r5.xyzw, l(0.500000, 0.500000, 0.500000, 0.500000) sample_l_indexable(texture2d)(float,float,float,float) r7.xyzw, r1.xyxx, t4.xyzw, s3, l(0.000000) sample_l_indexable(texture2d)(float,float,float,float) r8.xyzw, r1.xyxx, t6.xyzw, s5, l(0.000000) mul r8.xyzw, r8.xyzw, r8.xyzw and r9.xyzw, r1.wwww, l(36, 8, 32, 4) mad r0.yzw, r7.xxyz, l(0.000000, 2.000000, 2.000000, 2.000000), l(0.000000, -1.000000, -1.000000, -1.000000) movc r0.yzw, r9.xxxx, r0.yyzw, r7.xxyz add r5.xyz, r4.xyzx, -cb0[42].xyzx dp3 r1.z, r5.xyzx, r5.xyzx rsq r1.z, r1.z mul r5.xyz, r1.zzzz, r5.xyzx mul r7.xyz, r3.xyzx, l(0.318309873, 0.318309873, 0.318309873, 0.000000) mad r1.z, r3.w, l(0.750000), l(0.250000) ieq r2.w, r9.y, l(0) dp3 r3.w, -r5.xyzx, r0.yzwy dp3 r4.w, r5.xyzx, r2.xyzx add r4.w, r4.w, r4.w mad r10.xyz, r2.xyzx, -r4.wwww, r5.xyzx mul r4.w, r6.w, r6.w mad r9.x, -r3.w, r3.w, l(1.000000) sqrt r9.x, r9.x dp3_sat r9.y, r2.xyzx, -r5.xyzx and r11.xy, r1.wwww, l(2, 16, 0, 0) mov_sat r1.w, r0.y mul r1.w, r1.w, r1.w mul r1.w, r1.w, r1.w div r1.w, l(2.000000), r1.w add r10.w, r1.w, l(-2.000000) mul r1.w, r1.w, l(0.500000) mul_sat r11.z, r0.z, l(50.000000) add r11.z, -r0.z, r11.z mul r11.w, r4.w, r4.w mad r5.w, r5.w, l(0.250000), l(0.500000) mul r5.w, r5.w, r5.w mul r12.x, r5.w, l(0.500000) mad r5.w, -r5.w, l(0.500000), l(1.000000) mad r12.y, r9.y, r5.w, r12.x div r12.y, l(1.000000, 1.000000, 1.000000, 1.000000), r12.y mul r12.y, r12.y, l(0.250000) mov r13.w, l(0) mov r14.w, l(0) mov r15.w, l(0) mov r16.w, l(0) mov r17.w, l(0) mov r18.w, l(0) mov r19.w, l(0) mov r20.w, l(0) mov r21.w, l(0) mov r22.y, r7.w mov r23.xyz, l(0,0,0,0) mov r12.z, l(0) loop uge r12.w, r12.z, r0.x breakc_nz r12.w ld_structured r12.w, r12.z, l(0), g3.xxxx imul null, r12.w, r12.w, l(6) if_nz cb9[r12.w + 5].x add r24.xyz, -cb0[20].xyzx, cb9[r12.w + 0].xyzx mul r25.xyz, r24.xyzx, cb0[19].xyzx mad r24.xyz, r24.xyzx, cb0[19].xyzx, l(-0.500000, -0.500000, -0.500000, 0.000000) round_ni r26.xyz, r24.xyzx ftou r14.xyz, r26.xyzx utof r26.xyz, r14.xyzx add_sat r24.xyz, r24.xyzx, -r26.xyzx round_ni r25.xyz, r25.xyzx ftou r13.xyz, r25.xyzx ld_indexable(texture3d)(uint,uint,uint,uint) r13.x, r13.xyzw, t12.xyzw and r25.xyzw, r13.xxxx, l(2, 1, 8, 4) ine r25.xyzw, r25.xyzw, l(0, 0, 0, 0) lt r27.xyz, r24.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000) and r13.yz, r25.xxzx, r27.xxyx movc r13.yz, r13.yyzy, l(0,0,0,0), r24.xxyx lt r22.zw, l(0.000000, 0.000000, 0.500000, 0.500000), r13.yyyz and r22.zw, r22.zzzw, r25.yyyw movc r25.xy, r22.zwzz, l(1.000000,1.000000,0,0), r13.yzyy and r13.xy, r13.xxxx, l(32, 16, 0, 0) ine r13.xy, r13.xyxx, l(0, 0, 0, 0) and r13.x, r27.z, r13.x movc r13.x, r13.x, l(0), r24.z lt r13.z, l(0.500000), r13.x and r13.y, r13.z, r13.y movc r25.z, r13.y, l(1.000000), r13.x add r13.xyz, -r25.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000) ld_indexable(texture3d)(uint,uint,uint,uint) r14.x, r14.xyzw, t11.xyzw and r14.x, r14.x, cb9[r12.w + 5].x add r24.xyz, r26.xyzx, l(1.000000, 0.000000, 0.000000, 0.000000) ftou r15.xyz, r24.xyzx ld_indexable(texture3d)(uint,uint,uint,uint) r14.y, r15.xyzw, t11.yxzw and r14.y, r14.y, cb9[r12.w + 5].x add r15.xyz, r26.xyzx, l(1.000000, 1.000000, 0.000000, 0.000000) ftou r16.xyz, r15.xyzx ld_indexable(texture3d)(uint,uint,uint,uint) r14.z, r16.xyzw, t11.yzxw and r14.z, r14.z, cb9[r12.w + 5].x add r15.xyz, r26.xyzx, l(0.000000, 1.000000, 0.000000, 0.000000) ftou r17.xyz, r15.xyzx ld_indexable(texture3d)(uint,uint,uint,uint) r15.x, r17.xyzw, t11.xyzw and r15.x, r15.x, cb9[r12.w + 5].x add r16.xyz, r26.xyzx, l(0.000000, 0.000000, 1.000000, 0.000000) ftou r18.xyz, r16.xyzx ld_indexable(texture3d)(uint,uint,uint,uint) r15.y, r18.xyzw, t11.yxzw and r15.y, r15.y, cb9[r12.w + 5].x add r16.xyz, r26.xyzx, l(1.000000, 0.000000, 1.000000, 0.000000) ftou r19.xyz, r16.xyzx ld_indexable(texture3d)(uint,uint,uint,uint) r15.z, r19.xyzw, t11.yzxw and r15.z, r15.z, cb9[r12.w + 5].x add r16.xyz, r26.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000) ftou r20.xyz, r16.xyzx ld_indexable(texture3d)(uint,uint,uint,uint) r16.x, r20.xyzw, t11.xyzw and r16.x, r16.x, cb9[r12.w + 5].x add r17.xyz, r26.xyzx, l(0.000000, 1.000000, 1.000000, 0.000000) ftou r21.xyz, r17.xyzx ld_indexable(texture3d)(uint,uint,uint,uint) r16.y, r21.xyzw, t11.yxzw and r16.y, r16.y, cb9[r12.w + 5].x movc r14.x, r14.x, r13.x, l(0) movc r14.yz, r14.yyzy, r25.xxxx, l(0,0,0,0) add r14.x, r14.y, r14.x movc r14.y, r15.x, r13.x, l(0) add r14.y, r14.z, r14.y mul r14.y, r25.y, r14.y mad r14.x, r14.x, r13.y, r14.y movc r14.y, r15.y, r13.x, l(0) movc r14.z, r15.z, r25.x, l(0) add r14.y, r14.z, r14.y movc r13.x, r16.y, r13.x, l(0) movc r14.z, r16.x, r25.x, l(0) add r13.x, r13.x, r14.z mul r13.x, r25.y, r13.x mad r13.x, r14.y, r13.y, r13.x mul r13.x, r25.z, r13.x mad r13.x, r14.x, r13.z, r13.x log r13.x, r13.x mul r13.x, r13.x, l(2.500000) exp r13.x, r13.x else mov r13.x, l(1.000000) endif lt r13.y, l(0.000000), cb9[r12.w + 4].z and r13.y, r2.w, r13.y lt r13.z, l(0.000000), cb9[r12.w + 0].w if_nz r13.z add r14.xyz, -r4.xyzx, cb9[r12.w + 0].xyzx dp3 r13.z, r14.xyzx, r14.xyzx rsq r15.x, r13.z mul r15.xyz, r14.xyzx, r15.xxxx sqrt r16.x, r13.z lt r16.y, l(0.000000), cb9[r12.w + 4].w lt r16.z, l(0.000000), cb9[r12.w + 2].w mul r17.xyz, l(-0.500000, -0.500000, -0.500000, 0.000000), cb9[r12.w + 2].xyzx mad r18.xyz, -r17.xyzx, cb9[r12.w + 2].wwww, r14.xyzx mad r17.xyz, r17.xyzx, cb9[r12.w + 2].wwww, r14.xyzx dp3 r19.x, r18.xyzx, r18.xyzx dp3 r19.y, r17.xyzx, r17.xyzx sqrt r19.xy, r19.xyxx dp3 r19.z, r18.xyzx, r17.xyzx mad r19.z, r19.x, r19.y, r19.z add r19.z, r19.z, l(0.000100) div r19.z, l(2.000000), r19.z mul r20.y, r19.z, l(32000.000000) dp3 r18.x, r2.xyzx, r18.xyzx div r18.x, r18.x, r19.x dp3 r17.x, r2.xyzx, r17.xyzx div r17.x, r17.x, r19.y add r17.x, r17.x, r18.x mul_sat r20.x, r17.x, l(0.500000) add r13.z, r13.z, l(1.000000) div r13.z, l(1.000000, 1.000000, 1.000000, 1.000000), r13.z mul r17.y, r13.z, l(32000.000000) dp3 r17.x, r2.xyzx, r15.xyzx movc r18.xy, r16.zzzz, r20.xyxx, r17.xyxx mul r13.z, r16.x, cb9[r12.w + 0].w mul r13.z, r13.z, r13.z mad r13.z, -r13.z, r13.z, l(1.000000) max r13.z, r13.z, l(0.000000) mul r13.z, r13.z, r13.z mul r18.z, r13.z, r18.y mul r19.xyz, r14.xyzx, cb9[r12.w + 0].wwww dp3 r13.z, r19.xyzx, r19.xyzx min r13.z, r13.z, l(1.000000) add r13.z, -r13.z, l(1.000000) log r13.z, r13.z mul r13.z, r13.z, cb9[r12.w + 1].w exp r17.z, r13.z movc r16.xy, r16.yyyy, r18.xzxx, r17.xzxx dp3 r13.z, r15.xyzx, cb9[r12.w + 2].xyzx add r13.z, r13.z, -cb9[r12.w + 3].x mul_sat r13.z, r13.z, cb9[r12.w + 3].y mul r13.z, r13.z, r13.z else dp3 r16.x, r2.xyzx, cb9[r12.w + 2].xyzx mov r14.xyz, cb9[r12.w + 2].xyzx mov r16.y, l(1.000000) mov r13.z, l(1.000000) endif lt r15.x, l(0.000000), r16.y lt r15.y, l(0.000000), r13.z and r15.x, r15.y, r15.x ieq r13.y, r13.y, l(0) and r13.y, r13.y, r15.x if_nz r13.y eq r13.y, cb9[r12.w + 0].w, l(0.000000) movc r24.xyzw, r13.yyyy, r8.xyzw, l(1.000000,1.000000,1.000000,1.000000) mul r24.w, r13.x, r24.w mul r25.xyzw, r1.zzzz, r24.xyzw mad_sat r13.x, r1.z, r24.w, -cb9[r12.w + 3].z mul r13.x, r13.x, cb9[r12.w + 3].w mul r15.xyz, r6.xyzx, r13.xxxx lt r13.y, l(0.000000), cb9[r12.w + 4].x if_nz r13.y lt r13.y, l(0.000000), cb9[r12.w + 2].w if_nz r13.y dp3 r13.y, -cb9[r12.w + 2].xyzx, -cb9[r12.w + 2].xyzx rsq r13.y, r13.y mul r17.xyz, r13.yyyy, -cb9[r12.w + 2].xyzx mul r18.xyz, r17.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000) mad r18.xyz, -r18.xyzx, cb9[r12.w + 2].wwww, r14.xyzx mul r17.xyz, r17.xyzx, cb9[r12.w + 2].wwww dp3 r13.y, r10.xyzx, r17.xyzx mad r19.xyz, r13.yyyy, r10.xyzx, -r17.xyzx dp3 r16.z, r18.xyzx, r19.xyzx mul r13.y, r13.y, r13.y mad r13.y, cb9[r12.w + 2].w, cb9[r12.w + 2].w, -r13.y div_sat r13.y, r16.z, r13.y mad r17.xyz, r13.yyyy, r17.xyzx, r18.xyzx dp3 r13.y, r17.xyzx, r10.xyzx mad r18.xyz, r13.yyyy, r10.xyzx, -r17.xyzx dp3 r13.y, r18.xyzx, r18.xyzx sqrt r13.y, r13.y div_sat r13.y, cb9[r12.w + 4].x, r13.y mad r17.xyz, r18.xyzx, r13.yyyy, r17.xyzx dp3 r13.y, r17.xyzx, r17.xyzx sqrt r13.y, r13.y div r13.y, l(1.000000, 1.000000, 1.000000, 1.000000), r13.y mul r16.z, r13.y, cb9[r12.w + 2].w mul r16.z, r16.z, l(1.57079637) mad r18.x, cb9[r12.w + 2].w, r13.y, l(1.000000) div r16.z, r16.z, r18.x mul r18.x, r13.y, cb9[r12.w + 4].x mul r18.x, r18.x, l(1.57079637) mad r13.y, cb9[r12.w + 4].x, r13.y, l(1.000000) div r13.y, r18.x, r13.y mad r16.z, r16.z, l(0.333330), r4.w sqrt r16.z, r16.z min r16.z, r16.z, l(1.000000) div r16.z, r6.w, r16.z mul r16.z, r16.z, r16.z mad r13.y, r13.y, l(0.333330), r4.w sqrt r13.y, r13.y min r13.y, r13.y, l(1.000000) div r13.y, r6.w, r13.y mul r13.y, r13.y, r13.y mul r13.y, r13.y, r13.y mul r13.y, r13.y, r16.z else dp3 r16.z, r14.xyzx, r10.xyzx mad r18.xyz, r16.zzzz, r10.xyzx, -r14.xyzx dp3 r16.z, r18.xyzx, r18.xyzx sqrt r16.z, r16.z div_sat r16.z, cb9[r12.w + 4].x, r16.z mad r17.xyz, r18.xyzx, r16.zzzz, r14.xyzx dp3 r16.z, r17.xyzx, r17.xyzx sqrt r16.z, r16.z div r16.z, cb9[r12.w + 4].x, r16.z mul r18.x, r16.z, l(1.57079637) add r16.z, r16.z, l(1.000000) div r16.z, r18.x, r16.z mad r16.z, r16.z, l(0.333330), r4.w sqrt r16.z, r16.z min r16.z, r16.z, l(1.000000) div r16.z, r6.w, r16.z mul r16.z, r16.z, r16.z mul r13.y, r16.z, r16.z endif mov r16.z, r6.w else add r18.x, l(1.000000), -cb9[r12.w + 4].y mad r16.z, r6.w, r18.x, cb9[r12.w + 4].y mov r17.xyz, r14.xyzx mov r13.y, l(1.000000) endif dp3 r18.x, r17.xyzx, r17.xyzx rsq r18.x, r18.x mul r19.xyz, r17.xyzx, r18.xxxx if_nz r9.z dp3 r18.y, r19.xyzx, r0.yzwy mad r18.z, -r18.y, r18.y, l(1.000000) sqrt r18.z, r18.z mul r18.y, r3.w, r18.y mad_sat r18.y, r18.z, r9.x, -r18.y mul r18.z, r16.z, r16.z mul r18.z, r18.z, r18.z div r18.z, l(1.000000, 1.000000, 1.000000, 1.000000), r18.z lt r20.x, r18.y, l(0.000001) log r18.y, r18.y mul r18.y, r18.y, r18.z exp r18.y, r18.y movc r18.y, r20.x, l(0), r18.y mul r20.xyz, r15.xyzx, r18.yyyy mul r20.xyz, r13.yyyy, r20.xyzx else mad r17.xyz, r17.xyzx, r18.xxxx, -r5.xyzx dp3 r18.x, r17.xyzx, r17.xyzx rsq r18.x, r18.x mul r17.xyz, r17.xyzx, r18.xxxx dp3_sat r18.x, r2.xyzx, r19.xyzx dp3_sat r18.y, r2.xyzx, r17.xyzx dp3_sat r17.x, -r5.xyzx, r17.xyzx mul r17.y, r16.z, r16.z mul r17.y, r17.y, r17.y mad r17.z, r18.y, r17.y, -r18.y mad r17.z, r17.z, r18.y, l(1.000000) mul r17.z, r17.z, r17.z div r17.y, r17.y, r17.z mul r17.y, r17.y, l(0.318309873) mad r16.z, r16.z, l(0.500000), l(0.500000) mul r16.z, r16.z, r16.z mul r17.z, r16.z, l(0.500000) mad r16.z, -r16.z, l(0.500000), l(1.000000) mad r18.y, r9.y, r16.z, r17.z div r18.y, l(1.000000, 1.000000, 1.000000, 1.000000), r18.y mad r16.z, r18.x, r16.z, r17.z div r16.z, l(1.000000, 1.000000, 1.000000, 1.000000), r16.z mul r16.z, r18.y, r16.z mul r16.z, r17.y, r16.z mul_sat r17.y, r15.y, l(50.000000) mad r18.xyz, -r6.xyzx, r13.xxxx, r17.yyyy mad r17.y, r17.x, l(-5.554730), l(-6.983160) mul r17.x, r17.x, r17.y exp r17.x, r17.x mad r17.xyz, r18.xyzx, r17.xxxx, r15.xyzx mul r16.z, r16.z, l(0.250000) mul r17.xyz, r17.xyzx, r16.zzzz mul_sat r20.xyz, r13.yyyy, r17.xyzx endif if_nz r9.w mad_sat r22.x, r16.x, l(0.500000), l(0.500000) sample_l_indexable(texture2d)(float,float,float,float) r17.xyz, r22.xyxx, t7.xyzw, s9, l(0.000000) mov_sat r16.x, r16.x mul r18.xyz, r20.xyzx, r16.xxxx mad r17.xyz, r17.xyzx, r7.xyzx, r18.xyzx else if_nz r11.x dp3 r13.y, r14.xyzx, r14.xyzx rsq r13.y, r13.y mul r18.xyz, r13.yyyy, r14.xyzx mad r14.xyz, r14.xyzx, r13.yyyy, -r5.xyzx dp3 r13.y, r14.xyzx, r14.xyzx rsq r13.y, r13.y mul r14.xyz, r13.yyyy, r14.xyzx dp3_sat r13.y, r2.xyzx, r18.xyzx dp3_sat r16.z, r2.xyzx, r14.xyzx dp3_sat r14.x, -r5.xyzx, r14.xyzx lt r14.y, r16.z, l(0.000001) log r14.z, r16.z mul r14.z, r10.w, r14.z exp r14.z, r14.z movc r14.y, r14.y, l(0), r14.z mul r14.y, r1.w, r14.y dp3 r14.z, r18.xyzx, -r5.xyzx mad r14.z, r14.z, l(2.000000), l(2.000000) div r14.z, l(1.000000, 1.000000, 1.000000, 1.000000), r14.z mad r18.x, r14.x, l(-5.554730), l(-6.983160) mul r14.x, r14.x, r18.x exp r14.x, r14.x mad r18.x, r11.z, r14.x, r0.z mul r14.y, r14.z, r14.y mul_sat r14.y, r18.x, r14.y mad r14.z, r16.z, r11.w, -r16.z mad r14.z, r14.z, r16.z, l(1.000000) mul r14.z, r14.z, r14.z div r14.z, r11.w, r14.z mad r13.y, r13.y, r5.w, r12.x div r13.y, l(1.000000, 1.000000, 1.000000, 1.000000), r13.y mul r13.y, r12.y, r13.y mul_sat r16.z, r15.y, l(50.000000) mad r19.xyz, -r6.xyzx, r13.xxxx, r16.zzzz mad r15.xyz, r19.xyzx, r14.xxxx, r15.xyzx mul r13.x, r13.y, r14.z mul_sat r15.xyz, r15.xyzx, r13.xxxx mad r15.xyz, r3.xyzx, l(0.318309873, 0.318309873, 0.318309873, 0.000000), r15.xyzx add r13.x, -r18.x, l(1.000000) mad r17.xyz, r15.xyzx, r13.xxxx, r14.yyyy else mov_sat r16.x, r16.x mad r13.x, r16.x, -r7.w, r7.w add r13.y, -r13.x, l(1.000000) mad r14.xyz, r7.xyzx, r13.yyyy, r20.xyzx mul r15.xyz, r7.xyzx, r13.xxxx mad r17.xyz, r16.xxxx, r14.xyzx, r15.xyzx endif endif mul r14.xyz, r25.xyzx, r25.wwww mul r13.x, r13.z, r16.y mul r13.xyz, r14.xyzx, r13.xxxx mul r13.xyz, r13.xyzx, cb9[r12.w + 1].xyzx mul r13.xyz, r13.xyzx, r17.xyzx else mov r13.xyz, l(0,0,0,0) endif add r23.xyz, r13.xyzx, r23.xyzx iadd r12.z, r12.z, l(1) endloop add r0.xyz, r4.xyzx, -cb0[20].xyzx div r0.xyz, r0.xyzx, cb0[19].xyzx mul r4.xyz, r0.xyzx, cb0[22].xyzx if_z r11.y ftoi r5.xyz, r4.xyzx mov r5.w, l(0) ld_indexable(texture3d)(uint,uint,uint,uint) r0.w, r5.xyzw, t12.yzwx else mov r0.w, l(0) endif ult r1.zw, vThreadID.xxxy, cb0[31].xxxy and r1.z, r1.w, r1.z if_nz r1.z sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t5.xyzw, s10, l(0.000000) add r1.xyz, r1.xyzx, r23.xyzx round_ni r4.xyz, r4.xyzx add r4.xyz, r4.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000) div r4.xyz, r4.xyzx, cb0[22].xyzx and r5.xyzw, r0.wwww, l(2, 1, 8, 4) movc r5.xyzw, r5.xyzw, l(1.000000,1.000000,1.000000,1.000000), l(0,0,0,0) and r6.xy, r0.wwww, l(32, 16, 0, 0) movc r6.xy, r6.xyxx, l(1.000000,1.000000,0,0), l(0,0,0,0) lt r7.xyz, r0.xyzx, r4.xyzx movc r5.xy, r7.xyxx, r5.ywyy, r5.xzxx add r4.xyz, -r0.xyzx, r4.xyzx mad r5.xy, r5.xyxx, r4.xyxx, r0.xyxx movc r0.x, r7.z, r6.y, r6.x mad r5.z, r0.x, r4.z, r0.z sample_l_indexable(texture3d)(float,float,float,float) r0.xyzw, r5.xyzx, t8.xyzw, s6, l(0.000000) sample_l_indexable(texture3d)(float,float,float,float) r4.xyzw, r5.xyzx, t9.zwxy, s7, l(0.000000) sample_l_indexable(texture3d)(float,float,float,float) r5.xyzw, r5.xyzx, t10.xyzw, s8, l(0.000000) add r1.w, |r2.y|, |r2.x| lt r1.w, l(0.000000), r1.w dp2 r2.w, -r2.xyxx, -r2.xyxx rsq r2.w, r2.w mul r2.xy, r2.wwww, -r2.yxyy and r2.xy, r1.wwww, r2.xyxx mad r1.w, -r2.z, r2.z, l(1.000000) sqrt r1.w, r1.w mul r1.w, r1.w, l(0.500000) mul r2.z, r2.z, l(0.500000) mul r2.xy, r2.xyxx, r1.wwww mov r6.x, r0.w mov r6.yz, r4.zzwz mul r6.xyz, r2.xxxx, r6.xyzx mad r0.xyz, r0.xyzx, l(0.250000, 0.250000, 0.250000, 0.000000), r6.xyzx mov r4.z, r5.x mad r0.xyz, r4.xyzx, r2.zzzz, r0.xyzx mad r0.xyz, r5.yzwy, r2.yyyy, r0.xyzx max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000) mad r0.xyz, r0.xyzx, r3.xyzx, r1.xyzx mov r0.w, l(0) store_uav_typed u0.xyzw, vThreadID.xyyy, r0.xyzw endif ret // Approximately 560 instruction slots used [/code] If DSS looks at this, I'm sure he'll notice that this looks very similar in places as the CS he worked on in Batman: AK (which isn't surprising, since they're both using UE3.5). Since encountering this issue, I've studied his fix in that shader (and modified my fix code to be as identical to his as possible, but it's still the same result), but I don't see a section in this shader similar to the 2nd part where he does a second stereo correction to remove the clipping, and being the first compute shader I've worked on, pretty much everything after the correction part goes over my head... So yeah, umm, help plz?
I've run into a bit of a challenge with XCom 2.

Most of the lighting is all handled by a single compute shader. Finding the spot to correct, and fixing the stereo position was easy, but the spotlights all get clipped on the sides at a distance (can provide screenshot if necessary). My past experience of working with lighting in a standard PS/VS setup has taught me that this would involve a fix in the VS, however that certainly doesn't apply here with it being a CS, so I'm at a bit of a loss after trying a few different fix variations.

2 things will probably come as no surprise:
1) The shader is extremely long and complex
2) There were HLSL decompiler issues, so I've been having to work with the ASM code

Here's the ASM of the shader that I've got so far (let me know if you want to see the broken HLSL for whatever reason):

// Lighting CS-FIXED (but clips)
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// using 3Dmigoto v1.2.31 on Thu Feb 25 21:58:55 2016
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
// float4x4 ScreenToWorldMatrix; // Offset: 0 Size: 64
// float4 SpherePositionRadius; // Offset: 64 Size: 16 [unused]
// bool bDecompressSceneColor; // Offset: 80 Size: 4 [unused]
// float4 LightColorAndFalloffExponent;// Offset: 96 Size: 16 [unused]
// float3 DistanceFieldParameters; // Offset: 112 Size: 12 [unused]
// float4x4 ScreenToShadowMatrix; // Offset: 128 Size: 64 [unused]
// float4 ShadowBufferAndTexelSize; // Offset: 192 Size: 16 [unused]
// float ShadowOverrideFactor; // Offset: 208 Size: 4 [unused]
// bool bReceiveDynamicShadows; // Offset: 212 Size: 4 [unused]
// bool bEnableDistanceShadowFading; // Offset: 216 Size: 4 [unused]
// float2 DistanceFadeParameters; // Offset: 224 Size: 8 [unused]
// float4 DeferredRenderingParameters;// Offset: 240 Size: 16 [unused]
// float4 UVScaleBias; // Offset: 256 Size: 16 [unused]
// int MinZ; // Offset: 272 Size: 4 [unused]
// float4 ClearColor; // Offset: 288 Size: 16 [unused]
// float4 LevelVolumeDimensions; // Offset: 304 Size: 16
// float4 LevelVolumePosition; // Offset: 320 Size: 16
// float4 VoxelSizeUVW; // Offset: 336 Size: 16 [unused]
// float4 VoxelSizeXYZ; // Offset: 352 Size: 16
// uint LightID; // Offset: 368 Size: 4 [unused]
//
// struct LightData
// {
//
// float3 WorldPosition; // Offset: 384
// float InvRadius; // Offset: 396
// float3 Color; // Offset: 400
// float FallOffExponent; // Offset: 412
// float3 Direction; // Offset: 416
// float SourceLength; // Offset: 428
// float2 SpotAngles; // Offset: 432
// float2 MinShadowOpacity; // Offset: 440
// float SourceRadius; // Offset: 448
// float MinRoughness; // Offset: 452
// float CharacterLight; // Offset: 456
// float InvSquaredFalloff; // Offset: 460
// uint LightID; // Offset: 464
// float3 Padding; // Offset: 468
//
// } LightProperties; // Offset: 384 Size: 96 [unused]
// float LightingOptions; // Offset: 480 Size: 4 [unused]
// uint4 ViewDimensions; // Offset: 496 Size: 16
// float2 BufferDimensions; // Offset: 512 Size: 8
// float4x4 ProjMatrix; // Offset: 528 Size: 64
// float4x4 ViewMatrix; // Offset: 592 Size: 64 [unused]
// float4 MinZ_MaxZRatioCB; // Offset: 656 Size: 16
// float3 CameraPositionCB; // Offset: 672 Size: 12
// uint NumLights; // Offset: 684 Size: 4
//
// }
//
// cbuffer TileDeferredLightBase
// {
//
// struct LightDataBase
// {
//
// float3 ViewPosition; // Offset: 0
// float Radius; // Offset: 12
//
// } LightBufferBase[682]; // Offset: 0 Size: 10912
//
// }
//
// cbuffer TileDeferredLight
// {
//
// struct LightData
// {
//
// float3 WorldPosition; // Offset: 0
// float InvRadius; // Offset: 12
// float3 Color; // Offset: 16
// float FallOffExponent; // Offset: 28
// float3 Direction; // Offset: 32
// float SourceLength; // Offset: 44
// float2 SpotAngles; // Offset: 48
// float2 MinShadowOpacity; // Offset: 56
// float SourceRadius; // Offset: 64
// float MinRoughness; // Offset: 68
// float CharacterLight; // Offset: 72
// float InvSquaredFalloff; // Offset: 76
// uint LightID; // Offset: 80
// float3 Padding; // Offset: 84
//
// } LightBuffer[682]; // Offset: 0 Size: 65472
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// WorldNormalGBufferTexture sampler NA NA 0 1
// SpecularGBufferTexture sampler NA NA 1 1
// DiffuseGBufferTexture sampler NA NA 2 1
// TransmissionGBufferTexture sampler NA NA 3 1
// SceneDepthTexture sampler NA NA 4 1
// LightAttenuationTexture sampler NA NA 5 1
// sSHCoeffs0 sampler NA NA 6 1
// sSHCoeffs1 sampler NA NA 7 1
// sSHCoeffs2 sampler NA NA 8 1
// PreIntegratedBRDFTexture sampler NA NA 9 1
// EmissiveGBufferTexture sampler NA NA 10 1
// WorldNormalGBufferTexture texture float4 2d 0 1
// DiffuseGBufferTexture texture float4 2d 1 1
// SceneDepthTexture texture float4 2d 2 1
// SpecularGBufferTexture texture float4 2d 3 1
// TransmissionGBufferTexture texture float4 2d 4 1
// EmissiveGBufferTexture texture float4 2d 5 1
// LightAttenuationTexture texture float4 2d 6 1
// PreIntegratedBRDFTexture texture float4 2d 7 1
// sSHCoeffs0 texture float4 3d 8 1
// sSHCoeffs1 texture float4 3d 9 1
// sSHCoeffs2 texture float4 3d 10 1
// LightVolumeClippingTexture texture uint 3d 11 1
// VisBlockingTexture texture uint 3d 12 1
// OutputBuffer UAV float4 2d 0 1
// $Globals cbuffer NA NA 0 1
// TileDeferredLightBase cbuffer NA NA 8 1
// TileDeferredLight cbuffer NA NA 9 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Input
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output

// cb12 - VPM passed using resource copying
// {
// float4x4 ViewProjectionMatrix; // Offset: 0
// }

// cb13 - iVPM passed using resource copying
// {
// float4x4 InvViewProjectionMatrix; // Offset: 13
// }



cs_5_0

dcl_resource_texture2d (float,float,float,float) t125
dcl_resource_texture1d (float,float,float,float) t120

dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[43], immediateIndexed
dcl_constantbuffer cb8[682], dynamicIndexed
dcl_constantbuffer cb9[4092], dynamicIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_sampler s8, mode_default
dcl_sampler s9, mode_default
dcl_sampler s10, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture3d (float,float,float,float) t8
dcl_resource_texture3d (float,float,float,float) t9
dcl_resource_texture3d (float,float,float,float) t10
dcl_resource_texture3d (uint,uint,uint,uint) t11
dcl_resource_texture3d (uint,uint,uint,uint) t12
dcl_uav_typed_texture2d (float,float,float,float) u0
dcl_input vThreadGroupID.xy
dcl_input vThreadIDInGroup.xy
dcl_input vThreadID.xy
dcl_temps 31
dcl_tgsm_raw g0, 4
dcl_tgsm_raw g1, 4
dcl_tgsm_raw g2, 4
dcl_tgsm_structured g3, 4, 682
dcl_thread_group 16, 16, 1
utof r0.xy, vThreadID.xyxx
add r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
utof r0.zw, cb0[31].xxxy
rcp r1.xy, r0.zwzz
mad r0.xy, r0.xyxx, r1.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
mul r0.xy, r0.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000)
iadd r1.xy, vThreadID.xyxx, cb0[31].zwzz
utof r1.xy, r1.xyxx
add r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
rcp r1.zw, cb0[32].xxxy
mul r1.xy, r1.zwzz, r1.xyxx
sample_l_indexable(texture2d)(float,float,float,float) r2.xyzw, r1.xyxx, t0.xyzw, s0, l(0.000000)
mad r2.xyz, r2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r1.xyxx, t1.xyzw, s2, l(0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r1.z, r1.xyxx, t2.yzxw, s4, l(0.000000)
mul r1.w, r2.w, l(255.000000)
round_pi r1.w, r1.w
ftou r1.w, r1.w
min r1.z, r1.z, l(0.999000)
mad r1.z, r1.z, cb0[41].z, -cb0[41].w
div r1.z, l(1.000000, 1.000000, 1.000000, 1.000000), r1.z

mul r0.xy, r0.xyxx, r1.zzzz

//Working fix here but clips at distance
ld_indexable(texture2d)(float,float,float,float) r29.xyzw, l(0, 0, 0, 0), t125.xyzw
ld_indexable(texture1d)(float,float,float,float) r30.xyzw, l(0, 0, 0, 0), t120.xyzw
add r29.w, r1.z, -r29.y
div r29.w, r29.w, cb0[33].x
mad r0.x, -r29.w, r29.x, r0.x


mul r4.xyz, r0.yyyy, cb0[1].xyzx
mad r4.xyz, cb0[0].xyzx, r0.xxxx, r4.xyzx
mad r4.xyz, cb0[2].xyzx, r1.zzzz, r4.xyzx
add r4.xyz, r4.xyzx, cb0[3].xyzx

// Attempted VPM fix here since fixing in screen space before clips.
// mov r4.w, l(1)
// mul r5.xyzw, r4.yyyy, cb12[1].xyzw
// mad r5.xyzw, cb12[0].xyzw, r4.xxxx, r5.xyzw
// mad r5.xyzw, cb12[2].xyzw, r4.zzzz, r5.xyzw
// mad r5.xyzw, cb12[3].xyzw, r4.wwww, r5.xyzw
// div r5.xyzw, r5.xyzw, r5.wwww
// add r29.w, r5.w, -r29.y
// mul r29.w, r29.w, r29.x
// add r5.x, r5.x, -r29.w
// mul r4.xyzw, r5.yyyy, cb13[14].xyzw
// mad r4.xyzw, cb13[13].xyzw, r5.xxxx, r4.xyzw
// mad r4.xyzw, cb13[15].xyzw, r5.zzzz, r4.xyzw
// mad r4.xyzw, cb13[16].xyzw, r5.wwww, r4.xyzw
// div r4.xyzw, r4.xyzw, r4.wwww

dp3 r0.x, r2.xyzx, r2.xyzx
rsq r0.x, r0.x
mul r2.xyz, r0.xxxx, r2.xyzx

// Attempt WorldSpace correction here. Lights go dancing all over the screen!
// mov r5.xyzw, l(0,0,0,0)
// add r29.w, r0.x, -r29.y
// mul r5.x, r29.w, -r29.x
// mul r6, r5.x, cb13[13]
// mad r6, r5.y, cb13[14], r6
// mad r6, r5.z, cb13[15], r6
// mad r6, r5.w, cb13[16], r6
// add r2.xyz, r2, r6.xyz

min r0.x, r1.z, l(2139095040.000000)
max r0.y, r1.z, l(0.000000)
imad r1.z, vThreadIDInGroup.y, l(16), vThreadIDInGroup.x
if_z r1.z
store_raw g0.x, l(0), r0.x
store_raw g1.x, l(0), r0.y
store_raw g2.x, l(0), l(0)
endif
sync_g_t
ge r2.w, r0.y, r0.x
if_nz r2.w
atomic_umin g0, l(0), r0.x
atomic_umax g1, l(0), r0.y
endif
sync_g_t
ld_raw r0.x, l(0), g0.xxxx
ld_raw r5.y, l(0), g1.xxxx
mul r5.zw, r0.zzzw, l(0.000000, 0.000000, 0.031250, 0.031250)
utof r6.xy, vThreadGroupID.xyxx
mad r6.zw, r0.zzzw, l(0.000000, 0.000000, 0.031250, 0.031250), -r6.xxxy
mul r6.y, r5.z, cb0[33].x
mul r6.x, r5.w, -cb0[34].y
add r7.xyzw, -r6.yzxw, l(0.000000, 1.000000, 0.000000, 1.000000)
add r6.xyzw, r6.yzxw, l(0.000000, 1.000000, 0.000000, 1.000000)
mov r0.w, -r0.x
dp2 r2.w, r7.xyxx, r7.xyxx
sqrt r2.w, r2.w
rcp r2.w, r2.w
mul r5.zw, r2.wwww, r7.xxxy
dp2 r2.w, r6.xyxx, r6.xyxx
sqrt r2.w, r2.w
rcp r2.w, r2.w
mul r6.xy, r2.wwww, r6.xyxx
dp2 r2.w, r7.zwzz, r7.zwzz
sqrt r2.w, r2.w
rcp r2.w, r2.w
mul r7.xy, r2.wwww, r7.zwzz
dp2 r2.w, r6.zwzz, r6.zwzz
sqrt r2.w, r2.w
rcp r2.w, r2.w
mul r6.zw, r2.wwww, r6.zzzw
mov r2.w, r1.z
loop
uge r4.w, r2.w, cb0[42].w
breakc_nz r4.w
mov r0.x, |cb8[r2.w + 0].z|
mov r0.yz, cb8[r2.w + 0].xxyx
dp2 r4.w, r5.wzww, r0.xyxx
ge r4.w, r4.w, -cb8[r2.w + 0].w
dp2 r0.y, r6.yxyy, r0.xyxx
ge r0.y, r0.y, -cb8[r2.w + 0].w
and r0.y, r0.y, r4.w
dp2 r4.w, r7.yxyy, r0.xzxx
ge r4.w, r4.w, -cb8[r2.w + 0].w
and r0.y, r0.y, r4.w
dp2 r0.z, r6.wzww, r0.xzxx
ge r0.z, r0.z, -cb8[r2.w + 0].w
and r0.y, r0.z, r0.y
dp2 r0.z, l(1.000000, 1.000000, 0.000000, 0.000000), r0.xwxx
ge r0.z, r0.z, -cb8[r2.w + 0].w
and r0.y, r0.z, r0.y
mov r5.x, r0.x
dp2 r0.x, l(-1.000000, 1.000000, 0.000000, 0.000000), r5.xyxx
ge r0.x, r0.x, -cb8[r2.w + 0].w
and r0.x, r0.x, r0.y
if_nz r0.x
imm_atomic_iadd r8.x, g2, l(0), l(1)
store_structured g3.x, r8.x, l(0), r2.w
endif
iadd r2.w, r2.w, l(256)
endloop
sync_g_t
ld_raw r0.x, l(0), g2.xxxx
sample_l_indexable(texture2d)(float,float,float,float) r5.xyzw, r1.xyxx, t3.xyzw, s1, l(0.000000)
add r5.xyzw, r5.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
mul r6.xyzw, r5.xyzw, l(0.500000, 0.500000, 0.500000, 0.500000)
sample_l_indexable(texture2d)(float,float,float,float) r7.xyzw, r1.xyxx, t4.xyzw, s3, l(0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r8.xyzw, r1.xyxx, t6.xyzw, s5, l(0.000000)
mul r8.xyzw, r8.xyzw, r8.xyzw
and r9.xyzw, r1.wwww, l(36, 8, 32, 4)
mad r0.yzw, r7.xxyz, l(0.000000, 2.000000, 2.000000, 2.000000), l(0.000000, -1.000000, -1.000000, -1.000000)
movc r0.yzw, r9.xxxx, r0.yyzw, r7.xxyz
add r5.xyz, r4.xyzx, -cb0[42].xyzx
dp3 r1.z, r5.xyzx, r5.xyzx
rsq r1.z, r1.z
mul r5.xyz, r1.zzzz, r5.xyzx
mul r7.xyz, r3.xyzx, l(0.318309873, 0.318309873, 0.318309873, 0.000000)
mad r1.z, r3.w, l(0.750000), l(0.250000)
ieq r2.w, r9.y, l(0)
dp3 r3.w, -r5.xyzx, r0.yzwy
dp3 r4.w, r5.xyzx, r2.xyzx
add r4.w, r4.w, r4.w
mad r10.xyz, r2.xyzx, -r4.wwww, r5.xyzx
mul r4.w, r6.w, r6.w
mad r9.x, -r3.w, r3.w, l(1.000000)
sqrt r9.x, r9.x
dp3_sat r9.y, r2.xyzx, -r5.xyzx
and r11.xy, r1.wwww, l(2, 16, 0, 0)
mov_sat r1.w, r0.y
mul r1.w, r1.w, r1.w
mul r1.w, r1.w, r1.w
div r1.w, l(2.000000), r1.w
add r10.w, r1.w, l(-2.000000)
mul r1.w, r1.w, l(0.500000)
mul_sat r11.z, r0.z, l(50.000000)
add r11.z, -r0.z, r11.z
mul r11.w, r4.w, r4.w
mad r5.w, r5.w, l(0.250000), l(0.500000)
mul r5.w, r5.w, r5.w
mul r12.x, r5.w, l(0.500000)
mad r5.w, -r5.w, l(0.500000), l(1.000000)
mad r12.y, r9.y, r5.w, r12.x
div r12.y, l(1.000000, 1.000000, 1.000000, 1.000000), r12.y
mul r12.y, r12.y, l(0.250000)
mov r13.w, l(0)
mov r14.w, l(0)
mov r15.w, l(0)
mov r16.w, l(0)
mov r17.w, l(0)
mov r18.w, l(0)
mov r19.w, l(0)
mov r20.w, l(0)
mov r21.w, l(0)
mov r22.y, r7.w
mov r23.xyz, l(0,0,0,0)
mov r12.z, l(0)
loop
uge r12.w, r12.z, r0.x
breakc_nz r12.w
ld_structured r12.w, r12.z, l(0), g3.xxxx
imul null, r12.w, r12.w, l(6)
if_nz cb9[r12.w + 5].x
add r24.xyz, -cb0[20].xyzx, cb9[r12.w + 0].xyzx
mul r25.xyz, r24.xyzx, cb0[19].xyzx
mad r24.xyz, r24.xyzx, cb0[19].xyzx, l(-0.500000, -0.500000, -0.500000, 0.000000)
round_ni r26.xyz, r24.xyzx
ftou r14.xyz, r26.xyzx
utof r26.xyz, r14.xyzx
add_sat r24.xyz, r24.xyzx, -r26.xyzx
round_ni r25.xyz, r25.xyzx
ftou r13.xyz, r25.xyzx
ld_indexable(texture3d)(uint,uint,uint,uint) r13.x, r13.xyzw, t12.xyzw
and r25.xyzw, r13.xxxx, l(2, 1, 8, 4)
ine r25.xyzw, r25.xyzw, l(0, 0, 0, 0)
lt r27.xyz, r24.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
and r13.yz, r25.xxzx, r27.xxyx
movc r13.yz, r13.yyzy, l(0,0,0,0), r24.xxyx
lt r22.zw, l(0.000000, 0.000000, 0.500000, 0.500000), r13.yyyz
and r22.zw, r22.zzzw, r25.yyyw
movc r25.xy, r22.zwzz, l(1.000000,1.000000,0,0), r13.yzyy
and r13.xy, r13.xxxx, l(32, 16, 0, 0)
ine r13.xy, r13.xyxx, l(0, 0, 0, 0)
and r13.x, r27.z, r13.x
movc r13.x, r13.x, l(0), r24.z
lt r13.z, l(0.500000), r13.x
and r13.y, r13.z, r13.y
movc r25.z, r13.y, l(1.000000), r13.x
add r13.xyz, -r25.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
ld_indexable(texture3d)(uint,uint,uint,uint) r14.x, r14.xyzw, t11.xyzw
and r14.x, r14.x, cb9[r12.w + 5].x
add r24.xyz, r26.xyzx, l(1.000000, 0.000000, 0.000000, 0.000000)
ftou r15.xyz, r24.xyzx
ld_indexable(texture3d)(uint,uint,uint,uint) r14.y, r15.xyzw, t11.yxzw
and r14.y, r14.y, cb9[r12.w + 5].x
add r15.xyz, r26.xyzx, l(1.000000, 1.000000, 0.000000, 0.000000)
ftou r16.xyz, r15.xyzx
ld_indexable(texture3d)(uint,uint,uint,uint) r14.z, r16.xyzw, t11.yzxw
and r14.z, r14.z, cb9[r12.w + 5].x
add r15.xyz, r26.xyzx, l(0.000000, 1.000000, 0.000000, 0.000000)
ftou r17.xyz, r15.xyzx
ld_indexable(texture3d)(uint,uint,uint,uint) r15.x, r17.xyzw, t11.xyzw
and r15.x, r15.x, cb9[r12.w + 5].x
add r16.xyz, r26.xyzx, l(0.000000, 0.000000, 1.000000, 0.000000)
ftou r18.xyz, r16.xyzx
ld_indexable(texture3d)(uint,uint,uint,uint) r15.y, r18.xyzw, t11.yxzw
and r15.y, r15.y, cb9[r12.w + 5].x
add r16.xyz, r26.xyzx, l(1.000000, 0.000000, 1.000000, 0.000000)
ftou r19.xyz, r16.xyzx
ld_indexable(texture3d)(uint,uint,uint,uint) r15.z, r19.xyzw, t11.yzxw
and r15.z, r15.z, cb9[r12.w + 5].x
add r16.xyz, r26.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
ftou r20.xyz, r16.xyzx
ld_indexable(texture3d)(uint,uint,uint,uint) r16.x, r20.xyzw, t11.xyzw
and r16.x, r16.x, cb9[r12.w + 5].x
add r17.xyz, r26.xyzx, l(0.000000, 1.000000, 1.000000, 0.000000)
ftou r21.xyz, r17.xyzx
ld_indexable(texture3d)(uint,uint,uint,uint) r16.y, r21.xyzw, t11.yxzw
and r16.y, r16.y, cb9[r12.w + 5].x
movc r14.x, r14.x, r13.x, l(0)
movc r14.yz, r14.yyzy, r25.xxxx, l(0,0,0,0)
add r14.x, r14.y, r14.x
movc r14.y, r15.x, r13.x, l(0)
add r14.y, r14.z, r14.y
mul r14.y, r25.y, r14.y
mad r14.x, r14.x, r13.y, r14.y
movc r14.y, r15.y, r13.x, l(0)
movc r14.z, r15.z, r25.x, l(0)
add r14.y, r14.z, r14.y
movc r13.x, r16.y, r13.x, l(0)
movc r14.z, r16.x, r25.x, l(0)
add r13.x, r13.x, r14.z
mul r13.x, r25.y, r13.x
mad r13.x, r14.y, r13.y, r13.x
mul r13.x, r25.z, r13.x
mad r13.x, r14.x, r13.z, r13.x
log r13.x, r13.x
mul r13.x, r13.x, l(2.500000)
exp r13.x, r13.x
else
mov r13.x, l(1.000000)
endif
lt r13.y, l(0.000000), cb9[r12.w + 4].z
and r13.y, r2.w, r13.y
lt r13.z, l(0.000000), cb9[r12.w + 0].w
if_nz r13.z
add r14.xyz, -r4.xyzx, cb9[r12.w + 0].xyzx
dp3 r13.z, r14.xyzx, r14.xyzx
rsq r15.x, r13.z
mul r15.xyz, r14.xyzx, r15.xxxx
sqrt r16.x, r13.z
lt r16.y, l(0.000000), cb9[r12.w + 4].w
lt r16.z, l(0.000000), cb9[r12.w + 2].w
mul r17.xyz, l(-0.500000, -0.500000, -0.500000, 0.000000), cb9[r12.w + 2].xyzx
mad r18.xyz, -r17.xyzx, cb9[r12.w + 2].wwww, r14.xyzx
mad r17.xyz, r17.xyzx, cb9[r12.w + 2].wwww, r14.xyzx
dp3 r19.x, r18.xyzx, r18.xyzx
dp3 r19.y, r17.xyzx, r17.xyzx
sqrt r19.xy, r19.xyxx
dp3 r19.z, r18.xyzx, r17.xyzx
mad r19.z, r19.x, r19.y, r19.z
add r19.z, r19.z, l(0.000100)
div r19.z, l(2.000000), r19.z
mul r20.y, r19.z, l(32000.000000)
dp3 r18.x, r2.xyzx, r18.xyzx
div r18.x, r18.x, r19.x
dp3 r17.x, r2.xyzx, r17.xyzx
div r17.x, r17.x, r19.y
add r17.x, r17.x, r18.x
mul_sat r20.x, r17.x, l(0.500000)
add r13.z, r13.z, l(1.000000)
div r13.z, l(1.000000, 1.000000, 1.000000, 1.000000), r13.z
mul r17.y, r13.z, l(32000.000000)
dp3 r17.x, r2.xyzx, r15.xyzx
movc r18.xy, r16.zzzz, r20.xyxx, r17.xyxx
mul r13.z, r16.x, cb9[r12.w + 0].w
mul r13.z, r13.z, r13.z
mad r13.z, -r13.z, r13.z, l(1.000000)
max r13.z, r13.z, l(0.000000)
mul r13.z, r13.z, r13.z
mul r18.z, r13.z, r18.y
mul r19.xyz, r14.xyzx, cb9[r12.w + 0].wwww
dp3 r13.z, r19.xyzx, r19.xyzx
min r13.z, r13.z, l(1.000000)
add r13.z, -r13.z, l(1.000000)
log r13.z, r13.z
mul r13.z, r13.z, cb9[r12.w + 1].w
exp r17.z, r13.z
movc r16.xy, r16.yyyy, r18.xzxx, r17.xzxx
dp3 r13.z, r15.xyzx, cb9[r12.w + 2].xyzx
add r13.z, r13.z, -cb9[r12.w + 3].x
mul_sat r13.z, r13.z, cb9[r12.w + 3].y
mul r13.z, r13.z, r13.z
else
dp3 r16.x, r2.xyzx, cb9[r12.w + 2].xyzx
mov r14.xyz, cb9[r12.w + 2].xyzx
mov r16.y, l(1.000000)
mov r13.z, l(1.000000)
endif
lt r15.x, l(0.000000), r16.y
lt r15.y, l(0.000000), r13.z
and r15.x, r15.y, r15.x
ieq r13.y, r13.y, l(0)
and r13.y, r13.y, r15.x
if_nz r13.y
eq r13.y, cb9[r12.w + 0].w, l(0.000000)
movc r24.xyzw, r13.yyyy, r8.xyzw, l(1.000000,1.000000,1.000000,1.000000)
mul r24.w, r13.x, r24.w
mul r25.xyzw, r1.zzzz, r24.xyzw
mad_sat r13.x, r1.z, r24.w, -cb9[r12.w + 3].z
mul r13.x, r13.x, cb9[r12.w + 3].w
mul r15.xyz, r6.xyzx, r13.xxxx
lt r13.y, l(0.000000), cb9[r12.w + 4].x
if_nz r13.y
lt r13.y, l(0.000000), cb9[r12.w + 2].w
if_nz r13.y
dp3 r13.y, -cb9[r12.w + 2].xyzx, -cb9[r12.w + 2].xyzx
rsq r13.y, r13.y
mul r17.xyz, r13.yyyy, -cb9[r12.w + 2].xyzx
mul r18.xyz, r17.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
mad r18.xyz, -r18.xyzx, cb9[r12.w + 2].wwww, r14.xyzx
mul r17.xyz, r17.xyzx, cb9[r12.w + 2].wwww
dp3 r13.y, r10.xyzx, r17.xyzx
mad r19.xyz, r13.yyyy, r10.xyzx, -r17.xyzx
dp3 r16.z, r18.xyzx, r19.xyzx
mul r13.y, r13.y, r13.y
mad r13.y, cb9[r12.w + 2].w, cb9[r12.w + 2].w, -r13.y
div_sat r13.y, r16.z, r13.y
mad r17.xyz, r13.yyyy, r17.xyzx, r18.xyzx
dp3 r13.y, r17.xyzx, r10.xyzx
mad r18.xyz, r13.yyyy, r10.xyzx, -r17.xyzx
dp3 r13.y, r18.xyzx, r18.xyzx
sqrt r13.y, r13.y
div_sat r13.y, cb9[r12.w + 4].x, r13.y
mad r17.xyz, r18.xyzx, r13.yyyy, r17.xyzx
dp3 r13.y, r17.xyzx, r17.xyzx
sqrt r13.y, r13.y
div r13.y, l(1.000000, 1.000000, 1.000000, 1.000000), r13.y
mul r16.z, r13.y, cb9[r12.w + 2].w
mul r16.z, r16.z, l(1.57079637)
mad r18.x, cb9[r12.w + 2].w, r13.y, l(1.000000)
div r16.z, r16.z, r18.x
mul r18.x, r13.y, cb9[r12.w + 4].x
mul r18.x, r18.x, l(1.57079637)
mad r13.y, cb9[r12.w + 4].x, r13.y, l(1.000000)
div r13.y, r18.x, r13.y
mad r16.z, r16.z, l(0.333330), r4.w
sqrt r16.z, r16.z
min r16.z, r16.z, l(1.000000)
div r16.z, r6.w, r16.z
mul r16.z, r16.z, r16.z
mad r13.y, r13.y, l(0.333330), r4.w
sqrt r13.y, r13.y
min r13.y, r13.y, l(1.000000)
div r13.y, r6.w, r13.y
mul r13.y, r13.y, r13.y
mul r13.y, r13.y, r13.y
mul r13.y, r13.y, r16.z
else
dp3 r16.z, r14.xyzx, r10.xyzx
mad r18.xyz, r16.zzzz, r10.xyzx, -r14.xyzx
dp3 r16.z, r18.xyzx, r18.xyzx
sqrt r16.z, r16.z
div_sat r16.z, cb9[r12.w + 4].x, r16.z
mad r17.xyz, r18.xyzx, r16.zzzz, r14.xyzx
dp3 r16.z, r17.xyzx, r17.xyzx
sqrt r16.z, r16.z
div r16.z, cb9[r12.w + 4].x, r16.z
mul r18.x, r16.z, l(1.57079637)
add r16.z, r16.z, l(1.000000)
div r16.z, r18.x, r16.z
mad r16.z, r16.z, l(0.333330), r4.w
sqrt r16.z, r16.z
min r16.z, r16.z, l(1.000000)
div r16.z, r6.w, r16.z
mul r16.z, r16.z, r16.z
mul r13.y, r16.z, r16.z
endif
mov r16.z, r6.w
else
add r18.x, l(1.000000), -cb9[r12.w + 4].y
mad r16.z, r6.w, r18.x, cb9[r12.w + 4].y
mov r17.xyz, r14.xyzx
mov r13.y, l(1.000000)
endif
dp3 r18.x, r17.xyzx, r17.xyzx
rsq r18.x, r18.x
mul r19.xyz, r17.xyzx, r18.xxxx
if_nz r9.z
dp3 r18.y, r19.xyzx, r0.yzwy
mad r18.z, -r18.y, r18.y, l(1.000000)
sqrt r18.z, r18.z
mul r18.y, r3.w, r18.y
mad_sat r18.y, r18.z, r9.x, -r18.y
mul r18.z, r16.z, r16.z
mul r18.z, r18.z, r18.z
div r18.z, l(1.000000, 1.000000, 1.000000, 1.000000), r18.z
lt r20.x, r18.y, l(0.000001)
log r18.y, r18.y
mul r18.y, r18.y, r18.z
exp r18.y, r18.y
movc r18.y, r20.x, l(0), r18.y
mul r20.xyz, r15.xyzx, r18.yyyy
mul r20.xyz, r13.yyyy, r20.xyzx
else
mad r17.xyz, r17.xyzx, r18.xxxx, -r5.xyzx
dp3 r18.x, r17.xyzx, r17.xyzx
rsq r18.x, r18.x
mul r17.xyz, r17.xyzx, r18.xxxx
dp3_sat r18.x, r2.xyzx, r19.xyzx
dp3_sat r18.y, r2.xyzx, r17.xyzx
dp3_sat r17.x, -r5.xyzx, r17.xyzx
mul r17.y, r16.z, r16.z
mul r17.y, r17.y, r17.y
mad r17.z, r18.y, r17.y, -r18.y
mad r17.z, r17.z, r18.y, l(1.000000)
mul r17.z, r17.z, r17.z
div r17.y, r17.y, r17.z
mul r17.y, r17.y, l(0.318309873)
mad r16.z, r16.z, l(0.500000), l(0.500000)
mul r16.z, r16.z, r16.z
mul r17.z, r16.z, l(0.500000)
mad r16.z, -r16.z, l(0.500000), l(1.000000)
mad r18.y, r9.y, r16.z, r17.z
div r18.y, l(1.000000, 1.000000, 1.000000, 1.000000), r18.y
mad r16.z, r18.x, r16.z, r17.z
div r16.z, l(1.000000, 1.000000, 1.000000, 1.000000), r16.z
mul r16.z, r18.y, r16.z
mul r16.z, r17.y, r16.z
mul_sat r17.y, r15.y, l(50.000000)
mad r18.xyz, -r6.xyzx, r13.xxxx, r17.yyyy
mad r17.y, r17.x, l(-5.554730), l(-6.983160)
mul r17.x, r17.x, r17.y
exp r17.x, r17.x
mad r17.xyz, r18.xyzx, r17.xxxx, r15.xyzx
mul r16.z, r16.z, l(0.250000)
mul r17.xyz, r17.xyzx, r16.zzzz
mul_sat r20.xyz, r13.yyyy, r17.xyzx
endif
if_nz r9.w
mad_sat r22.x, r16.x, l(0.500000), l(0.500000)
sample_l_indexable(texture2d)(float,float,float,float) r17.xyz, r22.xyxx, t7.xyzw, s9, l(0.000000)
mov_sat r16.x, r16.x
mul r18.xyz, r20.xyzx, r16.xxxx
mad r17.xyz, r17.xyzx, r7.xyzx, r18.xyzx
else
if_nz r11.x
dp3 r13.y, r14.xyzx, r14.xyzx
rsq r13.y, r13.y
mul r18.xyz, r13.yyyy, r14.xyzx
mad r14.xyz, r14.xyzx, r13.yyyy, -r5.xyzx
dp3 r13.y, r14.xyzx, r14.xyzx
rsq r13.y, r13.y
mul r14.xyz, r13.yyyy, r14.xyzx
dp3_sat r13.y, r2.xyzx, r18.xyzx
dp3_sat r16.z, r2.xyzx, r14.xyzx
dp3_sat r14.x, -r5.xyzx, r14.xyzx
lt r14.y, r16.z, l(0.000001)
log r14.z, r16.z
mul r14.z, r10.w, r14.z
exp r14.z, r14.z
movc r14.y, r14.y, l(0), r14.z
mul r14.y, r1.w, r14.y
dp3 r14.z, r18.xyzx, -r5.xyzx
mad r14.z, r14.z, l(2.000000), l(2.000000)
div r14.z, l(1.000000, 1.000000, 1.000000, 1.000000), r14.z
mad r18.x, r14.x, l(-5.554730), l(-6.983160)
mul r14.x, r14.x, r18.x
exp r14.x, r14.x
mad r18.x, r11.z, r14.x, r0.z
mul r14.y, r14.z, r14.y
mul_sat r14.y, r18.x, r14.y
mad r14.z, r16.z, r11.w, -r16.z
mad r14.z, r14.z, r16.z, l(1.000000)
mul r14.z, r14.z, r14.z
div r14.z, r11.w, r14.z
mad r13.y, r13.y, r5.w, r12.x
div r13.y, l(1.000000, 1.000000, 1.000000, 1.000000), r13.y
mul r13.y, r12.y, r13.y
mul_sat r16.z, r15.y, l(50.000000)
mad r19.xyz, -r6.xyzx, r13.xxxx, r16.zzzz
mad r15.xyz, r19.xyzx, r14.xxxx, r15.xyzx
mul r13.x, r13.y, r14.z
mul_sat r15.xyz, r15.xyzx, r13.xxxx
mad r15.xyz, r3.xyzx, l(0.318309873, 0.318309873, 0.318309873, 0.000000), r15.xyzx
add r13.x, -r18.x, l(1.000000)
mad r17.xyz, r15.xyzx, r13.xxxx, r14.yyyy
else
mov_sat r16.x, r16.x
mad r13.x, r16.x, -r7.w, r7.w
add r13.y, -r13.x, l(1.000000)
mad r14.xyz, r7.xyzx, r13.yyyy, r20.xyzx
mul r15.xyz, r7.xyzx, r13.xxxx
mad r17.xyz, r16.xxxx, r14.xyzx, r15.xyzx
endif
endif
mul r14.xyz, r25.xyzx, r25.wwww
mul r13.x, r13.z, r16.y
mul r13.xyz, r14.xyzx, r13.xxxx
mul r13.xyz, r13.xyzx, cb9[r12.w + 1].xyzx
mul r13.xyz, r13.xyzx, r17.xyzx
else
mov r13.xyz, l(0,0,0,0)
endif
add r23.xyz, r13.xyzx, r23.xyzx
iadd r12.z, r12.z, l(1)
endloop
add r0.xyz, r4.xyzx, -cb0[20].xyzx
div r0.xyz, r0.xyzx, cb0[19].xyzx
mul r4.xyz, r0.xyzx, cb0[22].xyzx
if_z r11.y
ftoi r5.xyz, r4.xyzx
mov r5.w, l(0)
ld_indexable(texture3d)(uint,uint,uint,uint) r0.w, r5.xyzw, t12.yzwx
else
mov r0.w, l(0)
endif
ult r1.zw, vThreadID.xxxy, cb0[31].xxxy
and r1.z, r1.w, r1.z
if_nz r1.z
sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t5.xyzw, s10, l(0.000000)
add r1.xyz, r1.xyzx, r23.xyzx
round_ni r4.xyz, r4.xyzx
add r4.xyz, r4.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
div r4.xyz, r4.xyzx, cb0[22].xyzx
and r5.xyzw, r0.wwww, l(2, 1, 8, 4)
movc r5.xyzw, r5.xyzw, l(1.000000,1.000000,1.000000,1.000000), l(0,0,0,0)
and r6.xy, r0.wwww, l(32, 16, 0, 0)
movc r6.xy, r6.xyxx, l(1.000000,1.000000,0,0), l(0,0,0,0)
lt r7.xyz, r0.xyzx, r4.xyzx
movc r5.xy, r7.xyxx, r5.ywyy, r5.xzxx
add r4.xyz, -r0.xyzx, r4.xyzx
mad r5.xy, r5.xyxx, r4.xyxx, r0.xyxx
movc r0.x, r7.z, r6.y, r6.x
mad r5.z, r0.x, r4.z, r0.z
sample_l_indexable(texture3d)(float,float,float,float) r0.xyzw, r5.xyzx, t8.xyzw, s6, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r4.xyzw, r5.xyzx, t9.zwxy, s7, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r5.xyzw, r5.xyzx, t10.xyzw, s8, l(0.000000)
add r1.w, |r2.y|, |r2.x|
lt r1.w, l(0.000000), r1.w
dp2 r2.w, -r2.xyxx, -r2.xyxx
rsq r2.w, r2.w
mul r2.xy, r2.wwww, -r2.yxyy
and r2.xy, r1.wwww, r2.xyxx
mad r1.w, -r2.z, r2.z, l(1.000000)
sqrt r1.w, r1.w
mul r1.w, r1.w, l(0.500000)
mul r2.z, r2.z, l(0.500000)
mul r2.xy, r2.xyxx, r1.wwww
mov r6.x, r0.w
mov r6.yz, r4.zzwz
mul r6.xyz, r2.xxxx, r6.xyzx
mad r0.xyz, r0.xyzx, l(0.250000, 0.250000, 0.250000, 0.000000), r6.xyzx
mov r4.z, r5.x
mad r0.xyz, r4.xyzx, r2.zzzz, r0.xyzx
mad r0.xyz, r5.yzwy, r2.yyyy, r0.xyzx
max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r0.xyz, r0.xyzx, r3.xyzx, r1.xyzx
mov r0.w, l(0)
store_uav_typed u0.xyzw, vThreadID.xyyy, r0.xyzw
endif
ret
// Approximately 560 instruction slots used


If DSS looks at this, I'm sure he'll notice that this looks very similar in places as the CS he worked on in Batman: AK (which isn't surprising, since they're both using UE3.5). Since encountering this issue, I've studied his fix in that shader (and modified my fix code to be as identical to his as possible, but it's still the same result), but I don't see a section in this shader similar to the 2nd part where he does a second stereo correction to remove the clipping, and being the first compute shader I've worked on, pretty much everything after the correction part goes over my head...

So yeah, umm, help plz?

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 03/01/2016 08:47 AM   
Reporting back about Van Helsing. About the lighting, I commented the fix in the vertex shader and 100% fixed 2 out of the 3 pixel shaders that it controls (sadly, they are specific to the title screens and not the main pixel shader). What I did was storing the same v1 texcoord in another variable, applying a correction and partially copying the same operations of the normal shader in a new "r3" or whatever number isn't used in the shader. Then I swapped at a specific place the normal "r" with my modified "r", and it worked. For the main pixel shader, that solved haloing and now the lights aren't at screen depth, but they still don't have the correct position. This time I used two new variables. One of them fixes haloing and the other controls the position. There are many things to try to fix the position, so I don't have the correct formula yet. It doesn't look too bad, at least. This is how the shader looks now: [code]//Lighting PS 1. // ---- Created with 3Dmigoto v1.2.30 on Wed Feb 17 22:41:55 2016 cbuffer _Globals : register(b0) { float3 _g_vCamEye : packoffset(c0); float _g_fCamFar : packoffset(c1); float3 _g_vCamFrustumCorner00 : packoffset(c2); float3 _g_vCamFrustumCorner01 : packoffset(c3); float3 _g_vCamFrustumCorner10 : packoffset(c4); float3 _g_vCamFrustumCorner11 : packoffset(c5); float2 _g_vRTResHalfRecip : packoffset(c6); float _g_fFogZMax : packoffset(c7); float _g_fFogHMax : packoffset(c8); float _g_fFogHMin : packoffset(c9); float _g_fFogCamera : packoffset(c10); float _g_fFogTanIn : packoffset(c11); float _g_fFogTanOut : packoffset(c12); float3 _g_vPointLightPos : packoffset(c13); float _g_fPointLightRange : packoffset(c14); float _g_fPointLightAttenuation : packoffset(c15); float3 _g_vPointLightDiffuseColor : packoffset(c16); float _g_fPointLightFogPower : packoffset(c17); } SamplerState _g_sG_DepthPoint_s : register(s0); SamplerState _g_sFogGradientLight_s : register(s1); Texture2D<float4> _TMP51 : register(t0); Texture1D<float4> _TMP52 : register(t1); // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float4 v0 : SV_Position0, float4 v1 : TEXCOORD0, out float4 o0 : SV_Target0) { float4 r0,r1,r2,r3; uint4 bitmask, uiDest; float4 fDest; float4 stereo = StereoParams.Load(0); float separation = stereo.x; float convergence = stereo.y; //This variable affects the position. Incorrect correction formula for now. float4 prev=v1.xyzw; prev.x-=separation*(prev.w-convergence*2); //This variable fixes haloing. float4 prev2=v1.xyzw; prev2.x+=separation*(prev.w-convergence); r0.xyz = _g_vCamFrustumCorner11.xyz + -_g_vCamFrustumCorner01.xyz; r1.xy = prev2.xy / v1.ww; r3.xy= prev.xy / v1.ww; r1.xy = r1.xy * float2(0.5,-0.5) + float2(0.5,0.5); r3.xy = r3.xy * float2(0.5,-0.5) + float2(0.5,0.5); r0.xyz = r3.xxx * r0.xyz + _g_vCamFrustumCorner01.xyz; r2.xyz = _g_vCamFrustumCorner10.xyz + -_g_vCamFrustumCorner00.xyz; r2.xyz = r1.xxx * r2.xyz + _g_vCamFrustumCorner00.xyz; r0.xyz = -r2.xyz + r0.xyz; r0.xyz = r1.yyy * r0.xyz + r2.xyz; r1.xy = _g_vRTResHalfRecip.xy + r1.xy; r0.w = _TMP51.SampleLevel(_g_sG_DepthPoint_s, r1.xy, 0).x; r0.xyz = -_g_vCamEye.xyz + r0.xyz; r0.xyz = r0.www * r0.xyz + _g_vCamEye.xyz; r0.w = _g_fCamFar * r0.w; r0.w = r0.w / _g_fFogZMax; r0.w = _TMP52.SampleLevel(_g_sFogGradientLight_s, r0.w, 0).w; r1.xyz = -_g_vPointLightPos.xyz + r0.xyz; r0.x = -_g_fFogHMin + r0.z; r0.y = dot(r1.xyz, r1.xyz); r0.y = rsqrt(r0.y); r0.y = 1 / r0.y; r0.y = saturate(r0.y / _g_fPointLightRange); r0.y = 1 + -r0.y; r0.z = r0.y * r0.y + -9.99999997e-007; r0.y = log2(r0.y); r0.y = _g_fPointLightAttenuation * r0.y; r0.y = exp2(r0.y); r1.xyz = _g_vPointLightDiffuseColor.xyz * r0.yyy; r0.y = cmp(r0.z < 0); if (r0.y != 0) discard; r0.y = -_g_fFogHMin + _g_fFogHMax; r0.x = saturate(r0.x / r0.y); r0.x = max(_g_fFogCamera, r0.x); r0.x = log2(r0.x); r0.x = _g_fFogTanIn * r0.x; r0.x = exp2(r0.x); r0.x = 1 + -r0.x; r0.x = log2(r0.x); r0.x = _g_fFogTanOut * r0.x; r0.x = exp2(r0.x); r0.x = 1 + -r0.x; r0.x = 3.1415 * r0.x; r0.x = cos(r0.x); r0.x = r0.x * 0.5 + 0.5; r0.x = 1 + -r0.x; r0.x = saturate(r0.x * r0.w); r0.x = 1 + -r0.x; r0.x = log2(r0.x); r0.x = _g_fPointLightFogPower * r0.x; r0.x = exp2(r0.x); r0.xyz = r1.xyz * r0.xxx; o0.xyz = min(float3(10,10,10), r0.xyz); o0.w = 1; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // using 3Dmigoto v1.2.30 on Wed Feb 17 22:41:55 2016 // // // Buffer Definitions: // // cbuffer $Globals // { // // float3 _g_vCamEye; // Offset: 0 Size: 12 // float _g_fCamFar; // Offset: 16 Size: 4 // float3 _g_vCamFrustumCorner00; // Offset: 32 Size: 12 // float3 _g_vCamFrustumCorner01; // Offset: 48 Size: 12 // float3 _g_vCamFrustumCorner10; // Offset: 64 Size: 12 // float3 _g_vCamFrustumCorner11; // Offset: 80 Size: 12 // float2 _g_vRTResHalfRecip; // Offset: 96 Size: 8 // float _g_fFogZMax; // Offset: 112 Size: 4 // float _g_fFogHMax; // Offset: 128 Size: 4 // float _g_fFogHMin; // Offset: 144 Size: 4 // float _g_fFogCamera; // Offset: 160 Size: 4 // float _g_fFogTanIn; // Offset: 176 Size: 4 // float _g_fFogTanOut; // Offset: 192 Size: 4 // float3 _g_vPointLightPos; // Offset: 208 Size: 12 // float _g_fPointLightRange; // Offset: 224 Size: 4 // float _g_fPointLightAttenuation; // Offset: 240 Size: 4 // float3 _g_vPointLightDiffuseColor; // Offset: 256 Size: 12 // float _g_fPointLightFogPower; // Offset: 272 Size: 4 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // _g_sG_DepthPoint sampler NA NA 0 1 // _g_sFogGradientLight sampler NA NA 1 1 // _TMP51 texture float4 2d 0 1 // _TMP52 texture float4 1d 1 1 // $Globals cbuffer NA NA 0 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float // TEXCOORD 0 xyzw 1 NONE float xy w // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Target 0 xyzw 0 TARGET float xyzw // ps_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[18], immediateIndexed dcl_sampler s0, mode_default dcl_sampler s1, mode_default dcl_resource_texture2d (float,float,float,float) t0 dcl_resource_texture1d (float,float,float,float) t1 dcl_input_ps linear v1.xyw dcl_output o0.xyzw dcl_temps 3 add r0.xyz, -cb0[3].xyzx, cb0[5].xyzx div r1.xy, v1.xyxx, v1.wwww mad r1.xy, r1.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000) mad r0.xyz, r1.xxxx, r0.xyzx, cb0[3].xyzx add r2.xyz, -cb0[2].xyzx, cb0[4].xyzx mad r2.xyz, r1.xxxx, r2.xyzx, cb0[2].xyzx add r0.xyz, r0.xyzx, -r2.xyzx mad r0.xyz, r1.yyyy, r0.xyzx, r2.xyzx add r1.xy, r1.xyxx, cb0[6].xyxx sample_l_indexable(texture2d)(float,float,float,float) r0.w, r1.xyxx, t0.yzwx, s0, l(0.000000) add r0.xyz, r0.xyzx, -cb0[0].xyzx mad r0.xyz, r0.wwww, r0.xyzx, cb0[0].xyzx mul r0.w, r0.w, cb0[1].x div r0.w, r0.w, cb0[7].x sample_l_indexable(texture1d)(float,float,float,float) r0.w, r0.w, t1.xyzw, s1, l(0.000000) add r1.xyz, r0.xyzx, -cb0[13].xyzx add r0.x, r0.z, -cb0[9].x dp3 r0.y, r1.xyzx, r1.xyzx rsq r0.y, r0.y div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y div_sat r0.y, r0.y, cb0[14].x add r0.y, -r0.y, l(1.000000) mad r0.z, r0.y, r0.y, l(-0.000001) log r0.y, r0.y mul r0.y, r0.y, cb0[15].x exp r0.y, r0.y mul r1.xyz, r0.yyyy, cb0[16].xyzx lt r0.y, r0.z, l(0.000000) discard_nz r0.y add r0.y, cb0[8].x, -cb0[9].x div_sat r0.x, r0.x, r0.y max r0.x, r0.x, cb0[10].x log r0.x, r0.x mul r0.x, r0.x, cb0[11].x exp r0.x, r0.x add r0.x, -r0.x, l(1.000000) log r0.x, r0.x mul r0.x, r0.x, cb0[12].x exp r0.x, r0.x add r0.x, -r0.x, l(1.000000) mul r0.x, r0.x, l(3.141500) sincos null, r0.x, r0.x mad r0.x, r0.x, l(0.500000), l(0.500000) add r0.x, -r0.x, l(1.000000) mul_sat r0.x, r0.w, r0.x add r0.x, -r0.x, l(1.000000) log r0.x, r0.x mul r0.x, r0.x, cb0[17].x exp r0.x, r0.x mul r0.xyz, r0.xxxx, r1.xyzx min o0.xyz, r0.xyzx, l(10.000000, 10.000000, 10.000000, 0.000000) mov o0.w, l(1.000000) ret // Approximately 53 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code] About the water, I tried doing similar things but it didn't work (for now, at least). I could affect the water waves, brightness of many effects, etc, but I didn't see anything affecting the texture size or position. [quote="DarkStarSword"] Hmmm, is the comment in the d3dx.ini misleading? I can't think of any reason you would be trying to prevent the CPU reading a texture here since this isn't an occlusion buffer...[/quote] OK, my fault. I didn't read the description thoroughly, but it was quick to try :p. [quote="DarkStarSword"]This sounds like a problem caused by disabling scissor clipping, which we made the default at some point when it seemed to be harmless. You can enable it again with: [code] rasterizer_disable_scissor=0 [/code] But you may then run into clipping issues if you try to adjust the depth of those HUD elements. I've considered an alternative approach that I could probably add to 3DMigoto if necessary - I could pass the bounds of the scissor rectangle into the pixel shader then you could apply the clipping yourself with the discard instruction and have the ability to adjust it as necessary. [/quote] I tried that "rasterizer_disable_scissor=0" and it worked, but as you said, elements inside the HUD and menus are clipped more and more as I increase the HUD depth. The DX9 fix shows this, and that's probably the reason of the low HUD depth there.
Reporting back about Van Helsing.

About the lighting, I commented the fix in the vertex shader and 100% fixed 2 out of the 3 pixel shaders that it controls (sadly, they are specific to the title screens and not the main pixel shader). What I did was storing the same v1 texcoord in another variable, applying a correction and partially copying the same operations of the normal shader in a new "r3" or whatever number isn't used in the shader. Then I swapped at a specific place the normal "r" with my modified "r", and it worked.

For the main pixel shader, that solved haloing and now the lights aren't at screen depth, but they still don't have the correct position. This time I used two new variables. One of them fixes haloing and the other controls the position. There are many things to try to fix the position, so I don't have the correct formula yet. It doesn't look too bad, at least.

This is how the shader looks now:

//Lighting PS 1.
// ---- Created with 3Dmigoto v1.2.30 on Wed Feb 17 22:41:55 2016

cbuffer _Globals : register(b0)
{
float3 _g_vCamEye : packoffset(c0);
float _g_fCamFar : packoffset(c1);
float3 _g_vCamFrustumCorner00 : packoffset(c2);
float3 _g_vCamFrustumCorner01 : packoffset(c3);
float3 _g_vCamFrustumCorner10 : packoffset(c4);
float3 _g_vCamFrustumCorner11 : packoffset(c5);
float2 _g_vRTResHalfRecip : packoffset(c6);
float _g_fFogZMax : packoffset(c7);
float _g_fFogHMax : packoffset(c8);
float _g_fFogHMin : packoffset(c9);
float _g_fFogCamera : packoffset(c10);
float _g_fFogTanIn : packoffset(c11);
float _g_fFogTanOut : packoffset(c12);
float3 _g_vPointLightPos : packoffset(c13);
float _g_fPointLightRange : packoffset(c14);
float _g_fPointLightAttenuation : packoffset(c15);
float3 _g_vPointLightDiffuseColor : packoffset(c16);
float _g_fPointLightFogPower : packoffset(c17);
}

SamplerState _g_sG_DepthPoint_s : register(s0);
SamplerState _g_sFogGradientLight_s : register(s1);
Texture2D<float4> _TMP51 : register(t0);
Texture1D<float4> _TMP52 : register(t1);


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


void main(
float4 v0 : SV_Position0,
float4 v1 : TEXCOORD0,
out float4 o0 : SV_Target0)
{
float4 r0,r1,r2,r3;
uint4 bitmask, uiDest;
float4 fDest;

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

//This variable affects the position. Incorrect correction formula for now.
float4 prev=v1.xyzw;
prev.x-=separation*(prev.w-convergence*2);

//This variable fixes haloing.
float4 prev2=v1.xyzw;
prev2.x+=separation*(prev.w-convergence);

r0.xyz = _g_vCamFrustumCorner11.xyz + -_g_vCamFrustumCorner01.xyz;
r1.xy = prev2.xy / v1.ww;

r3.xy= prev.xy / v1.ww;

r1.xy = r1.xy * float2(0.5,-0.5) + float2(0.5,0.5);

r3.xy = r3.xy * float2(0.5,-0.5) + float2(0.5,0.5);

r0.xyz = r3.xxx * r0.xyz + _g_vCamFrustumCorner01.xyz;
r2.xyz = _g_vCamFrustumCorner10.xyz + -_g_vCamFrustumCorner00.xyz;
r2.xyz = r1.xxx * r2.xyz + _g_vCamFrustumCorner00.xyz;
r0.xyz = -r2.xyz + r0.xyz;
r0.xyz = r1.yyy * r0.xyz + r2.xyz;
r1.xy = _g_vRTResHalfRecip.xy + r1.xy;
r0.w = _TMP51.SampleLevel(_g_sG_DepthPoint_s, r1.xy, 0).x;
r0.xyz = -_g_vCamEye.xyz + r0.xyz;
r0.xyz = r0.www * r0.xyz + _g_vCamEye.xyz;
r0.w = _g_fCamFar * r0.w;
r0.w = r0.w / _g_fFogZMax;
r0.w = _TMP52.SampleLevel(_g_sFogGradientLight_s, r0.w, 0).w;
r1.xyz = -_g_vPointLightPos.xyz + r0.xyz;
r0.x = -_g_fFogHMin + r0.z;
r0.y = dot(r1.xyz, r1.xyz);
r0.y = rsqrt(r0.y);
r0.y = 1 / r0.y;
r0.y = saturate(r0.y / _g_fPointLightRange);
r0.y = 1 + -r0.y;
r0.z = r0.y * r0.y + -9.99999997e-007;
r0.y = log2(r0.y);
r0.y = _g_fPointLightAttenuation * r0.y;
r0.y = exp2(r0.y);
r1.xyz = _g_vPointLightDiffuseColor.xyz * r0.yyy;
r0.y = cmp(r0.z < 0);
if (r0.y != 0) discard;
r0.y = -_g_fFogHMin + _g_fFogHMax;
r0.x = saturate(r0.x / r0.y);
r0.x = max(_g_fFogCamera, r0.x);
r0.x = log2(r0.x);
r0.x = _g_fFogTanIn * r0.x;
r0.x = exp2(r0.x);
r0.x = 1 + -r0.x;
r0.x = log2(r0.x);
r0.x = _g_fFogTanOut * r0.x;
r0.x = exp2(r0.x);
r0.x = 1 + -r0.x;
r0.x = 3.1415 * r0.x;
r0.x = cos(r0.x);
r0.x = r0.x * 0.5 + 0.5;
r0.x = 1 + -r0.x;
r0.x = saturate(r0.x * r0.w);
r0.x = 1 + -r0.x;
r0.x = log2(r0.x);
r0.x = _g_fPointLightFogPower * r0.x;
r0.x = exp2(r0.x);
r0.xyz = r1.xyz * r0.xxx;
o0.xyz = min(float3(10,10,10), r0.xyz);
o0.w = 1;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// using 3Dmigoto v1.2.30 on Wed Feb 17 22:41:55 2016
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
// float3 _g_vCamEye; // Offset: 0 Size: 12
// float _g_fCamFar; // Offset: 16 Size: 4
// float3 _g_vCamFrustumCorner00; // Offset: 32 Size: 12
// float3 _g_vCamFrustumCorner01; // Offset: 48 Size: 12
// float3 _g_vCamFrustumCorner10; // Offset: 64 Size: 12
// float3 _g_vCamFrustumCorner11; // Offset: 80 Size: 12
// float2 _g_vRTResHalfRecip; // Offset: 96 Size: 8
// float _g_fFogZMax; // Offset: 112 Size: 4
// float _g_fFogHMax; // Offset: 128 Size: 4
// float _g_fFogHMin; // Offset: 144 Size: 4
// float _g_fFogCamera; // Offset: 160 Size: 4
// float _g_fFogTanIn; // Offset: 176 Size: 4
// float _g_fFogTanOut; // Offset: 192 Size: 4
// float3 _g_vPointLightPos; // Offset: 208 Size: 12
// float _g_fPointLightRange; // Offset: 224 Size: 4
// float _g_fPointLightAttenuation; // Offset: 240 Size: 4
// float3 _g_vPointLightDiffuseColor; // Offset: 256 Size: 12
// float _g_fPointLightFogPower; // Offset: 272 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// _g_sG_DepthPoint sampler NA NA 0 1
// _g_sFogGradientLight sampler NA NA 1 1
// _TMP51 texture float4 2d 0 1
// _TMP52 texture float4 1d 1 1
// $Globals cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float
// TEXCOORD 0 xyzw 1 NONE float xy w
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[18], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture1d (float,float,float,float) t1
dcl_input_ps linear v1.xyw
dcl_output o0.xyzw
dcl_temps 3
add r0.xyz, -cb0[3].xyzx, cb0[5].xyzx
div r1.xy, v1.xyxx, v1.wwww
mad r1.xy, r1.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
mad r0.xyz, r1.xxxx, r0.xyzx, cb0[3].xyzx
add r2.xyz, -cb0[2].xyzx, cb0[4].xyzx
mad r2.xyz, r1.xxxx, r2.xyzx, cb0[2].xyzx
add r0.xyz, r0.xyzx, -r2.xyzx
mad r0.xyz, r1.yyyy, r0.xyzx, r2.xyzx
add r1.xy, r1.xyxx, cb0[6].xyxx
sample_l_indexable(texture2d)(float,float,float,float) r0.w, r1.xyxx, t0.yzwx, s0, l(0.000000)
add r0.xyz, r0.xyzx, -cb0[0].xyzx
mad r0.xyz, r0.wwww, r0.xyzx, cb0[0].xyzx
mul r0.w, r0.w, cb0[1].x
div r0.w, r0.w, cb0[7].x
sample_l_indexable(texture1d)(float,float,float,float) r0.w, r0.w, t1.xyzw, s1, l(0.000000)
add r1.xyz, r0.xyzx, -cb0[13].xyzx
add r0.x, r0.z, -cb0[9].x
dp3 r0.y, r1.xyzx, r1.xyzx
rsq r0.y, r0.y
div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y
div_sat r0.y, r0.y, cb0[14].x
add r0.y, -r0.y, l(1.000000)
mad r0.z, r0.y, r0.y, l(-0.000001)
log r0.y, r0.y
mul r0.y, r0.y, cb0[15].x
exp r0.y, r0.y
mul r1.xyz, r0.yyyy, cb0[16].xyzx
lt r0.y, r0.z, l(0.000000)
discard_nz r0.y
add r0.y, cb0[8].x, -cb0[9].x
div_sat r0.x, r0.x, r0.y
max r0.x, r0.x, cb0[10].x
log r0.x, r0.x
mul r0.x, r0.x, cb0[11].x
exp r0.x, r0.x
add r0.x, -r0.x, l(1.000000)
log r0.x, r0.x
mul r0.x, r0.x, cb0[12].x
exp r0.x, r0.x
add r0.x, -r0.x, l(1.000000)
mul r0.x, r0.x, l(3.141500)
sincos null, r0.x, r0.x
mad r0.x, r0.x, l(0.500000), l(0.500000)
add r0.x, -r0.x, l(1.000000)
mul_sat r0.x, r0.w, r0.x
add r0.x, -r0.x, l(1.000000)
log r0.x, r0.x
mul r0.x, r0.x, cb0[17].x
exp r0.x, r0.x
mul r0.xyz, r0.xxxx, r1.xyzx
min o0.xyz, r0.xyzx, l(10.000000, 10.000000, 10.000000, 0.000000)
mov o0.w, l(1.000000)
ret
// Approximately 53 instruction slots used

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



About the water, I tried doing similar things but it didn't work (for now, at least). I could affect the water waves, brightness of many effects, etc, but I didn't see anything affecting the texture size or position.

DarkStarSword said:
Hmmm, is the comment in the d3dx.ini misleading? I can't think of any reason you would be trying to prevent the CPU reading a texture here since this isn't an occlusion buffer...


OK, my fault. I didn't read the description thoroughly, but it was quick to try :p.

DarkStarSword said:This sounds like a problem caused by disabling scissor clipping, which we made the default at some point when it seemed to be harmless. You can enable it again with:

rasterizer_disable_scissor=0


But you may then run into clipping issues if you try to adjust the depth of those HUD elements. I've considered an alternative approach that I could probably add to 3DMigoto if necessary - I could pass the bounds of the scissor rectangle into the pixel shader then you could apply the clipping yourself with the discard instruction and have the ability to adjust it as necessary.


I tried that "rasterizer_disable_scissor=0" and it worked, but as you said, elements inside the HUD and menus are clipped more and more as I increase the HUD depth. The DX9 fix shows this, and that's probably the reason of the low HUD depth there.

CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: Gainward Phoenix 1080 GLH
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com

Posted 03/05/2016 08:05 AM   
Right... So I have this shader.... which for some reason I am unable to correct.. I bet is a simple thing BUT can't seem to see it..... [code] // f7b63c246c08f75d-ps_replace -> Shadows cbuffer cbPerLight : register(b0) { row_major float4x4 g_worldViewInverse : packoffset(c0); row_major float4x4 g_cameraToShadowProjector : packoffset(c4); row_major float4x4 g_cameraToShadow : packoffset(c8); row_major float4x4 g_cameraToSpotProjector : packoffset(c12); float4 g_characterLightTint : packoffset(c16); float4 g_lightColor : packoffset(c17); float4 g_triLightMidColor : packoffset(c18); float4 g_triLightBackColor : packoffset(c19); float4 g_lightProperties : packoffset(c20); float4 g_shadowTextureSize : packoffset(c21); float4 g_shadowCascadeColor : packoffset(c22); float4 g_shadowFadeDistances : packoffset(c23); float4 g_telegraphProperties : packoffset(c24); float g_shadowAlpha : packoffset(c25); float g_shadowPixelSize : packoffset(c25.y); } cbuffer cbPerFrame_Uncommon : register(b13) { row_major float4x4 g_projection : packoffset(c0); row_major float4x4 g_projectionInverse : packoffset(c4); row_major float4x4 g_mainView : packoffset(c8); float4 g_debugTweakables : packoffset(c12); float4 g_nearFarDepths : packoffset(c13); float4 g_reflectionPlane : packoffset(c14); } SamplerComparisonState shadowSamplerState_s : register(s0); Texture2D<float4> g_sceneTexture2 : register(t0); Texture2D<float4> g_shadowTexture : register(t1); // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float4 v0 : SV_POSITION0, float4 v1 : TEXCOORD0, float3 v2 : TEXCOORD1, out float4 o0 : SV_TARGET0) { float4 r0,r1,r2,r3; uint4 bitmask, uiDest; float4 fDest; r0.xy = (int2)v0.xy; r0.zw = float2(0,0); r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw; r0.y = -g_shadowPixelSize * 2.5 + r0.x; r1.xyz = v1.xyz / v1.zzz; r0.xzw = r1.xyz * -r0.xxx; r1.xyz = r0.xzw / r0.www; // Tried here not working r1.xyz = r1.xyz * -r0.yyy; r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy; r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw; r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw; r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw; r1.xyz = r1.zxy / r1.www; //Here we must do the stereo correction // Still not working.... float4 stereo = StereoParams.Load(0); r1.x += stereo.x * (r1.z - stereo.y) * g_projection._m00; r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.0174499992,1.68314505,-1.26170254,1.44229996) + r1.yzyz; r1.x = saturate(r1.x); r0.y = -1.99999995e-005 + r1.x; r1.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r2.xyzw = g_shadowTextureSize.zwzw * float4(-1.04089749,-0.65644753,0.868130028,0.508212507) + r1.yzyz; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r1.x = r1.x + r2.x; r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.142492503,-1.77057254,1.15585494,1.6522975) + r1.yzyz; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r1.x = r1.x + r2.x; r2.xyzw = g_shadowTextureSize.zwzw * float4(0.904980004,-1.16333497,2.00254989,0.180197507) + r1.yzyz; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r1.x = r1.x + r2.x; r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.41099,0.400737494,-1.65660751,-1.73220503) + r1.yzyz; r3.xyzw = g_shadowTextureSize.zwzw * float4(2.16099238,-1.08537996,-2.46827006,-0.123702496) + r1.yzyz; r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r1.z = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.y; r1.x = r1.x + r1.z; r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.xy, r0.y).x; r0.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.zw, r0.y).x; r1.x = r1.x + r1.y; r0.y = r1.x + r0.y; r0.y = r0.y * 0.0833333358 + -1; r0.z = g_cameraToShadow._m12 * r0.z; r0.x = r0.x * g_cameraToShadow._m02 + r0.z; r0.x = r0.w * g_cameraToShadow._m22 + r0.x; r0.x = g_cameraToShadow._m32 + r0.x; r0.x = -g_shadowFadeDistances.y + -r0.x; r0.z = g_shadowFadeDistances.x + -g_shadowFadeDistances.y; r0.x = saturate(r0.x / r0.z); r0.x = r0.x * r0.y + 1; r0.yzw = g_shadowCascadeColor.xyz + -r0.xxx; o0.xyz = g_shadowCascadeColor.www * r0.yzw + r0.xxx; o0.w = 1; return; } [/code] Anyone willing to give me a hint? ^_^ thx Edit: This shader is from Elder Scrolls Online. The DX9 renderer has been dropped. I am trying to update the game for DX11. I already found the VS for the shadows and made it 2D. So now I only have to correct it in PS, but can't figure it out for the life of me... :(
Right... So I have this shader.... which for some reason I am unable to correct..
I bet is a simple thing BUT can't seem to see it.....

// f7b63c246c08f75d-ps_replace -> Shadows

cbuffer cbPerLight : register(b0)
{
row_major float4x4 g_worldViewInverse : packoffset(c0);
row_major float4x4 g_cameraToShadowProjector : packoffset(c4);
row_major float4x4 g_cameraToShadow : packoffset(c8);
row_major float4x4 g_cameraToSpotProjector : packoffset(c12);
float4 g_characterLightTint : packoffset(c16);
float4 g_lightColor : packoffset(c17);
float4 g_triLightMidColor : packoffset(c18);
float4 g_triLightBackColor : packoffset(c19);
float4 g_lightProperties : packoffset(c20);
float4 g_shadowTextureSize : packoffset(c21);
float4 g_shadowCascadeColor : packoffset(c22);
float4 g_shadowFadeDistances : packoffset(c23);
float4 g_telegraphProperties : packoffset(c24);
float g_shadowAlpha : packoffset(c25);
float g_shadowPixelSize : packoffset(c25.y);
}

cbuffer cbPerFrame_Uncommon : register(b13)
{
row_major float4x4 g_projection : packoffset(c0);
row_major float4x4 g_projectionInverse : packoffset(c4);
row_major float4x4 g_mainView : packoffset(c8);
float4 g_debugTweakables : packoffset(c12);
float4 g_nearFarDepths : packoffset(c13);
float4 g_reflectionPlane : packoffset(c14);
}

SamplerComparisonState shadowSamplerState_s : register(s0);
Texture2D<float4> g_sceneTexture2 : register(t0);
Texture2D<float4> g_shadowTexture : register(t1);


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


void main(
float4 v0 : SV_POSITION0,
float4 v1 : TEXCOORD0,
float3 v2 : TEXCOORD1,
out float4 o0 : SV_TARGET0)
{
float4 r0,r1,r2,r3;
uint4 bitmask, uiDest;
float4 fDest;


r0.xy = (int2)v0.xy;
r0.zw = float2(0,0);
r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw;
r0.y = -g_shadowPixelSize * 2.5 + r0.x;
r1.xyz = v1.xyz / v1.zzz;
r0.xzw = r1.xyz * -r0.xxx;
r1.xyz = r0.xzw / r0.www;

// Tried here not working


r1.xyz = r1.xyz * -r0.yyy;
r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy;
r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw;
r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw;
r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw;
r1.xyz = r1.zxy / r1.www;

//Here we must do the stereo correction
// Still not working....
float4 stereo = StereoParams.Load(0);
r1.x += stereo.x * (r1.z - stereo.y) * g_projection._m00;


r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.0174499992,1.68314505,-1.26170254,1.44229996) + r1.yzyz;
r1.x = saturate(r1.x);
r0.y = -1.99999995e-005 + r1.x;
r1.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r2.xyzw = g_shadowTextureSize.zwzw * float4(-1.04089749,-0.65644753,0.868130028,0.508212507) + r1.yzyz;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r1.x = r1.x + r2.x;
r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.142492503,-1.77057254,1.15585494,1.6522975) + r1.yzyz;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r1.x = r1.x + r2.x;
r2.xyzw = g_shadowTextureSize.zwzw * float4(0.904980004,-1.16333497,2.00254989,0.180197507) + r1.yzyz;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r1.x = r1.x + r2.x;
r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.41099,0.400737494,-1.65660751,-1.73220503) + r1.yzyz;
r3.xyzw = g_shadowTextureSize.zwzw * float4(2.16099238,-1.08537996,-2.46827006,-0.123702496) + r1.yzyz;
r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r1.z = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.y;
r1.x = r1.x + r1.z;
r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.xy, r0.y).x;
r0.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.zw, r0.y).x;
r1.x = r1.x + r1.y;
r0.y = r1.x + r0.y;
r0.y = r0.y * 0.0833333358 + -1;
r0.z = g_cameraToShadow._m12 * r0.z;
r0.x = r0.x * g_cameraToShadow._m02 + r0.z;
r0.x = r0.w * g_cameraToShadow._m22 + r0.x;
r0.x = g_cameraToShadow._m32 + r0.x;
r0.x = -g_shadowFadeDistances.y + -r0.x;
r0.z = g_shadowFadeDistances.x + -g_shadowFadeDistances.y;
r0.x = saturate(r0.x / r0.z);
r0.x = r0.x * r0.y + 1;
r0.yzw = g_shadowCascadeColor.xyz + -r0.xxx;
o0.xyz = g_shadowCascadeColor.www * r0.yzw + r0.xxx;
o0.w = 1;
return;
}


Anyone willing to give me a hint? ^_^ thx

Edit:
This shader is from Elder Scrolls Online. The DX9 renderer has been dropped. I am trying to update the game for DX11.

I already found the VS for the shadows and made it 2D. So now I only have to correct it in PS, but can't figure it out for the life of me... :(

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


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

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

Posted 03/22/2016 09:51 PM   
@helifax try the correction in there and divide by projection, not * Also try to change the sign: r1.x -= .... and -r1.z and all the combinations. [code]r0.xy = (int2)v0.xy; r0.zw = float2(0,0); r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw; r0.y = -g_shadowPixelSize * 2.5 + r0.x; r1.xyz = v1.xyz / v1.zzz; r0.xzw = r1.xyz * -r0.xxx; r1.xyz = r0.xzw / r0.www; float4 stereo = StereoParams.Load(0); r1.x += stereo.x * (r1.z - stereo.y) / g_projection._m00; r1.xyz = r1.xyz * -r0.yyy; r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy; r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw; r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw; r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw; r1.xyz = r1.zxy / r1.www;[/code] Hope this works!
@helifax

try the correction in there and divide by projection, not *
Also try to change the sign: r1.x -= .... and -r1.z and all the combinations.

r0.xy = (int2)v0.xy;
r0.zw = float2(0,0);
r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw;
r0.y = -g_shadowPixelSize * 2.5 + r0.x;
r1.xyz = v1.xyz / v1.zzz;
r0.xzw = r1.xyz * -r0.xxx;
r1.xyz = r0.xzw / r0.www;

float4 stereo = StereoParams.Load(0);
r1.x += stereo.x * (r1.z - stereo.y) / g_projection._m00;


r1.xyz = r1.xyz * -r0.yyy;
r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy;
r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw;
r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw;
r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw;
r1.xyz = r1.zxy / r1.www;


Hope this works!

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

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

Posted 03/22/2016 11:17 PM   
[quote="DHR"]@helifax try the correction in there and divide by projection, not * Also try to change the sign: r1.x -= .... and -r1.z and all the combinations. [code]r0.xy = (int2)v0.xy; r0.zw = float2(0,0); r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw; r0.y = -g_shadowPixelSize * 2.5 + r0.x; r1.xyz = v1.xyz / v1.zzz; r0.xzw = r1.xyz * -r0.xxx; r1.xyz = r0.xzw / r0.www; float4 stereo = StereoParams.Load(0); r1.x += stereo.x * (r1.z - stereo.y) / g_projection._m00; r1.xyz = r1.xyz * -r0.yyy; r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy; r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw; r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw; r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw; r1.xyz = r1.zxy / r1.www;[/code] Hope this works![/quote] Big thx;) Already tried all possible combinations there;) (+/- and */divide) I can definitely see the shadows changing position but something... is not right... They are offset but not by the correct amount and the projection looks weird...
DHR said:@helifax

try the correction in there and divide by projection, not *
Also try to change the sign: r1.x -= .... and -r1.z and all the combinations.

r0.xy = (int2)v0.xy;
r0.zw = float2(0,0);
r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw;
r0.y = -g_shadowPixelSize * 2.5 + r0.x;
r1.xyz = v1.xyz / v1.zzz;
r0.xzw = r1.xyz * -r0.xxx;
r1.xyz = r0.xzw / r0.www;

float4 stereo = StereoParams.Load(0);
r1.x += stereo.x * (r1.z - stereo.y) / g_projection._m00;


r1.xyz = r1.xyz * -r0.yyy;
r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy;
r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw;
r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw;
r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw;
r1.xyz = r1.zxy / r1.www;


Hope this works!


Big thx;) Already tried all possible combinations there;) (+/- and */divide) I can definitely see the shadows changing position but something... is not right... They are offset but not by the correct amount and the projection looks weird...

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


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

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

Posted 03/22/2016 11:38 PM   
If anyone wants this and thinks they can fix it. Its all yours Saw Tales of Zestiria so decided to look at it. Everything should be fixed besides shadows. Seperate convergence setting for traveling, combat, story. Seperate hud depth for each. Removed minor hud element [Targetting enemy. Since you can tell which enemy your aiming at and speech bubble connectors] [url]https://s3.amazonaws.com/3drequest/shaderoverride.zip[/url]
If anyone wants this and thinks they can fix it. Its all yours

Saw Tales of Zestiria so decided to look at it. Everything should be fixed besides shadows.
Seperate convergence setting for traveling, combat, story.
Seperate hud depth for each.
Removed minor hud element [Targetting enemy. Since you can tell which enemy your aiming at and speech bubble connectors]

https://s3.amazonaws.com/3drequest/shaderoverride.zip

Co-founder of helixmod.blog.com

If you like one of my helixmod patches and want to donate. Can send to me through paypal - eqzitara@yahoo.com

Posted 03/23/2016 07:32 AM   
[quote="helifax"][quote="DHR"]@helifax try the correction in there and divide by projection, not * Also try to change the sign: r1.x -= .... and -r1.z and all the combinations. [code]r0.xy = (int2)v0.xy; r0.zw = float2(0,0); r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw; r0.y = -g_shadowPixelSize * 2.5 + r0.x; r1.xyz = v1.xyz / v1.zzz; r0.xzw = r1.xyz * -r0.xxx; r1.xyz = r0.xzw / r0.www; float4 stereo = StereoParams.Load(0); r1.x += stereo.x * (r1.z - stereo.y) / g_projection._m00; r1.xyz = r1.xyz * -r0.yyy; r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy; r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw; r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw; r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw; r1.xyz = r1.zxy / r1.www;[/code] Hope this works![/quote] Big thx;) Already tried all possible combinations there;) (+/- and */divide) I can definitely see the shadows changing position but something... is not right... They are offset but not by the correct amount and the projection looks weird...[/quote] Looking at the Dx9 fix, it looks like the shadows were fixed like this: [code] // f7b63c246c08f75d-ps_replace -> Shadows cbuffer cbPerLight : register(b0) { row_major float4x4 g_worldViewInverse : packoffset(c0); row_major float4x4 g_cameraToShadowProjector : packoffset(c4); row_major float4x4 g_cameraToShadow : packoffset(c8); row_major float4x4 g_cameraToSpotProjector : packoffset(c12); float4 g_characterLightTint : packoffset(c16); float4 g_lightColor : packoffset(c17); float4 g_triLightMidColor : packoffset(c18); float4 g_triLightBackColor : packoffset(c19); float4 g_lightProperties : packoffset(c20); float4 g_shadowTextureSize : packoffset(c21); float4 g_shadowCascadeColor : packoffset(c22); float4 g_shadowFadeDistances : packoffset(c23); float4 g_telegraphProperties : packoffset(c24); float g_shadowAlpha : packoffset(c25); float g_shadowPixelSize : packoffset(c25.y); } cbuffer cbPerFrame_Uncommon : register(b13) { row_major float4x4 g_projection : packoffset(c0); row_major float4x4 g_projectionInverse : packoffset(c4); row_major float4x4 g_mainView : packoffset(c8); float4 g_debugTweakables : packoffset(c12); float4 g_nearFarDepths : packoffset(c13); float4 g_reflectionPlane : packoffset(c14); } SamplerComparisonState shadowSamplerState_s : register(s0); Texture2D<float4> g_sceneTexture2 : register(t0); Texture2D<float4> g_shadowTexture : register(t1); // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float4 v0 : SV_POSITION0, float4 v1 : TEXCOORD0, float3 v2 : TEXCOORD1, out float4 o0 : SV_TARGET0) { float4 r0,r1,r2,r3; uint4 bitmask, uiDest; float4 fDest; r0.xy = (int2)v0.xy; r0.zw = float2(0,0); r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw; r0.y = -g_shadowPixelSize * 2.5 + r0.x; r1.xyz = v1.xyz / v1.zzz; r0.xzw = r1.xyz * -r0.xxx; r1.xyz = r0.xzw / r0.www; r1.xyz = r1.xyz * -r0.yyy; float4 stereo = StereoParams.Load(0); r1.x -= stereo.x * (-r1.z - stereo.y) / g_projection._m00; r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy; r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw; r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw; r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw; r1.xyz = r1.zxy / r1.www; r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.0174499992,1.68314505,-1.26170254,1.44229996) + r1.yzyz; r1.x = saturate(r1.x); r0.y = -1.99999995e-005 + r1.x; r1.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r2.xyzw = g_shadowTextureSize.zwzw * float4(-1.04089749,-0.65644753,0.868130028,0.508212507) + r1.yzyz; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r1.x = r1.x + r2.x; r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.142492503,-1.77057254,1.15585494,1.6522975) + r1.yzyz; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r1.x = r1.x + r2.x; r2.xyzw = g_shadowTextureSize.zwzw * float4(0.904980004,-1.16333497,2.00254989,0.180197507) + r1.yzyz; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r1.x = r1.x + r2.x; r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.41099,0.400737494,-1.65660751,-1.73220503) + r1.yzyz; r3.xyzw = g_shadowTextureSize.zwzw * float4(2.16099238,-1.08537996,-2.46827006,-0.123702496) + r1.yzyz; r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r1.z = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.y; r1.x = r1.x + r1.z; r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.xy, r0.y).x; r0.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.zw, r0.y).x; r1.x = r1.x + r1.y; r0.y = r1.x + r0.y; r0.y = r0.y * 0.0833333358 + -1; r0.z = g_cameraToShadow._m12 * r0.z; r0.x = r0.x * g_cameraToShadow._m02 + r0.z; r0.x = r0.w * g_cameraToShadow._m22 + r0.x; r0.x = g_cameraToShadow._m32 + r0.x; r0.x = -g_shadowFadeDistances.y + -r0.x; r0.z = g_shadowFadeDistances.x + -g_shadowFadeDistances.y; r0.x = saturate(r0.x / r0.z); r0.x = r0.x * r0.y + 1; r0.yzw = g_shadowCascadeColor.xyz + -r0.xxx; o0.xyz = g_shadowCascadeColor.www * r0.yzw + r0.xxx; o0.w = 1; return; }[/code] "g_cameraToShadow" may need to be stereoized, as well. Also looking at the accompanying dx9 VS, the output position isn't reverse stereoized. Instead one of the texcoords is stereoized: [code]//Shadows - Make 2d for fixing in PS //And Lighting // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // Parameters: // // float4x4 g_worldView; // float4x4 g_worldViewProj; // // // Registers: // // Name Reg Size // --------------- ----- ---- // g_worldViewProj c0 4 // g_worldView c4 3 // // // Default values: // // g_worldViewProj // c0 = { 0, 0, 0, 0 }; // c1 = { 0, 0, 0, 0 }; // c2 = { 0, 0, 0, 0 }; // c3 = { 0, 0, 0, 0 }; // // g_worldView // c4 = { 0, 0, 0, 0 }; // c5 = { 0, 0, 0, 0 }; // c6 = { 0, 0, 0, 0 }; // vs_3_0 def c7, 1, 0, 0, 0 def c220, 1, 0, 0.0625, 2 dcl_2d s3 dcl_position v0 dcl_position o0 dcl_texcoord o1.xyz dcl_texcoord1 o2.xyz //EyePos dcl_texcoord2 o3.xyz //+ shifted version of o1 mad r0, v0.xyzx, c7.xxxy, c7.yyyx dp4 r10.x, r0, c0 dp4 r10.y, r0, c1 dp4 r1.x, r0, c2 dp4 r1.y, r0, c3 min r10.z, r1.y, r1.x mov r10.w, r1.y mov o0, r10 dp4 r20.x, r0, c4 dp4 r20.y, r0, c5 dp4 r20.z, r0, c6 mov o1.xyz, r20.xyz //unstereoized texldl r24, c220.z, s3 add r24.y, -r20.z, -r24.y mul r24.x, r24.x, r24.y rcp r25.x, c190.x mul r24.x, r24.x, r25.x //multiply inverse projection add r20.x, r20.x, r24.x //Must be positive for normal shadows mov o3.xyz, r20.xyz //stereoized version of o1.xyz mov o2.x, c4.w //Eye Pos mov o2.y, c5.w mov o2.z, c6.w // approximately 13 instruction slots used [/code]
helifax said:
DHR said:@helifax

try the correction in there and divide by projection, not *
Also try to change the sign: r1.x -= .... and -r1.z and all the combinations.

r0.xy = (int2)v0.xy;
r0.zw = float2(0,0);
r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw;
r0.y = -g_shadowPixelSize * 2.5 + r0.x;
r1.xyz = v1.xyz / v1.zzz;
r0.xzw = r1.xyz * -r0.xxx;
r1.xyz = r0.xzw / r0.www;

float4 stereo = StereoParams.Load(0);
r1.x += stereo.x * (r1.z - stereo.y) / g_projection._m00;


r1.xyz = r1.xyz * -r0.yyy;
r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy;
r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw;
r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw;
r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw;
r1.xyz = r1.zxy / r1.www;


Hope this works!


Big thx;) Already tried all possible combinations there;) (+/- and */divide) I can definitely see the shadows changing position but something... is not right... They are offset but not by the correct amount and the projection looks weird...


Looking at the Dx9 fix, it looks like the shadows were fixed like this:
// f7b63c246c08f75d-ps_replace -> Shadows

cbuffer cbPerLight : register(b0)
{
row_major float4x4 g_worldViewInverse : packoffset(c0);
row_major float4x4 g_cameraToShadowProjector : packoffset(c4);
row_major float4x4 g_cameraToShadow : packoffset(c8);
row_major float4x4 g_cameraToSpotProjector : packoffset(c12);
float4 g_characterLightTint : packoffset(c16);
float4 g_lightColor : packoffset(c17);
float4 g_triLightMidColor : packoffset(c18);
float4 g_triLightBackColor : packoffset(c19);
float4 g_lightProperties : packoffset(c20);
float4 g_shadowTextureSize : packoffset(c21);
float4 g_shadowCascadeColor : packoffset(c22);
float4 g_shadowFadeDistances : packoffset(c23);
float4 g_telegraphProperties : packoffset(c24);
float g_shadowAlpha : packoffset(c25);
float g_shadowPixelSize : packoffset(c25.y);
}

cbuffer cbPerFrame_Uncommon : register(b13)
{
row_major float4x4 g_projection : packoffset(c0);
row_major float4x4 g_projectionInverse : packoffset(c4);
row_major float4x4 g_mainView : packoffset(c8);
float4 g_debugTweakables : packoffset(c12);
float4 g_nearFarDepths : packoffset(c13);
float4 g_reflectionPlane : packoffset(c14);
}

SamplerComparisonState shadowSamplerState_s : register(s0);
Texture2D<float4> g_sceneTexture2 : register(t0);
Texture2D<float4> g_shadowTexture : register(t1);


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


void main(
float4 v0 : SV_POSITION0,
float4 v1 : TEXCOORD0,
float3 v2 : TEXCOORD1,
out float4 o0 : SV_TARGET0)
{
float4 r0,r1,r2,r3;
uint4 bitmask, uiDest;
float4 fDest;


r0.xy = (int2)v0.xy;
r0.zw = float2(0,0);
r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw;
r0.y = -g_shadowPixelSize * 2.5 + r0.x;
r1.xyz = v1.xyz / v1.zzz;
r0.xzw = r1.xyz * -r0.xxx;
r1.xyz = r0.xzw / r0.www;
r1.xyz = r1.xyz * -r0.yyy;

float4 stereo = StereoParams.Load(0);
r1.x -= stereo.x * (-r1.z - stereo.y) / g_projection._m00;

r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy;
r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw;
r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw;
r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw;
r1.xyz = r1.zxy / r1.www;
r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.0174499992,1.68314505,-1.26170254,1.44229996) + r1.yzyz;
r1.x = saturate(r1.x);
r0.y = -1.99999995e-005 + r1.x;
r1.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r2.xyzw = g_shadowTextureSize.zwzw * float4(-1.04089749,-0.65644753,0.868130028,0.508212507) + r1.yzyz;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r1.x = r1.x + r2.x;
r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.142492503,-1.77057254,1.15585494,1.6522975) + r1.yzyz;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r1.x = r1.x + r2.x;
r2.xyzw = g_shadowTextureSize.zwzw * float4(0.904980004,-1.16333497,2.00254989,0.180197507) + r1.yzyz;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r1.x = r1.x + r2.x;
r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.41099,0.400737494,-1.65660751,-1.73220503) + r1.yzyz;
r3.xyzw = g_shadowTextureSize.zwzw * float4(2.16099238,-1.08537996,-2.46827006,-0.123702496) + r1.yzyz;
r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r1.z = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.y;
r1.x = r1.x + r1.z;
r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.xy, r0.y).x;
r0.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.zw, r0.y).x;
r1.x = r1.x + r1.y;
r0.y = r1.x + r0.y;
r0.y = r0.y * 0.0833333358 + -1;

r0.z = g_cameraToShadow._m12 * r0.z;
r0.x = r0.x * g_cameraToShadow._m02 + r0.z;
r0.x = r0.w * g_cameraToShadow._m22 + r0.x;
r0.x = g_cameraToShadow._m32 + r0.x;
r0.x = -g_shadowFadeDistances.y + -r0.x;
r0.z = g_shadowFadeDistances.x + -g_shadowFadeDistances.y;
r0.x = saturate(r0.x / r0.z);
r0.x = r0.x * r0.y + 1;
r0.yzw = g_shadowCascadeColor.xyz + -r0.xxx;
o0.xyz = g_shadowCascadeColor.www * r0.yzw + r0.xxx;
o0.w = 1;
return;
}


"g_cameraToShadow" may need to be stereoized, as well.

Also looking at the accompanying dx9 VS, the output position isn't reverse stereoized. Instead one of the texcoords is stereoized:

//Shadows - Make 2d for fixing in PS
//And Lighting
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
// float4x4 g_worldView;
// float4x4 g_worldViewProj;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// g_worldViewProj c0 4
// g_worldView c4 3
//
//
// Default values:
//
// g_worldViewProj
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
// c2 = { 0, 0, 0, 0 };
// c3 = { 0, 0, 0, 0 };
//
// g_worldView
// c4 = { 0, 0, 0, 0 };
// c5 = { 0, 0, 0, 0 };
// c6 = { 0, 0, 0, 0 };
//

vs_3_0
def c7, 1, 0, 0, 0
def c220, 1, 0, 0.0625, 2
dcl_2d s3
dcl_position v0
dcl_position o0
dcl_texcoord o1.xyz
dcl_texcoord1 o2.xyz //EyePos

dcl_texcoord2 o3.xyz //+ shifted version of o1

mad r0, v0.xyzx, c7.xxxy, c7.yyyx
dp4 r10.x, r0, c0
dp4 r10.y, r0, c1
dp4 r1.x, r0, c2
dp4 r1.y, r0, c3

min r10.z, r1.y, r1.x
mov r10.w, r1.y

mov o0, r10

dp4 r20.x, r0, c4
dp4 r20.y, r0, c5
dp4 r20.z, r0, c6

mov o1.xyz, r20.xyz //unstereoized

texldl r24, c220.z, s3
add r24.y, -r20.z, -r24.y
mul r24.x, r24.x, r24.y
rcp r25.x, c190.x
mul r24.x, r24.x, r25.x //multiply inverse projection
add r20.x, r20.x, r24.x //Must be positive for normal shadows
mov o3.xyz, r20.xyz //stereoized version of o1.xyz

mov o2.x, c4.w //Eye Pos
mov o2.y, c5.w
mov o2.z, c6.w

// approximately 13 instruction slots used

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

Posted 03/23/2016 09:37 AM   
Thx, 4everAwake, I will try the same when I will be able to. Yes I looked in the original fix and saw the extra texcood being stereorized there. I haven't tried that one yet, but if I remove the position stereo the shadows do go to ScreenDepth (2D). Will play a bit more with it;) Thank you again!
Thx, 4everAwake,
I will try the same when I will be able to. Yes I looked in the original fix and saw the extra texcood being stereorized there. I haven't tried that one yet, but if I remove the position stereo the shadows do go to ScreenDepth (2D).

Will play a bit more with it;) Thank you again!

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


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

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

Posted 03/23/2016 10:19 AM   
Hmm...didn't work exactly and I think I know why but don't know to to "translate it": VS from Original FIX: [code] //Shadows - Make 2d for fixing in PS //And Lighting // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // Parameters: // // float4x4 g_worldView; // float4x4 g_worldViewProj; // // // Registers: // // Name Reg Size // --------------- ----- ---- // g_worldViewProj c0 4 // g_worldView c4 3 // // // Default values: // // g_worldViewProj // c0 = { 0, 0, 0, 0 }; // c1 = { 0, 0, 0, 0 }; // c2 = { 0, 0, 0, 0 }; // c3 = { 0, 0, 0, 0 }; // // g_worldView // c4 = { 0, 0, 0, 0 }; // c5 = { 0, 0, 0, 0 }; // c6 = { 0, 0, 0, 0 }; // vs_3_0 def c7, 1, 0, 0, 0 def c220, 1, 0, 0.0625, 2 dcl_2d s3 dcl_position v0 dcl_position o0 dcl_texcoord o1.xyz dcl_texcoord1 o2.xyz //EyePos dcl_texcoord2 o3.xyz //+ shifted version of o1 mad r0, v0.xyzx, c7.xxxy, c7.yyyx dp4 r10.x, r0, c0 dp4 r10.y, r0, c1 dp4 r1.x, r0, c2 dp4 r1.y, r0, c3 min r10.z, r1.y, r1.x mov r10.w, r1.y mov o0, r10 dp4 r20.x, r0, c4 dp4 r20.y, r0, c5 dp4 r20.z, r0, c6 mov o1.xyz, r20.xyz //unshifted texldl r24, c220.z, s3 add r24.y, -r20.z, -r24.y mul r24.x, r24.x, r24.y rcp r25.x, c190.x mul r24.x, r24.x, r25.x add r20.x, r20.x, r24.x //Must be positive for normal shadows mov o3.xyz, r20.xyz mov o2.x, c4.w //Eye Pos mov o2.y, c5.w mov o2.z, c6.w // approximately 13 instruction slots used [/code] I see he is declaring an extra output o3 that is basically o1 + stereo correction In original PS from fix: [code] //SHADOWS // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // Parameters: // // float4x4 g_cameraToShadowProjector; // float4 g_sceneTextureSize; // float4 g_shadowCascadeColor; // float4 g_shadowFadeDistances; // float g_shadowPixelSize; // float4 g_shadowTextureSize; // float4x4 g_worldView; // sampler2D sceneSamplerDepth; // sampler2D shadowSampler; // // // Registers: // // Name Reg Size // ------------------------- ----- ---- // g_cameraToShadowProjector c0 4 // g_worldView c4 3 // g_sceneTextureSize c7 1 // g_shadowTextureSize c8 1 // g_shadowCascadeColor c9 1 // g_shadowFadeDistances c10 1 // g_shadowPixelSize c11 1 // sceneSamplerDepth s0 1 // shadowSampler s1 1 // // // Default values: // // g_cameraToShadowProjector // c0 = { 0, 0, 0, 0 }; // c1 = { 0, 0, 0, 0 }; // c2 = { 0, 0, 0, 0 }; // c3 = { 0, 0, 0, 0 }; // // g_worldView // c4 = { 0, 0, 0, 0 }; // c5 = { 0, 0, 0, 0 }; // c6 = { 0, 0, 0, 0 }; // // g_sceneTextureSize // c7 = { 0, 0, 0, 0 }; // // g_shadowTextureSize // c8 = { 0, 0, 0, 0 }; // // g_shadowCascadeColor // c9 = { 0, 0, 0, 0 }; // // g_shadowFadeDistances // c10 = { 0, 0, 0, 0 }; // // g_shadowPixelSize // c11 = { 0, 0, 0, 0 }; // ps_3_0 def c12, 0.5, 0, 2.5, 1 def c13, -1.99999995e-005, 0.0833333358, 0, 0 def c14, -0.0174499992, 1.68314505, -1.26170254, 1.44229996 def c15, -1.04089749, -0.65644753, 0.868130028, 0.508212507 def c16, -0.142492503, -1.77057254, 1.15585494, 1.6522975 def c17, 0.904980004, -1.16333497, 2.00254989, 0.180197507 def c18, -0.41099, 0.400737494, -1.65660751, -1.73220503 def c19, 2.16099238, -1.08537996, -2.46827006, -0.123702496 def c220, 1, 0.835, 0.0625, 0.5 dcl_2d s15 dcl_texcoord v0.xyz dcl_texcoord2 v3.xyz //shifted bersion of v0, from VS A66921A2 dcl vPos.xy dcl_2d s0 dcl_2d s1 add r0.xy, c12.x, vPos mul r0.xy, r0, c7.zwzw mov r0.zw, c12.y texldl r0, r0, s0 rcp r0.y, v3.z mul r0.yzw, r0.y, v3.xxyz rcp r10.y, v0.z mul r10.yzw, r10.y, v0.xxyz mul r1.xyz, -r0.x, r0.yzww rcp r1.w, r1.z mul r1.xyz, r1.w, r1 mov r2.z, c12.z mad r1.w, c11.x, -r2.z, r0.x mul r1.xyz, -r1.w, r1 mov r1.w, c12.w texldl r24, c220.z, s15 add r24.y, -r1.z, -r24.y mul r24.x, r24.x, r24.y rcp r25.x, c190.x mul r24.x, r24.x, r25.x add r1.x, r1.x, -r24.x dp4 r2.x, r1, c3 rcp r2.x, r2.x dp4 r3.x, r1, c0 dp4 r3.y, r1, c1 dp4 r3.z, r1, c2 mul r1.xyz, r2.x, r3.zxyw mov_sat r1.x, r1.x add r2.z, r1.x, c13.x mov r3.zw, c8 mad r4, r3.zwzw, c14, r1.yzyz mul r2.xyw, r4.xyzx, c12.wwzy mul r4.xyw, r4.zwzx, c12.wwzy texldl r5, r2, s1 mov r4.z, r2.z texldl r2, r4, s1 add r1.x, r2.x, r5.x mad r2, r3.zwzw, c15.zwxy, r1.yzyz mov r4.xy, r2.zwzw texldl r5, r4, s1 mov r2.zw, r4 add r1.x, r1.x, r5.x texldl r4, r2, s1 add r1.x, r1.x, r4.x mad r4, r3.zwzw, c16.zwxy, r1.yzyz mov r2.xy, r4.zwzw texldl r5, r2, s1 mov r4.zw, r2 add r1.x, r1.x, r5.x texldl r2, r4, s1 add r1.x, r1.x, r2.x mad r2, r3.zwzw, c17.zwxy, r1.yzyz mov r4.xy, r2.zwzw texldl r5, r4, s1 mov r2.zw, r4 add r1.x, r1.x, r5.x texldl r4, r2, s1 add r1.x, r1.x, r4.x mad r4, r3.zwzw, c18.zwxy, r1.yzyz mad r3, r3.zwzw, c19.zwxy, r1.yzyz mov r2.xy, r4.zwzw texldl r5, r2, s1 mov r4.zw, r2 add r1.x, r1.x, r5.x texldl r2, r4, s1 add r1.x, r1.x, r2.x mov r4.xy, r3.zwzw texldl r2, r4, s1 mov r3.zw, r4 texldl r3, r3, s1 add r1.x, r1.x, r2.x add r1.x, r3.x, r1.x mul r1.y, r1.x, c13.y mov r2.xyz, c9 mad r1.xzw, r1.x, -c13.y, r2.xyyz mad r1.xyz, c9.w, r1.xzww, r1.y mov r2.x, -c4.w //Eyepos mov r2.y, -c5.w mov r2.z, -c6.w // mad r0.xyz, r0.yzww, -r0.x, r2 mad r0.xyz, r10.yzww, -r0.x, r2 dp3 r0.x, r0, r0 rsq r0.x, r0.x rcp r0.x, r0.x add r0.x, r0.x, -c10.y add r0.y, -c10.y, c10.x rcp r0.y, r0.y mul_sat r0.x, r0.y, r0.x mul oC0.xyz, r0.x, r1 mov oC0.w, r0.x // approximately 94 instruction slots used (26 texture, 68 arithmetic) [/code] He is using v3 to put in r0 and than later on adds the stereo to r1. Now in the DX11 version the VS is like this: [code] // // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // using 3Dmigoto v1.2.34 on Tue Mar 22 21:59:44 2016 // // // Buffer Definitions: // // cbuffer cbPerObject // { // // row_major float4x4 g_worldViewProj;// Offset: 0 Size: 64 // row_major float4x4 g_world; // Offset: 64 Size: 64 [unused] // row_major float4x4 g_worldView; // Offset: 128 Size: 64 // float4 g_uvScrolling; // Offset: 192 Size: 16 [unused] // float4 g_texCoordScaleBias; // Offset: 208 Size: 16 [unused] // float4 g_boundingSphere; // Offset: 224 Size: 16 [unused] // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // cbPerObject cbuffer NA NA 0 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // POSITION 0 xyz 0 NONE float xyz // NORMAL 0 xyz 1 NONE float // COLOR 0 xyzw 2 NONE float // TEXCOORD 0 xy 3 NONE float // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_POSITION 0 xyzw 0 POS float xyzw // TEXCOORD 0 xyz 1 NONE float xyz // TEXCOORD 1 xyz 2 NONE float xyz // vs_4_0 dcl_constantbuffer cb0[12], immediateIndexed dcl_input v0.xyz dcl_output_siv o0.xyzw, position dcl_output o1.xyz dcl_output o2.xyz dcl_temps 1 mul r0.xyzw, v0.yyyy, cb0[1].xyzw mad r0.xyzw, v0.xxxx, cb0[0].xyzw, r0.xyzw mad r0.xyzw, v0.zzzz, cb0[2].xyzw, r0.xyzw add r0.xyzw, r0.xyzw, cb0[3].xyzw min o0.z, r0.w, r0.z mov o0.xyw, r0.xyxw mul r0.xyz, v0.yyyy, cb0[9].xyzx mad r0.xyz, v0.xxxx, cb0[8].xyzx, r0.xyzx mad r0.xyz, v0.zzzz, cb0[10].xyzx, r0.xyzx add o1.xyz, r0.xyzx, cb0[11].xyzx mov o2.xyz, cb0[11].xyzx ret // Approximately 12 instruction slots used [/code] And the PS: [code] // // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // using 3Dmigoto v1.2.34 on Tue Mar 22 21:03:37 2016 // // // Buffer Definitions: // // cbuffer cbPerLight // { // // row_major float4x4 g_worldViewInverse;// Offset: 0 Size: 64 [unused] // row_major float4x4 g_cameraToShadowProjector;// Offset: 64 Size: 64 // row_major float4x4 g_cameraToShadow;// Offset: 128 Size: 64 // row_major float4x4 g_cameraToSpotProjector;// Offset: 192 Size: 64 [unused] // float4 g_characterLightTint; // Offset: 256 Size: 16 [unused] // float4 g_lightColor; // Offset: 272 Size: 16 [unused] // float4 g_triLightMidColor; // Offset: 288 Size: 16 [unused] // float4 g_triLightBackColor; // Offset: 304 Size: 16 [unused] // float4 g_lightProperties; // Offset: 320 Size: 16 [unused] // float4 g_shadowTextureSize; // Offset: 336 Size: 16 // float4 g_shadowCascadeColor; // Offset: 352 Size: 16 // float4 g_shadowFadeDistances; // Offset: 368 Size: 16 // float4 g_telegraphProperties; // Offset: 384 Size: 16 [unused] // float g_shadowAlpha; // Offset: 400 Size: 4 [unused] // float g_shadowPixelSize; // Offset: 404 Size: 4 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // shadowSamplerState sampler_c NA NA 0 1 // g_sceneTexture2 texture float4 2d 0 1 // g_shadowTexture texture float4 2d 1 1 // cbPerLight cbuffer NA NA 0 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_POSITION 0 xyzw 0 POS float xy // TEXCOORD 0 xyz 1 NONE float xyz // TEXCOORD 1 xyz 2 NONE float // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_TARGET 0 xyzw 0 TARGET float xyzw // ps_4_0 dcl_constantbuffer cb0[26], immediateIndexed dcl_sampler s0, mode_comparison dcl_resource_texture2d (float,float,float,float) t0 dcl_resource_texture2d (float,float,float,float) t1 dcl_input_ps_siv linear noperspective v0.xy, position dcl_input_ps linear v1.xyz dcl_output o0.xyzw dcl_temps 4 ftoi r0.xy, v0.xyxx mov r0.zw, l(0,0,0,0) ld_aoffimmi(0,0,0) r0.xyzw, r0.xyzw, t0.xyzw mad r0.y, -cb0[25].y, l(2.500000), r0.x div r1.xyz, v1.xyzx, v1.zzzz mul r0.xzw, -r0.xxxx, r1.xxyz div r1.xyz, r0.xzwx, r0.wwww mul r1.xyz, -r0.yyyy, r1.xyzx mul r2.xyzw, r1.yyyy, cb0[5].xyzw mad r2.xyzw, r1.xxxx, cb0[4].xyzw, r2.xyzw mad r1.xyzw, r1.zzzz, cb0[6].xyzw, r2.xyzw add r1.xyzw, r1.xyzw, cb0[7].xyzw div r1.xyz, r1.zxyz, r1.wwww mad r2.xyzw, cb0[21].zwzw, l(-0.017450, 1.683145, -1.26170254, 1.442300), r1.yzyz mov_sat r1.x, r1.x add r0.y, r1.x, l(-0.000020) sample_c_lz r1.x, r2.xyxx, t1.xxxx, s0, r0.y sample_c_lz r1.w, r2.zwzz, t1.xxxx, s0, r0.y add r1.x, r1.w, r1.x mad r2.xyzw, cb0[21].zwzw, l(-1.04089749, -0.656447530, 0.868130, 0.508212507), r1.yzyz sample_c_lz r1.w, r2.xyxx, t1.xxxx, s0, r0.y sample_c_lz r2.x, r2.zwzz, t1.xxxx, s0, r0.y add r1.x, r1.w, r1.x add r1.x, r2.x, r1.x mad r2.xyzw, cb0[21].zwzw, l(-0.142492503, -1.77057254, 1.155855, 1.65229750), r1.yzyz sample_c_lz r1.w, r2.xyxx, t1.xxxx, s0, r0.y sample_c_lz r2.x, r2.zwzz, t1.xxxx, s0, r0.y add r1.x, r1.w, r1.x add r1.x, r2.x, r1.x mad r2.xyzw, cb0[21].zwzw, l(0.904980, -1.163335, 2.002550, 0.180197507), r1.yzyz sample_c_lz r1.w, r2.xyxx, t1.xxxx, s0, r0.y sample_c_lz r2.x, r2.zwzz, t1.xxxx, s0, r0.y add r1.x, r1.w, r1.x add r1.x, r2.x, r1.x mad r2.xyzw, cb0[21].zwzw, l(-0.410990, 0.400737494, -1.65660751, -1.732205), r1.yzyz mad r3.xyzw, cb0[21].zwzw, l(2.16099238, -1.085380, -2.468270, -0.123702496), r1.yzyz sample_c_lz r1.y, r2.xyxx, t1.xxxx, s0, r0.y sample_c_lz r1.z, r2.zwzz, t1.xxxx, s0, r0.y add r1.x, r1.y, r1.x add r1.x, r1.z, r1.x sample_c_lz r1.y, r3.xyxx, t1.xxxx, s0, r0.y sample_c_lz r0.y, r3.zwzz, t1.xxxx, s0, r0.y add r1.x, r1.y, r1.x add r0.y, r0.y, r1.x mad r0.y, r0.y, l(0.0833333358), l(-1.000000) mul r0.z, r0.z, cb0[9].z mad r0.x, r0.x, cb0[8].z, r0.z mad r0.x, r0.w, cb0[10].z, r0.x add r0.x, r0.x, cb0[11].z add r0.x, -r0.x, -cb0[23].y add r0.z, -cb0[23].y, cb0[23].x div_sat r0.x, r0.x, r0.z mad r0.x, r0.x, r0.y, l(1.000000) add r0.yzw, -r0.xxxx, cb0[22].xxyz mad o0.xyz, cb0[22].wwww, r0.yzwy, r0.xxxx mov o0.w, l(1.000000) ret // Approximately 57 instruction slots used [/code] I would love to translate this from the vs/ps_3 to vs/ps_4 but have no idea how... Anyone willing to help?:)
Hmm...didn't work exactly and I think I know why but don't know to to "translate it":

VS from Original FIX:
//Shadows - Make 2d for fixing in PS
//And Lighting
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
// float4x4 g_worldView;
// float4x4 g_worldViewProj;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// g_worldViewProj c0 4
// g_worldView c4 3
//
//
// Default values:
//
// g_worldViewProj
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
// c2 = { 0, 0, 0, 0 };
// c3 = { 0, 0, 0, 0 };
//
// g_worldView
// c4 = { 0, 0, 0, 0 };
// c5 = { 0, 0, 0, 0 };
// c6 = { 0, 0, 0, 0 };
//

vs_3_0
def c7, 1, 0, 0, 0
def c220, 1, 0, 0.0625, 2
dcl_2d s3
dcl_position v0
dcl_position o0
dcl_texcoord o1.xyz
dcl_texcoord1 o2.xyz //EyePos

dcl_texcoord2 o3.xyz //+ shifted version of o1

mad r0, v0.xyzx, c7.xxxy, c7.yyyx
dp4 r10.x, r0, c0
dp4 r10.y, r0, c1
dp4 r1.x, r0, c2
dp4 r1.y, r0, c3

min r10.z, r1.y, r1.x
mov r10.w, r1.y

mov o0, r10

dp4 r20.x, r0, c4
dp4 r20.y, r0, c5
dp4 r20.z, r0, c6

mov o1.xyz, r20.xyz //unshifted

texldl r24, c220.z, s3
add r24.y, -r20.z, -r24.y
mul r24.x, r24.x, r24.y
rcp r25.x, c190.x
mul r24.x, r24.x, r25.x
add r20.x, r20.x, r24.x //Must be positive for normal shadows
mov o3.xyz, r20.xyz

mov o2.x, c4.w //Eye Pos
mov o2.y, c5.w
mov o2.z, c6.w

// approximately 13 instruction slots used


I see he is declaring an extra output o3 that is basically o1 + stereo correction

In original PS from fix:
//SHADOWS
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
// float4x4 g_cameraToShadowProjector;
// float4 g_sceneTextureSize;
// float4 g_shadowCascadeColor;
// float4 g_shadowFadeDistances;
// float g_shadowPixelSize;
// float4 g_shadowTextureSize;
// float4x4 g_worldView;
// sampler2D sceneSamplerDepth;
// sampler2D shadowSampler;
//
//
// Registers:
//
// Name Reg Size
// ------------------------- ----- ----
// g_cameraToShadowProjector c0 4
// g_worldView c4 3
// g_sceneTextureSize c7 1
// g_shadowTextureSize c8 1
// g_shadowCascadeColor c9 1
// g_shadowFadeDistances c10 1
// g_shadowPixelSize c11 1
// sceneSamplerDepth s0 1
// shadowSampler s1 1
//
//
// Default values:
//
// g_cameraToShadowProjector
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
// c2 = { 0, 0, 0, 0 };
// c3 = { 0, 0, 0, 0 };
//
// g_worldView
// c4 = { 0, 0, 0, 0 };
// c5 = { 0, 0, 0, 0 };
// c6 = { 0, 0, 0, 0 };
//
// g_sceneTextureSize
// c7 = { 0, 0, 0, 0 };
//
// g_shadowTextureSize
// c8 = { 0, 0, 0, 0 };
//
// g_shadowCascadeColor
// c9 = { 0, 0, 0, 0 };
//
// g_shadowFadeDistances
// c10 = { 0, 0, 0, 0 };
//
// g_shadowPixelSize
// c11 = { 0, 0, 0, 0 };
//

ps_3_0
def c12, 0.5, 0, 2.5, 1
def c13, -1.99999995e-005, 0.0833333358, 0, 0
def c14, -0.0174499992, 1.68314505, -1.26170254, 1.44229996
def c15, -1.04089749, -0.65644753, 0.868130028, 0.508212507
def c16, -0.142492503, -1.77057254, 1.15585494, 1.6522975
def c17, 0.904980004, -1.16333497, 2.00254989, 0.180197507
def c18, -0.41099, 0.400737494, -1.65660751, -1.73220503
def c19, 2.16099238, -1.08537996, -2.46827006, -0.123702496
def c220, 1, 0.835, 0.0625, 0.5
dcl_2d s15
dcl_texcoord v0.xyz
dcl_texcoord2 v3.xyz //shifted bersion of v0, from VS A66921A2
dcl vPos.xy
dcl_2d s0
dcl_2d s1

add r0.xy, c12.x, vPos
mul r0.xy, r0, c7.zwzw
mov r0.zw, c12.y
texldl r0, r0, s0

rcp r0.y, v3.z
mul r0.yzw, r0.y, v3.xxyz

rcp r10.y, v0.z
mul r10.yzw, r10.y, v0.xxyz

mul r1.xyz, -r0.x, r0.yzww

rcp r1.w, r1.z
mul r1.xyz, r1.w, r1

mov r2.z, c12.z
mad r1.w, c11.x, -r2.z, r0.x
mul r1.xyz, -r1.w, r1
mov r1.w, c12.w

texldl r24, c220.z, s15
add r24.y, -r1.z, -r24.y
mul r24.x, r24.x, r24.y
rcp r25.x, c190.x
mul r24.x, r24.x, r25.x
add r1.x, r1.x, -r24.x

dp4 r2.x, r1, c3
rcp r2.x, r2.x
dp4 r3.x, r1, c0
dp4 r3.y, r1, c1
dp4 r3.z, r1, c2

mul r1.xyz, r2.x, r3.zxyw
mov_sat r1.x, r1.x
add r2.z, r1.x, c13.x
mov r3.zw, c8
mad r4, r3.zwzw, c14, r1.yzyz
mul r2.xyw, r4.xyzx, c12.wwzy
mul r4.xyw, r4.zwzx, c12.wwzy
texldl r5, r2, s1
mov r4.z, r2.z
texldl r2, r4, s1
add r1.x, r2.x, r5.x
mad r2, r3.zwzw, c15.zwxy, r1.yzyz
mov r4.xy, r2.zwzw
texldl r5, r4, s1
mov r2.zw, r4
add r1.x, r1.x, r5.x
texldl r4, r2, s1
add r1.x, r1.x, r4.x
mad r4, r3.zwzw, c16.zwxy, r1.yzyz
mov r2.xy, r4.zwzw
texldl r5, r2, s1
mov r4.zw, r2
add r1.x, r1.x, r5.x
texldl r2, r4, s1
add r1.x, r1.x, r2.x
mad r2, r3.zwzw, c17.zwxy, r1.yzyz
mov r4.xy, r2.zwzw
texldl r5, r4, s1
mov r2.zw, r4
add r1.x, r1.x, r5.x
texldl r4, r2, s1
add r1.x, r1.x, r4.x
mad r4, r3.zwzw, c18.zwxy, r1.yzyz
mad r3, r3.zwzw, c19.zwxy, r1.yzyz
mov r2.xy, r4.zwzw
texldl r5, r2, s1
mov r4.zw, r2
add r1.x, r1.x, r5.x
texldl r2, r4, s1
add r1.x, r1.x, r2.x
mov r4.xy, r3.zwzw
texldl r2, r4, s1
mov r3.zw, r4
texldl r3, r3, s1
add r1.x, r1.x, r2.x
add r1.x, r3.x, r1.x
mul r1.y, r1.x, c13.y
mov r2.xyz, c9
mad r1.xzw, r1.x, -c13.y, r2.xyyz
mad r1.xyz, c9.w, r1.xzww, r1.y

mov r2.x, -c4.w //Eyepos
mov r2.y, -c5.w
mov r2.z, -c6.w

// mad r0.xyz, r0.yzww, -r0.x, r2
mad r0.xyz, r10.yzww, -r0.x, r2

dp3 r0.x, r0, r0
rsq r0.x, r0.x
rcp r0.x, r0.x
add r0.x, r0.x, -c10.y
add r0.y, -c10.y, c10.x
rcp r0.y, r0.y
mul_sat r0.x, r0.y, r0.x
mul oC0.xyz, r0.x, r1
mov oC0.w, r0.x

// approximately 94 instruction slots used (26 texture, 68 arithmetic)


He is using v3 to put in r0 and than later on adds the stereo to r1.

Now in the DX11 version the VS is like this:

//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// using 3Dmigoto v1.2.34 on Tue Mar 22 21:59:44 2016
//
//
// Buffer Definitions:
//
// cbuffer cbPerObject
// {
//
// row_major float4x4 g_worldViewProj;// Offset: 0 Size: 64
// row_major float4x4 g_world; // Offset: 64 Size: 64 [unused]
// row_major float4x4 g_worldView; // Offset: 128 Size: 64
// float4 g_uvScrolling; // Offset: 192 Size: 16 [unused]
// float4 g_texCoordScaleBias; // Offset: 208 Size: 16 [unused]
// float4 g_boundingSphere; // Offset: 224 Size: 16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cbPerObject cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 xyz 0 NONE float xyz
// NORMAL 0 xyz 1 NONE float
// COLOR 0 xyzw 2 NONE float
// TEXCOORD 0 xy 3 NONE float
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xyz 1 NONE float xyz
// TEXCOORD 1 xyz 2 NONE float xyz
//
vs_4_0
dcl_constantbuffer cb0[12], immediateIndexed
dcl_input v0.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xyz
dcl_temps 1
mul r0.xyzw, v0.yyyy, cb0[1].xyzw
mad r0.xyzw, v0.xxxx, cb0[0].xyzw, r0.xyzw
mad r0.xyzw, v0.zzzz, cb0[2].xyzw, r0.xyzw
add r0.xyzw, r0.xyzw, cb0[3].xyzw
min o0.z, r0.w, r0.z
mov o0.xyw, r0.xyxw
mul r0.xyz, v0.yyyy, cb0[9].xyzx
mad r0.xyz, v0.xxxx, cb0[8].xyzx, r0.xyzx
mad r0.xyz, v0.zzzz, cb0[10].xyzx, r0.xyzx
add o1.xyz, r0.xyzx, cb0[11].xyzx
mov o2.xyz, cb0[11].xyzx
ret
// Approximately 12 instruction slots used



And the PS:

//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// using 3Dmigoto v1.2.34 on Tue Mar 22 21:03:37 2016
//
//
// Buffer Definitions:
//
// cbuffer cbPerLight
// {
//
// row_major float4x4 g_worldViewInverse;// Offset: 0 Size: 64 [unused]
// row_major float4x4 g_cameraToShadowProjector;// Offset: 64 Size: 64
// row_major float4x4 g_cameraToShadow;// Offset: 128 Size: 64
// row_major float4x4 g_cameraToSpotProjector;// Offset: 192 Size: 64 [unused]
// float4 g_characterLightTint; // Offset: 256 Size: 16 [unused]
// float4 g_lightColor; // Offset: 272 Size: 16 [unused]
// float4 g_triLightMidColor; // Offset: 288 Size: 16 [unused]
// float4 g_triLightBackColor; // Offset: 304 Size: 16 [unused]
// float4 g_lightProperties; // Offset: 320 Size: 16 [unused]
// float4 g_shadowTextureSize; // Offset: 336 Size: 16
// float4 g_shadowCascadeColor; // Offset: 352 Size: 16
// float4 g_shadowFadeDistances; // Offset: 368 Size: 16
// float4 g_telegraphProperties; // Offset: 384 Size: 16 [unused]
// float g_shadowAlpha; // Offset: 400 Size: 4 [unused]
// float g_shadowPixelSize; // Offset: 404 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// shadowSamplerState sampler_c NA NA 0 1
// g_sceneTexture2 texture float4 2d 0 1
// g_shadowTexture texture float4 2d 1 1
// cbPerLight cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float xy
// TEXCOORD 0 xyz 1 NONE float xyz
// TEXCOORD 1 xyz 2 NONE float
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
ps_4_0
dcl_constantbuffer cb0[26], immediateIndexed
dcl_sampler s0, mode_comparison
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyz
dcl_output o0.xyzw
dcl_temps 4
ftoi r0.xy, v0.xyxx
mov r0.zw, l(0,0,0,0)
ld_aoffimmi(0,0,0) r0.xyzw, r0.xyzw, t0.xyzw
mad r0.y, -cb0[25].y, l(2.500000), r0.x
div r1.xyz, v1.xyzx, v1.zzzz
mul r0.xzw, -r0.xxxx, r1.xxyz
div r1.xyz, r0.xzwx, r0.wwww
mul r1.xyz, -r0.yyyy, r1.xyzx
mul r2.xyzw, r1.yyyy, cb0[5].xyzw
mad r2.xyzw, r1.xxxx, cb0[4].xyzw, r2.xyzw
mad r1.xyzw, r1.zzzz, cb0[6].xyzw, r2.xyzw
add r1.xyzw, r1.xyzw, cb0[7].xyzw
div r1.xyz, r1.zxyz, r1.wwww
mad r2.xyzw, cb0[21].zwzw, l(-0.017450, 1.683145, -1.26170254, 1.442300), r1.yzyz
mov_sat r1.x, r1.x
add r0.y, r1.x, l(-0.000020)
sample_c_lz r1.x, r2.xyxx, t1.xxxx, s0, r0.y
sample_c_lz r1.w, r2.zwzz, t1.xxxx, s0, r0.y
add r1.x, r1.w, r1.x
mad r2.xyzw, cb0[21].zwzw, l(-1.04089749, -0.656447530, 0.868130, 0.508212507), r1.yzyz
sample_c_lz r1.w, r2.xyxx, t1.xxxx, s0, r0.y
sample_c_lz r2.x, r2.zwzz, t1.xxxx, s0, r0.y
add r1.x, r1.w, r1.x
add r1.x, r2.x, r1.x
mad r2.xyzw, cb0[21].zwzw, l(-0.142492503, -1.77057254, 1.155855, 1.65229750), r1.yzyz
sample_c_lz r1.w, r2.xyxx, t1.xxxx, s0, r0.y
sample_c_lz r2.x, r2.zwzz, t1.xxxx, s0, r0.y
add r1.x, r1.w, r1.x
add r1.x, r2.x, r1.x
mad r2.xyzw, cb0[21].zwzw, l(0.904980, -1.163335, 2.002550, 0.180197507), r1.yzyz
sample_c_lz r1.w, r2.xyxx, t1.xxxx, s0, r0.y
sample_c_lz r2.x, r2.zwzz, t1.xxxx, s0, r0.y
add r1.x, r1.w, r1.x
add r1.x, r2.x, r1.x
mad r2.xyzw, cb0[21].zwzw, l(-0.410990, 0.400737494, -1.65660751, -1.732205), r1.yzyz
mad r3.xyzw, cb0[21].zwzw, l(2.16099238, -1.085380, -2.468270, -0.123702496), r1.yzyz
sample_c_lz r1.y, r2.xyxx, t1.xxxx, s0, r0.y
sample_c_lz r1.z, r2.zwzz, t1.xxxx, s0, r0.y
add r1.x, r1.y, r1.x
add r1.x, r1.z, r1.x
sample_c_lz r1.y, r3.xyxx, t1.xxxx, s0, r0.y
sample_c_lz r0.y, r3.zwzz, t1.xxxx, s0, r0.y
add r1.x, r1.y, r1.x
add r0.y, r0.y, r1.x
mad r0.y, r0.y, l(0.0833333358), l(-1.000000)
mul r0.z, r0.z, cb0[9].z
mad r0.x, r0.x, cb0[8].z, r0.z
mad r0.x, r0.w, cb0[10].z, r0.x
add r0.x, r0.x, cb0[11].z
add r0.x, -r0.x, -cb0[23].y
add r0.z, -cb0[23].y, cb0[23].x
div_sat r0.x, r0.x, r0.z
mad r0.x, r0.x, r0.y, l(1.000000)
add r0.yzw, -r0.xxxx, cb0[22].xxyz
mad o0.xyz, cb0[22].wwww, r0.yzwy, r0.xxxx
mov o0.w, l(1.000000)
ret
// Approximately 57 instruction slots used


I would love to translate this from the vs/ps_3 to vs/ps_4 but have no idea how... Anyone willing to help?:)

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


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

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

Posted 03/23/2016 07:53 PM   
Helifax, attach the vanilla VS and PS in HLSL. I hate asm!! jajaja
Helifax, attach the vanilla VS and PS in HLSL.
I hate asm!! jajaja

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

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

Posted 03/23/2016 08:08 PM   
HLSL code: PS: [code] // f7b63c246c08f75d-ps_replace -> Shadows cbuffer cbPerLight : register(b0) { row_major float4x4 g_worldViewInverse : packoffset(c0); row_major float4x4 g_cameraToShadowProjector : packoffset(c4); row_major float4x4 g_cameraToShadow : packoffset(c8); row_major float4x4 g_cameraToSpotProjector : packoffset(c12); float4 g_characterLightTint : packoffset(c16); float4 g_lightColor : packoffset(c17); float4 g_triLightMidColor : packoffset(c18); float4 g_triLightBackColor : packoffset(c19); float4 g_lightProperties : packoffset(c20); float4 g_shadowTextureSize : packoffset(c21); float4 g_shadowCascadeColor : packoffset(c22); float4 g_shadowFadeDistances : packoffset(c23); float4 g_telegraphProperties : packoffset(c24); float g_shadowAlpha : packoffset(c25); float g_shadowPixelSize : packoffset(c25.y); } cbuffer cbPerFrame_Uncommon : register(b13) { row_major float4x4 g_projection : packoffset(c0); row_major float4x4 g_projectionInverse : packoffset(c4); row_major float4x4 g_mainView : packoffset(c8); float4 g_debugTweakables : packoffset(c12); float4 g_nearFarDepths : packoffset(c13); float4 g_reflectionPlane : packoffset(c14); } SamplerComparisonState shadowSamplerState_s : register(s0); Texture2D<float4> g_sceneTexture2 : register(t0); Texture2D<float4> g_shadowTexture : register(t1); // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float4 v0 : SV_POSITION0, float4 v1 : TEXCOORD0, float3 v2 : TEXCOORD1, out float4 o0 : SV_TARGET0) { float4 r0,r1,r2,r3; uint4 bitmask, uiDest; float4 fDest; r0.xy = (int2)v0.xy; r0.zw = float2(0,0); r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw; r0.y = -g_shadowPixelSize * 2.5 + r0.x; r1.xyz = v1.xyz / v1.zzz; r0.xzw = r1.xyz * -r0.xxx; r1.xyz = r0.xzw / r0.www; r1.xyz = r1.xyz * -r0.yyy; float4 stereo = StereoParams.Load(0); //r1.x -= stereo.x * (r1.z - stereo.y) * g_projectionInverse._m00; r1.x -= stereo.x * (r1.z - stereo.y) * 0.5; r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy; r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw; r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw; r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw; r1.xyz = r1.zxy / r1.www; r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.0174499992,1.68314505,-1.26170254,1.44229996) + r1.yzyz; r1.x = saturate(r1.x); r0.y = -1.99999995e-005 + r1.x; r1.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r2.xyzw = g_shadowTextureSize.zwzw * float4(-1.04089749,-0.65644753,0.868130028,0.508212507) + r1.yzyz; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r1.x = r1.x + r2.x; r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.142492503,-1.77057254,1.15585494,1.6522975) + r1.yzyz; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r1.x = r1.x + r2.x; r2.xyzw = g_shadowTextureSize.zwzw * float4(0.904980004,-1.16333497,2.00254989,0.180197507) + r1.yzyz; r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.w; r1.x = r1.x + r2.x; r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.41099,0.400737494,-1.65660751,-1.73220503) + r1.yzyz; r3.xyzw = g_shadowTextureSize.zwzw * float4(2.16099238,-1.08537996,-2.46827006,-0.123702496) + r1.yzyz; r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x; r1.z = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x; r1.x = r1.x + r1.y; r1.x = r1.x + r1.z; r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.xy, r0.y).x; r0.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.zw, r0.y).x; r1.x = r1.x + r1.y; r0.y = r1.x + r0.y; r0.y = r0.y * 0.0833333358 + -1; r0.z = g_cameraToShadow._m12 * r0.z; r0.x = r0.x * g_cameraToShadow._m02 + r0.z; r0.x = r0.w * g_cameraToShadow._m22 + r0.x; r0.x = g_cameraToShadow._m32 + r0.x; r0.x = -g_shadowFadeDistances.y + -r0.x; r0.z = g_shadowFadeDistances.x + -g_shadowFadeDistances.y; r0.x = saturate(r0.x / r0.z); r0.x = r0.x * r0.y + 1; r0.yzw = g_shadowCascadeColor.xyz + -r0.xxx; o0.xyz = g_shadowCascadeColor.www * r0.yzw + r0.xxx; o0.w = 1; return; } [/code] VS: [code] // 8737c93ce5c2bb14-vs Shadows VS cbuffer cbPerObject : register(b0) { row_major float4x4 g_worldViewProj : packoffset(c0); row_major float4x4 g_world : packoffset(c4); row_major float4x4 g_worldView : packoffset(c8); float4 g_uvScrolling : packoffset(c12); float4 g_texCoordScaleBias : packoffset(c13); float4 g_boundingSphere : packoffset(c14); } // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float3 v0 : POSITION0, float3 v1 : NORMAL0, float4 v2 : COLOR0, float2 v3 : TEXCOORD0, out float4 o0 : SV_POSITION0, out float4 o1 : TEXCOORD0, out float3 o2 : TEXCOORD1) { float4 r0; uint4 bitmask, uiDest; float4 fDest; r0.xyzw = g_worldViewProj._m10_m11_m12_m13 * v0.yyyy; r0.xyzw = v0.xxxx * g_worldViewProj._m00_m01_m02_m03 + r0.xyzw; r0.xyzw = v0.zzzz * g_worldViewProj._m20_m21_m22_m23 + r0.xyzw; r0.xyzw = g_worldViewProj._m30_m31_m32_m33 + r0.xyzw; o0.z = min(r0.z, r0.w); o0.xyw = r0.xyw; r0.xyz = g_worldView._m10_m11_m12 * v0.yyy; r0.xyz = v0.xxx * g_worldView._m00_m01_m02 + r0.xyz; r0.xyz = v0.zzz * g_worldView._m20_m21_m22 + r0.xyz; o1.xyz = g_worldView._m30_m31_m32 + r0.xyz; o2.xyz = g_worldView._m30_m31_m32; float4 stereo = StereoParams.Load(0); o1.x += stereo.x * (r0.w - stereo.y); //o0.x -= stereo.x * (o0.w - stereo.y); return; } [/code] ^_^
HLSL code:

PS:
// f7b63c246c08f75d-ps_replace -> Shadows

cbuffer cbPerLight : register(b0)
{
row_major float4x4 g_worldViewInverse : packoffset(c0);
row_major float4x4 g_cameraToShadowProjector : packoffset(c4);
row_major float4x4 g_cameraToShadow : packoffset(c8);
row_major float4x4 g_cameraToSpotProjector : packoffset(c12);
float4 g_characterLightTint : packoffset(c16);
float4 g_lightColor : packoffset(c17);
float4 g_triLightMidColor : packoffset(c18);
float4 g_triLightBackColor : packoffset(c19);
float4 g_lightProperties : packoffset(c20);
float4 g_shadowTextureSize : packoffset(c21);
float4 g_shadowCascadeColor : packoffset(c22);
float4 g_shadowFadeDistances : packoffset(c23);
float4 g_telegraphProperties : packoffset(c24);
float g_shadowAlpha : packoffset(c25);
float g_shadowPixelSize : packoffset(c25.y);
}

cbuffer cbPerFrame_Uncommon : register(b13)
{
row_major float4x4 g_projection : packoffset(c0);
row_major float4x4 g_projectionInverse : packoffset(c4);
row_major float4x4 g_mainView : packoffset(c8);
float4 g_debugTweakables : packoffset(c12);
float4 g_nearFarDepths : packoffset(c13);
float4 g_reflectionPlane : packoffset(c14);
}

SamplerComparisonState shadowSamplerState_s : register(s0);
Texture2D<float4> g_sceneTexture2 : register(t0);
Texture2D<float4> g_shadowTexture : register(t1);


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


void main(
float4 v0 : SV_POSITION0,
float4 v1 : TEXCOORD0,
float3 v2 : TEXCOORD1,
out float4 o0 : SV_TARGET0)
{
float4 r0,r1,r2,r3;
uint4 bitmask, uiDest;
float4 fDest;


r0.xy = (int2)v0.xy;
r0.zw = float2(0,0);
r0.xyzw = g_sceneTexture2.Load(r0.xyz, int3(0, 0, 0)).xyzw;
r0.y = -g_shadowPixelSize * 2.5 + r0.x;
r1.xyz = v1.xyz / v1.zzz;
r0.xzw = r1.xyz * -r0.xxx;
r1.xyz = r0.xzw / r0.www;
r1.xyz = r1.xyz * -r0.yyy;






float4 stereo = StereoParams.Load(0);
//r1.x -= stereo.x * (r1.z - stereo.y) * g_projectionInverse._m00;
r1.x -= stereo.x * (r1.z - stereo.y) * 0.5;


r2.xyzw = g_cameraToShadowProjector._m10_m11_m12_m13 * r1.yyyy;
r2.xyzw = r1.xxxx * g_cameraToShadowProjector._m00_m01_m02_m03 + r2.xyzw;
r1.xyzw = r1.zzzz * g_cameraToShadowProjector._m20_m21_m22_m23 + r2.xyzw;
r1.xyzw = g_cameraToShadowProjector._m30_m31_m32_m33 + r1.xyzw;
r1.xyz = r1.zxy / r1.www;




r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.0174499992,1.68314505,-1.26170254,1.44229996) + r1.yzyz;
r1.x = saturate(r1.x);
r0.y = -1.99999995e-005 + r1.x;
r1.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r2.xyzw = g_shadowTextureSize.zwzw * float4(-1.04089749,-0.65644753,0.868130028,0.508212507) + r1.yzyz;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r1.x = r1.x + r2.x;
r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.142492503,-1.77057254,1.15585494,1.6522975) + r1.yzyz;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r1.x = r1.x + r2.x;
r2.xyzw = g_shadowTextureSize.zwzw * float4(0.904980004,-1.16333497,2.00254989,0.180197507) + r1.yzyz;
r1.w = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r2.x = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.w;
r1.x = r1.x + r2.x;
r2.xyzw = g_shadowTextureSize.zwzw * float4(-0.41099,0.400737494,-1.65660751,-1.73220503) + r1.yzyz;
r3.xyzw = g_shadowTextureSize.zwzw * float4(2.16099238,-1.08537996,-2.46827006,-0.123702496) + r1.yzyz;
r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.xy, r0.y).x;
r1.z = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r2.zw, r0.y).x;
r1.x = r1.x + r1.y;
r1.x = r1.x + r1.z;
r1.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.xy, r0.y).x;
r0.y = g_shadowTexture.SampleCmpLevelZero(shadowSamplerState_s, r3.zw, r0.y).x;
r1.x = r1.x + r1.y;
r0.y = r1.x + r0.y;
r0.y = r0.y * 0.0833333358 + -1;
r0.z = g_cameraToShadow._m12 * r0.z;
r0.x = r0.x * g_cameraToShadow._m02 + r0.z;
r0.x = r0.w * g_cameraToShadow._m22 + r0.x;
r0.x = g_cameraToShadow._m32 + r0.x;
r0.x = -g_shadowFadeDistances.y + -r0.x;
r0.z = g_shadowFadeDistances.x + -g_shadowFadeDistances.y;
r0.x = saturate(r0.x / r0.z);
r0.x = r0.x * r0.y + 1;
r0.yzw = g_shadowCascadeColor.xyz + -r0.xxx;
o0.xyz = g_shadowCascadeColor.www * r0.yzw + r0.xxx;
o0.w = 1;
return;
}


VS:
// 8737c93ce5c2bb14-vs Shadows VS

cbuffer cbPerObject : register(b0)
{
row_major float4x4 g_worldViewProj : packoffset(c0);
row_major float4x4 g_world : packoffset(c4);
row_major float4x4 g_worldView : packoffset(c8);
float4 g_uvScrolling : packoffset(c12);
float4 g_texCoordScaleBias : packoffset(c13);
float4 g_boundingSphere : packoffset(c14);
}



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


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

r0.xyzw = g_worldViewProj._m10_m11_m12_m13 * v0.yyyy;
r0.xyzw = v0.xxxx * g_worldViewProj._m00_m01_m02_m03 + r0.xyzw;
r0.xyzw = v0.zzzz * g_worldViewProj._m20_m21_m22_m23 + r0.xyzw;
r0.xyzw = g_worldViewProj._m30_m31_m32_m33 + r0.xyzw;
o0.z = min(r0.z, r0.w);
o0.xyw = r0.xyw;
r0.xyz = g_worldView._m10_m11_m12 * v0.yyy;
r0.xyz = v0.xxx * g_worldView._m00_m01_m02 + r0.xyz;
r0.xyz = v0.zzz * g_worldView._m20_m21_m22 + r0.xyz;
o1.xyz = g_worldView._m30_m31_m32 + r0.xyz;
o2.xyz = g_worldView._m30_m31_m32;

float4 stereo = StereoParams.Load(0);
o1.x += stereo.x * (r0.w - stereo.y);
//o0.x -= stereo.x * (o0.w - stereo.y);

return;
}


^_^

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


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

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

Posted 03/23/2016 08:27 PM   
  54 / 87    
Scroll To Top