Are you able to fix Company of Heroes 2 for me?
  4 / 5    
Since I have no idea what an actual fix would be I've been toying around with other values available in d3dx.ini putting those shaders at fixed convergence like 0 makes the ground not so floaty but the right / left images are so far away from each other it hurts the eyes ;p using separation doesnt seem to help either nor the mix of the two... I think that this ground shader is really fucked up :D
Since I have no idea what an actual fix would be I've been toying around with other values available in d3dx.ini

putting those shaders at fixed convergence like 0 makes the ground not so floaty but the right / left images are so far away from each other it hurts the eyes ;p using separation doesnt seem to help either nor the mix of the two...

I think that this ground shader is really fucked up :D

Acer H5360 / BenQ XL2420T + 3D Vision 2 Kit - EVGA GTX 980TI 6GB - i7-3930K@4.0GHz - DX79SI- 16GB RAM@2133 - Win10x64 Home - HTC VIVE

#46
Posted 11/14/2015 08:38 PM   
not entirely sure but I just found that dumping the VS also produce an error in d3d11_log [code]>>>> vertex shader marked: vertex shader hash = 566a42c68d2cbf0c visited index buffer hash = ffaf0b70 visited pixel shader hash = 662ee2ed4ba8d6ef StereoScreenShot on Mark: F:\SteamLibrary\steamapps\common\Company of Heroes 2\ShaderFixes\566a42c68d2cbf0c-vs.jps, result: 0 creating HLSL representation. error parsing shader> Error parsing buffer item: // 0x00000000 0x00000000 0x00000000 0x00000000 // 0x00000000 0x00 error parsing shader> 3 Error parsing buffer offset: cb2[0].xyzw error parsing shader> 3 Error parsing buffer offset: cb2[1].xyzw error parsing shader> 3 Error parsing buffer offset: cb2[2].xyzw error parsing shader> 3 Error parsing buffer offset: cb0[70].xy error parsing shader> 3 Error parsing buffer offset: cb0[72].x error parsing shader> 3 Error parsing buffer offset: cb0[72].x error parsing shader> 3 Error parsing buffer offset: cb0[83].x error parsing shader> 3 Error parsing buffer offset: cb0[70].xyxy error parsing shader> 3 Error parsing buffer offset: cb0[72].x error parsing shader> 3 Error parsing buffer offset: cb0[72].x error parsing shader> 3 Error parsing buffer offset: cb0[70].xyxy error parsing shader> 3 Error parsing buffer offset: cb0[72].x error parsing shader> 3 Error parsing buffer offset: cb0[72].x storing patched shader to F:\SteamLibrary\steamapps\common\Company of Heroes 2\ShaderFixes\566a42c68d2cbf0c-vs_replace.txt >Replacement shader found. Re-Loading replacement HLSL code from 566a42c68d2cbf0c-vs_replace.txt Reload source code loaded. Size = 19172 compiling replacement HLSL code with shader model vs_4_0 compile result for replacement HLSL shader: 80004005[/code]
not entirely sure but I just found that dumping the VS also produce an error in d3d11_log

>>>> vertex shader marked: vertex shader hash = 566a42c68d2cbf0c
visited index buffer hash = ffaf0b70
visited pixel shader hash = 662ee2ed4ba8d6ef
StereoScreenShot on Mark: F:\SteamLibrary\steamapps\common\Company of Heroes 2\ShaderFixes\566a42c68d2cbf0c-vs.jps, result: 0
creating HLSL representation.
error parsing shader> Error parsing buffer item: // 0x00000000 0x00000000 0x00000000 0x00000000
// 0x00000000 0x00
error parsing shader> 3 Error parsing buffer offset: cb2[0].xyzw
error parsing shader> 3 Error parsing buffer offset: cb2[1].xyzw
error parsing shader> 3 Error parsing buffer offset: cb2[2].xyzw
error parsing shader> 3 Error parsing buffer offset: cb0[70].xy
error parsing shader> 3 Error parsing buffer offset: cb0[72].x
error parsing shader> 3 Error parsing buffer offset: cb0[72].x
error parsing shader> 3 Error parsing buffer offset: cb0[83].x
error parsing shader> 3 Error parsing buffer offset: cb0[70].xyxy
error parsing shader> 3 Error parsing buffer offset: cb0[72].x
error parsing shader> 3 Error parsing buffer offset: cb0[72].x
error parsing shader> 3 Error parsing buffer offset: cb0[70].xyxy
error parsing shader> 3 Error parsing buffer offset: cb0[72].x
error parsing shader> 3 Error parsing buffer offset: cb0[72].x
storing patched shader to F:\SteamLibrary\steamapps\common\Company of Heroes 2\ShaderFixes\566a42c68d2cbf0c-vs_replace.txt
>Replacement shader found. Re-Loading replacement HLSL code from 566a42c68d2cbf0c-vs_replace.txt
Reload source code loaded. Size = 19172
compiling replacement HLSL code with shader model vs_4_0
compile result for replacement HLSL shader: 80004005

Acer H5360 / BenQ XL2420T + 3D Vision 2 Kit - EVGA GTX 980TI 6GB - i7-3930K@4.0GHz - DX79SI- 16GB RAM@2133 - Win10x64 Home - HTC VIVE

#47
Posted 11/14/2015 09:05 PM   
so out of curiosity I've tried to dump all the VS that are available once I load a map, out of 43 only 13 are done with high pitch sound meaning no error all the rest gives back low pitch sound... looking at the log file there seem to be those CB'x' parameters occurring in all cases. [code] error parsing shader> Missing constant buffer name: cb2[r1.x+0].xyzw error parsing shader> Missing constant buffer name: cb2[r1.x+1].xyzw error parsing shader> Missing constant buffer name: cb2[r1.x+2].xyzw error parsing shader> 3 Error parsing buffer offset: cb0[52].x error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyzw error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyzw error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyzw error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz error parsing shader> Missing constant buffer name: cb2[r0.x+0].xyzw error parsing shader> Missing constant buffer name: cb2[r0.x+1].xyzw error parsing shader> Missing constant buffer name: cb2[r0.x+2].xyzw error parsing shader> 3 Error parsing buffer offset: cb0[52].x error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz error parsing shader> 3 Error parsing buffer offset: cb2[0].xyzw error parsing shader> 3 Error parsing buffer offset: cb2[1].xyzw error parsing shader> 3 Error parsing buffer offset: cb2[2].xyzw error parsing shader> Missing constant buffer name: cb2[r0.x+0].xyzw error parsing shader> Missing constant buffer name: cb2[r0.x+1].xyzw error parsing shader> Missing constant buffer name: cb2[r0.x+2].xyzw error parsing shader> 3 Error parsing buffer offset: cb0[52].x [/code] etc... those are just few but all that failed have starts with CB Im able to disable all those that are fine easily with 'zeroing' whatever is associated with the SV_Position0. regardless of if they generate an error or not Im able to disable all by adding them in d3dx.ini tho still im I ever would like to have a 'fix' it cant be related to simply disabling the shader as its the ground that is broken... guess Im fucked with this one :D
so out of curiosity I've tried to dump all the VS that are available once I load a map, out of 43 only 13 are done with high pitch sound meaning no error all the rest gives back low pitch sound...

looking at the log file there seem to be those CB'x' parameters occurring in all cases.
error parsing shader> Missing constant buffer name: cb2[r1.x+0].xyzw
error parsing shader> Missing constant buffer name: cb2[r1.x+1].xyzw
error parsing shader> Missing constant buffer name: cb2[r1.x+2].xyzw
error parsing shader> 3 Error parsing buffer offset: cb0[52].x

error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyzw
error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyzw
error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyzw
error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz

error parsing shader> Missing constant buffer name: cb2[r0.x+0].xyzw
error parsing shader> Missing constant buffer name: cb2[r0.x+1].xyzw
error parsing shader> Missing constant buffer name: cb2[r0.x+2].xyzw
error parsing shader> 3 Error parsing buffer offset: cb0[52].x

error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+0].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+1].xyz
error parsing shader> Missing constant buffer name: cb2[r0.w+2].xyz

error parsing shader> 3 Error parsing buffer offset: cb2[0].xyzw
error parsing shader> 3 Error parsing buffer offset: cb2[1].xyzw
error parsing shader> 3 Error parsing buffer offset: cb2[2].xyzw

error parsing shader> Missing constant buffer name: cb2[r0.x+0].xyzw
error parsing shader> Missing constant buffer name: cb2[r0.x+1].xyzw
error parsing shader> Missing constant buffer name: cb2[r0.x+2].xyzw
error parsing shader> 3 Error parsing buffer offset: cb0[52].x
etc... those are just few but all that failed have starts with CB

Im able to disable all those that are fine easily with 'zeroing' whatever is associated with the
SV_Position0.


regardless of if they generate an error or not Im able to disable all by adding them in d3dx.ini tho still im I ever would like to have a 'fix' it cant be related to simply disabling the shader as its the ground that is broken...

guess Im fucked with this one :D

Acer H5360 / BenQ XL2420T + 3D Vision 2 Kit - EVGA GTX 980TI 6GB - i7-3930K@4.0GHz - DX79SI- 16GB RAM@2133 - Win10x64 Home - HTC VIVE

#48
Posted 11/14/2015 09:17 PM   
OK, cool, you are off to a good start on fixing the ground. Just for reference since you are new to it, it is often this confusing and bizarre and 1/3 busted. That's normal for games where we haven't looked at the game engine before. Right at the moment, you are seeing Decompiler issues with that PS. Basically the HLSL representation is generated wrong, so the code won't actually compile. This is regrettable, but the Decompilation of assembly is a hard problem. It's getting better over time as I fix bugs, but this sort of thing is going to happen. For this one, let me take a look at doing a hand fix for it, as the key shader you need. This technique is me looking at the code and understanding what broke, and providing a hand-built version that will work. This helps me fix the bug in the Decompiler, because I get to see what went wrong. I think the PS is the right spot to disable the ground effect, so let me see if I can build a hand-fixed shader for you. The fundamental part of the hacking is to experiment. So, in this case for example, I suggested disabling all three outputs. It might be that we can disable just a single piece of that (like o1 or o2) instead of the whole thing. I don't quite understand the floating ground problem based on some of your screenshots, so if it's some sort of decal, this disable will work. If it's the entire ground, we'll need something else, something more complicated probably (like Mike's Total War floating ground fix). Edit: So what happened here is the SHLight variable is fully initialized in the code, and the Decompiler doesn't presently know how to handle that giant array initializer. This is bad because I can't just do a couple of tweaks and get it compiling, it missed every variable from there on, which is too many to do by hand (all offsets need to be calculated). So... I can add this initializer handler, which will take me several days, or you can try the ASM version of the file instead, since we support that too. Dump the ASM file, and drop it into the ShaderFixes folder by itself, and then you can experiment on that. Very much like the original HelixMod instructions, you set outputs to zero constants, different syntax.
OK, cool, you are off to a good start on fixing the ground. Just for reference since you are new to it, it is often this confusing and bizarre and 1/3 busted. That's normal for games where we haven't looked at the game engine before.

Right at the moment, you are seeing Decompiler issues with that PS. Basically the HLSL representation is generated wrong, so the code won't actually compile. This is regrettable, but the Decompilation of assembly is a hard problem. It's getting better over time as I fix bugs, but this sort of thing is going to happen.

For this one, let me take a look at doing a hand fix for it, as the key shader you need. This technique is me looking at the code and understanding what broke, and providing a hand-built version that will work. This helps me fix the bug in the Decompiler, because I get to see what went wrong.


I think the PS is the right spot to disable the ground effect, so let me see if I can build a hand-fixed shader for you.

The fundamental part of the hacking is to experiment. So, in this case for example, I suggested disabling all three outputs. It might be that we can disable just a single piece of that (like o1 or o2) instead of the whole thing.

I don't quite understand the floating ground problem based on some of your screenshots, so if it's some sort of decal, this disable will work. If it's the entire ground, we'll need something else, something more complicated probably (like Mike's Total War floating ground fix).


Edit: So what happened here is the SHLight variable is fully initialized in the code, and the Decompiler doesn't presently know how to handle that giant array initializer. This is bad because I can't just do a couple of tweaks and get it compiling, it missed every variable from there on, which is too many to do by hand (all offsets need to be calculated).

So... I can add this initializer handler, which will take me several days, or you can try the ASM version of the file instead, since we support that too. Dump the ASM file, and drop it into the ShaderFixes folder by itself, and then you can experiment on that. Very much like the original HelixMod instructions, you set outputs to zero constants, different syntax.

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

#49
Posted 11/15/2015 01:07 AM   
Im afraid the ground is a more complex problem as was Mike's TW fix, the floating ground is probably not the most accurate thing you could say its more as if everything thats on the ground appear to be floating over it. this is the ground using CM mode where it renders somewhat properly http://photos.3dvisionlive.com/tehace/image/56486300e7e5648557000070/ and here is with the real3d where it appears to not be on the same plane as the rest of the objects http://photos.3dvisionlive.com/tehace/image/564862dee7e5642266000258/ some of those screenshots I have in this album http://photos.3dvisionlive.com/tehace/album/51798ae65ec346375a000049/ have the ground rendered properly but it must have been changed at some point as I've checked the exact same spots on the same map and its broken. I've also tried different settings to see if that has any effect but it didnt. I remember some of the maps (very few) were rendered correctly so it was my first guess to try and find those, dump the ground shaders from them and compare them to those that render incorrectly but I havent found any map that render the ground properly now... Im sorry but I dont even have an idea what ASM is... google found me this https://github.com/bo3b/3Dmigoto/issues/28 but all I understand from it is that ASM is different than HLSL ;) Also found some ASM mentions within 3dmigoto going open source topic, but it doesnt enlighten me much aside from the fact that its possible :( Flugan also already added his Assembler to the project, and we are going to hook it up shortly. This is significant because we could not previously Assemble the ASM version of shaders, we could only do the HLSL. + this http://reshade.me/forum/suggestions/474-helix-3dmigoto-compat-shader-tex-dump-injection I think that I'm able to follow specific instructions and than play around with things once they work, other than that I feel like im rather useless.
Im afraid the ground is a more complex problem as was Mike's TW fix, the floating ground is probably not the most accurate thing you could say its more as if everything thats on the ground appear to be floating over it.

this is the ground using CM mode where it renders somewhat properly

http://photos.3dvisionlive.com/tehace/image/56486300e7e5648557000070/


and here is with the real3d where it appears to not be on the same plane as the rest of the objects

http://photos.3dvisionlive.com/tehace/image/564862dee7e5642266000258/



some of those screenshots I have in this album http://photos.3dvisionlive.com/tehace/album/51798ae65ec346375a000049/ have the ground rendered properly but it must have been changed at some point as I've checked the exact same spots on the same map and its broken. I've also tried different settings to see if that has any effect but it didnt. I remember some of the maps (very few) were rendered correctly so it was my first guess to try and find those, dump the ground shaders from them and compare them to those that render incorrectly but I havent found any map that render the ground properly now...

Im sorry but I dont even have an idea what ASM is... google found me this https://github.com/bo3b/3Dmigoto/issues/28 but all I understand from it is that ASM is different than HLSL ;)

Also found some ASM mentions within 3dmigoto going open source topic, but it doesnt enlighten me much aside from the fact that its possible :( Flugan also already added his Assembler to the project, and we are going to hook it up shortly. This is significant because we could not previously Assemble the ASM version of shaders, we could only do the HLSL.

+ this http://reshade.me/forum/suggestions/474-helix-3dmigoto-compat-shader-tex-dump-injection

I think that I'm able to follow specific instructions and than play around with things once they work, other than that I feel like im rather useless.

Acer H5360 / BenQ XL2420T + 3D Vision 2 Kit - EVGA GTX 980TI 6GB - i7-3930K@4.0GHz - DX79SI- 16GB RAM@2133 - Win10x64 Home - HTC VIVE

#50
Posted 11/15/2015 11:08 AM   
@tehace, for the ground you can try using others settings if make things better...changing AA, even test without AA, also other settings for the ground quality, tesselation (if the game have), texture quality..... that ground looks really strange.
@tehace, for the ground you can try using others settings if make things better...changing AA, even test without AA, also other settings for the ground quality, tesselation (if the game have), texture quality..... that ground looks really strange.

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

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

#51
Posted 11/15/2015 02:39 PM   
[quote="tehace"]Im afraid the ground is a more complex problem as was Mike's TW fix, the floating ground is probably not the most accurate thing you could say its more as if everything thats on the ground appear to be floating over it. this is the ground using CM mode where it renders somewhat properly http://photos.3dvisionlive.com/tehace/image/56486300e7e5648557000070/ and here is with the real3d where it appears to not be on the same plane as the rest of the objects http://photos.3dvisionlive.com/tehace/image/564862dee7e5642266000258/ some of those screenshots I have in this album http://photos.3dvisionlive.com/tehace/album/51798ae65ec346375a000049/ have the ground rendered properly but it must have been changed at some point as I've checked the exact same spots on the same map and its broken. I've also tried different settings to see if that has any effect but it didnt. I remember some of the maps (very few) were rendered correctly so it was my first guess to try and find those, dump the ground shaders from them and compare them to those that render incorrectly but I havent found any map that render the ground properly now... Im sorry but I dont even have an idea what ASM is... google found me this https://github.com/bo3b/3Dmigoto/issues/28 but all I understand from it is that ASM is different than HLSL ;) Also found some ASM mentions within 3dmigoto going open source topic, but it doesnt enlighten me much aside from the fact that its possible :( Flugan also already added his Assembler to the project, and we are going to hook it up shortly. This is significant because we could not previously Assemble the ASM version of shaders, we could only do the HLSL. + this http://reshade.me/forum/suggestions/474-helix-3dmigoto-compat-shader-tex-dump-injection I think that I'm able to follow specific instructions and than play around with things once they work, other than that I feel like im rather useless. [/quote] Ah, I was wondering why sometimes it looked OK and sometimes not. Is it possible to reverse the problem? In other words, move the objects down to the ground, instead of moving the ground up? Hard to say though because they seem like they are in the right spot relative to the depth, just wrong height. Like x axis is fine, but z axis is wrong. For the lack of understanding the pieces- this is why you need to go through the wiki.bo3b.net lessons, and actually do the lessons, not skim them. I promise that after doing the lessons you will understand all of these pieces, including the ASM. You are currently trying to run before you walk, and one of my main reasons for putting the effort into those lessons is so that we can all use the same vocabulary, have the same background. That way we also don't have to keep repeating ourselves.
tehace said:Im afraid the ground is a more complex problem as was Mike's TW fix, the floating ground is probably not the most accurate thing you could say its more as if everything thats on the ground appear to be floating over it.

this is the ground using CM mode where it renders somewhat properly

http://photos.3dvisionlive.com/tehace/image/56486300e7e5648557000070/


and here is with the real3d where it appears to not be on the same plane as the rest of the objects

http://photos.3dvisionlive.com/tehace/image/564862dee7e5642266000258/



some of those screenshots I have in this album http://photos.3dvisionlive.com/tehace/album/51798ae65ec346375a000049/ have the ground rendered properly but it must have been changed at some point as I've checked the exact same spots on the same map and its broken. I've also tried different settings to see if that has any effect but it didnt. I remember some of the maps (very few) were rendered correctly so it was my first guess to try and find those, dump the ground shaders from them and compare them to those that render incorrectly but I havent found any map that render the ground properly now...

Im sorry but I dont even have an idea what ASM is... google found me this https://github.com/bo3b/3Dmigoto/issues/28 but all I understand from it is that ASM is different than HLSL ;)

Also found some ASM mentions within 3dmigoto going open source topic, but it doesnt enlighten me much aside from the fact that its possible :( Flugan also already added his Assembler to the project, and we are going to hook it up shortly. This is significant because we could not previously Assemble the ASM version of shaders, we could only do the HLSL.

+ this http://reshade.me/forum/suggestions/474-helix-3dmigoto-compat-shader-tex-dump-injection

I think that I'm able to follow specific instructions and than play around with things once they work, other than that I feel like im rather useless.

Ah, I was wondering why sometimes it looked OK and sometimes not. Is it possible to reverse the problem? In other words, move the objects down to the ground, instead of moving the ground up? Hard to say though because they seem like they are in the right spot relative to the depth, just wrong height. Like x axis is fine, but z axis is wrong.


For the lack of understanding the pieces- this is why you need to go through the wiki.bo3b.net lessons, and actually do the lessons, not skim them. I promise that after doing the lessons you will understand all of these pieces, including the ASM.

You are currently trying to run before you walk, and one of my main reasons for putting the effort into those lessons is so that we can all use the same vocabulary, have the same background. That way we also don't have to keep repeating ourselves.

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

#52
Posted 11/15/2015 11:10 PM   
deleted
deleted

#53
Posted 11/16/2015 09:33 AM   
tridef 3d has perfect profile for this game
tridef 3d has perfect profile for this game

#54
Posted 11/16/2015 01:56 PM   
@bo3b ok I'll try to do that over the week. All the other objects seem to be rendered properly and if you disable the shadows in the config file the game would be 100% in playable state if it wasnt for the messed up ground, in COH1 it was all fine with the right profile. @daspawn yeah, thanks. I guess it was probably already mentioned but unfortunately my setup does not support tridef. @DHR I have edited the lua config to have everything on low/off and it doesnt influence how the ground is rendered. Not sure if this is important but if you look at the CM mode (which actually look decent up to a point) http://photos.3dvisionlive.com/tehace/image/5649e6f8e7e5641220000028/ it seem that everything is rendered in 2d to a certain height, on that screenshot up to the point where the buildings with the numbers 60 50 70 are - its just plain field and this 'viewport' is always rendered that way. Than over this the rest seem to be rendered really well in fake3d. or here right where the soldiers are standing in the middle of the base http://photos.3dvisionlive.com/tehace/image/5649e901e7e564d74000002d/ or here the bigger tree near is also that 'flat' http://photos.3dvisionlive.com/tehace/image/5649e932e7e564c34a00002e/ while here its the same tree that looks good when moved out http://photos.3dvisionlive.com/tehace/image/5649e922e7e564643b000020/ but now the farm looks 'flat' and so on. I seemed to be able to break this with the result like this http://photos.3dvisionlive.com/tehace/image/5645e312e7e564880d00027e/ but I doeesnt seem to be able to reproduce it I have no idea what I did and it only happened once for me.
@bo3b ok I'll try to do that over the week. All the other objects seem to be rendered properly and if you disable the shadows in the config file the game would be 100% in playable state if it wasnt for the messed up ground, in COH1 it was all fine with the right profile.

@daspawn yeah, thanks. I guess it was probably already mentioned but unfortunately my setup does not support tridef.

@DHR I have edited the lua config to have everything on low/off and it doesnt influence how the ground is rendered.

Not sure if this is important but if you look at the CM mode (which actually look decent up to a point)

http://photos.3dvisionlive.com/tehace/image/5649e6f8e7e5641220000028/


it seem that everything is rendered in 2d to a certain height, on that screenshot up to the point where the buildings with the numbers 60 50 70 are - its just plain field and this 'viewport' is always rendered that way. Than over this the rest seem to be rendered really well in fake3d.

or here right where the soldiers are standing in the middle of the base

http://photos.3dvisionlive.com/tehace/image/5649e901e7e564d74000002d/


or here the bigger tree near is also that 'flat'

http://photos.3dvisionlive.com/tehace/image/5649e932e7e564c34a00002e/

while here its the same tree that looks good when moved out

http://photos.3dvisionlive.com/tehace/image/5649e922e7e564643b000020/

but now the farm looks 'flat' and so on.

I seemed to be able to break this with the result like this

http://photos.3dvisionlive.com/tehace/image/5645e312e7e564880d00027e/

but I doeesnt seem to be able to reproduce it I have no idea what I did and it only happened once for me.

Acer H5360 / BenQ XL2420T + 3D Vision 2 Kit - EVGA GTX 980TI 6GB - i7-3930K@4.0GHz - DX79SI- 16GB RAM@2133 - Win10x64 Home - HTC VIVE

#55
Posted 11/16/2015 02:37 PM   
[quote="tehace"][code] cbuffer GlobalBuffer : register(b0) { float4x4 View : packoffset(c0); float4x4 Projection : packoffset(c4); float4x4 InvViewProj : packoffset(c8); float3 EyePosition : packoffset(c12) = float3(0,0,0); float3 DirLight0_Dir : packoffset(c13) = float3(-0.577000022,-0.577000022,0.577000022); float4 DirLight0_Diffuse : packoffset(c14) = float4(1,1,1,1); float4 PointLightActive : packoffset(c15) = float4(0,0,0,0); float4 PointLight0_Position_AttenStart : packoffset(c16) = float4(0,0,0,10000); float4 PointLight0_Diffuse_AttenInvRange : packoffset(c17) = float4(1,1,1,1); float4 PointLight1_Position_AttenStart : packoffset(c18) = float4(0,0,0,10000); float4 PointLight1_Diffuse_AttenInvRange : packoffset(c19) = float4(1,1,1,1); float4 PointLight2_Position_AttenStart : packoffset(c20) = float4(0,0,0,10000); float4 PointLight2_Diffuse_AttenInvRange : packoffset(c21) = float4(1,1,1,1); float4 PointLight3_Position_AttenStart : packoffset(c22) = float4(0,0,0,10000); float4 PointLight3_Diffuse_AttenInvRange : packoffset(c23) = float4(1,1,1,1); float4 SHLight[7] : packoffset(c24) = float4(0,0,0,0); SamplerState compositorDiffuseSampler_s : register(s0); SamplerState compositorSpecularSampler_s : register(s1); SamplerState MuckDiffuseSampler_s : register(s2); SamplerState MuckNormalSampler_s : register(s3); SamplerState MuckSpecGlossSampler_s : register(s4); SamplerState TrackSampler_s : register(s5); Texture2D<float4> muckDiffuseTexture : register(t60); Texture2D<float4> muckNormalTexture : register(t61); Texture2D<float4> muckSpecGlossTexture : register(t62); Texture2D<float4> TerrainTrackTexture : register(t65); Texture2D<float4> compositorDiffuseTexture : register(t72); Texture2D<float4> compositorSpecularTexture : register(t73); Texture2D<float4> StereoParams : register(t125); Texture1D<float4> IniParams : register(t120); void main( float4 v0 : SV_Position0, float2 v1 : TEXCOORD0, float w1 : TEXCOORD3, float w1 : TEXCOORD4, float4 v2 : TEXCOORD1, float3 v3 : TEXCOORD2, out float4 o0 : SV_Target0, out float4 o1 : SV_Target1, out float4 o2 : SV_Target2) { float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9; uint4 bitmask, uiDest; float4 fDest; r0.xy = v3.xz; r0.z = 1; r1.x = dot(r0.xyz, cb0[73].xzwx); r1.y = dot(r0.xyz, cb0[74].xzwx); r0.x = dot(r0.xyz, cb0[76].xzwx); r0.xy = r1.xy / r0.xx; r0.xy = r0.xy * cb0[77].xyxx + cb0[77].zwzz; r1.xyzw = compositorDiffuseTexture.SampleLevel(compositorDiffuseSampler_s, r0.xy, 0).xyzw; r0.xyzw = compositorSpecularTexture.SampleLevel(compositorSpecularSampler_s, r0.xy, 0).xyzw; r0.xy = r0.xy * float2(2,2) + float2(-1,-1); r0.w = dot(r0.xy, r0.xy); r0.w = 1 + -r0.w; r0.w = sqrt(r0.w); r2.xyz = float3(1,-1,1) * v2.yxz; r3.xyz = r2.xyz * r0.xxx; r3.xyz = r0.www * v2.xyz + r3.xyz; r4.xyz = float3(1,-1,1) * v2.xzy; r0.xyw = r0.yyy * r4.xyz + r3.xyz; r1.w = dot(r0.xyw, r0.xyw); r1.w = rsqrt(r1.w); r0.xyw = r1.www * r0.xyw; r1.w = r0.z * r0.z; r2.w = sqrt(r0.z); r2.w = min(1, r2.w); r3.x = 0.5 < cb0[83].z; if (r3.x != 0) { r3.y = cb0[71].y * v3.z; r3.zw = v3.xx * cb0[71].xxxx + float2(0.5,0.5); r5.x = cb0[172].z; r5.yw = float2(0.5,0.5); r3.xz = r5.xy + r3.zy; r6.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.xz, 0).xyzw; r5.z = cb0[172].z; r3.xy = r5.zw + r3.wy; r3.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.xy, 0).xyzw; r3.yz = v3.xz * cb0[71].xxyx + float2(0,0.5); r5.xz = float2(0.5,0.5); r5.y = cb0[172].w; r5.xy = r5.xy + r3.yz; r7.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r5.xy, 0).xyzw; r5.w = cb0[172].w; r3.yz = r5.zw + r3.yz; r5.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.yz, 0).yzwx; r5.x = saturate(r6.x); r5.y = saturate(r3.x); r5.z = saturate(r7.x); r5.w = saturate(r5.w); r3.x = dot(r5.xyzw, float4(0.25,0.25,0.25,0.25)); r3.y = w1.x < 0.100000001; r3.z = 0.5 < cb0[173].x; r3.y = (int)r3.z | (int)r3.y; r3.w = w1.x * r3.x; r3.w = saturate(10 * r3.w); r4.w = -0.100000001 + w1.x; r4.w = saturate(-r4.w * 2.85714293 + 1); r4.w = r4.w * r3.x; r3.y = r3.y ? r3.w : r4.w; r6.xyz = float3(0,0,0) < cb0[170].xyzx; if (r6.x != 0) { r6.xw = v3.xz * cb0[70].xxxy + float2(0.5,0.5); r6.xw = cb0[71].zzzw * r6.xw; sincos(cb0[170].w, r7.x, r8.x); r9.x = -r7.x; r9.y = r8.x; r8.x = dot(r9.yx, r6.xw); r9.z = r7.x; r8.y = dot(r9.zy, r6.xw); r6.xw = r3.zz ? r8.xy : r6.xw; r6.xw = cb0[170].xxxx * r6.xw; r7.xyzw = muckDiffuseTexture.Sample(MuckDiffuseSampler_s, r6.xw).xyzw; r8.xyz = r7.xyz * r1.xyz; r9.xyz = r7.xyz + -r1.xyz; r9.xyz = r7.www * r9.xyz + r1.xyz; r7.xyz = -r1.xyz * r7.xyz + r9.xyz; r7.xyz = cb0[173].xxxx * r7.xyz + r8.xyz; r3.w = r7.w * r3.y; r7.xyz = r7.xyz + -r1.xyz; r1.xyz = r3.www * r7.xyz + r1.xyz; } r7.xyz = r1.xyz * r3.yyy; o1.xyz = r7.xyz * float3(-0.149999976,-0.149999976,-0.149999976) + r1.xyz; if (r6.y != 0) { r3.yw = v3.xz * cb0[70].xxxy + float2(0.5,0.5); r3.yw = cb0[71].zzzw * r3.yw; sincos(cb0[170].w, r6.x, r7.x); r8.x = -r6.x; r8.y = r7.x; r7.x = dot(r8.yx, r3.yw); r8.z = r6.x; r7.y = dot(r8.zy, r3.yw); r3.yw = r3.zz ? r7.xy : r3.yw; r3.yw = cb0[170].yyyy * r3.yw; r7.xyzw = muckNormalTexture.Sample(MuckNormalSampler_s, r3.yw).xyzw; r7.xy = r7.wy * float2(2,2) + float2(-1,-1); r3.y = dot(r7.xy, r7.xy); r3.y = 1 + -r3.y; r7.z = sqrt(abs(r3.y)); r3.y = dot(r7.xyz, r7.xyz); r3.y = rsqrt(r3.y); r6.xyw = r7.xyz * r3.yyy; r2.xyz = r6.xxx * r2.xyz; r2.xyz = r6.www * v2.xyz + r2.xyz; r2.xyz = r6.yyy * r4.xyz + r2.xyz; r3.y = dot(r2.xyz, r2.xyz); r3.y = rsqrt(r3.y); r2.xyz = r2.xyz * r3.yyy + -r0.xyw; r2.xyz = r3.xxx * r2.xyz + r0.xyw; r3.y = dot(r2.xyz, r2.xyz); r3.y = rsqrt(r3.y); r0.xyw = r3.yyy * r2.xyz; } r2.x = cb0[173].x < 0.5; r4.xy = r5.xy + -r5.zw; r4.z = -r4.x * r4.y + 1; r4.w = -r4.y; r2.y = dot(r4.xzw, r4.xzw); r2.y = rsqrt(r2.y); r2.z = 5 * r3.x; r2.z = min(0.800000012, r2.z); r3.y = saturate(5 * w1.x); r2.z = min(r3.y, r2.z); r4.xyz = r4.xzw * r2.yyy + -r0.xyw; r4.xyz = r2.zzz * r4.xyz + r0.xyw; r2.y = dot(r4.xyz, r4.xyz); r2.y = rsqrt(r2.y); r4.xyz = r4.xyz * r2.yyy; r0.xyw = r2.xxx ? r4.xyz : r0.xyw; if (r6.z != 0) { r2.xy = v3.xz * cb0[70].xyxx + float2(0.5,0.5); r2.xy = cb0[71].zwzz * r2.xy; sincos(cb0[170].w, r4.x, r5.x); r6.x = -r4.x; r6.y = r5.x; r5.x = dot(r6.yx, r2.xy); r6.z = r4.x; r5.y = dot(r6.zy, r2.xy); r2.xy = r3.zz ? r5.xy : r2.xy; r2.xy = cb0[170].zzzz * r2.xy; r4.xyzw = muckSpecGlossTexture.Sample(MuckSpecGlossSampler_s, r2.xy).xyzw; r2.x = cb0[173].x >= 0.5; r2.x = r2.x ? 1.000000 : 0; r2.y = r4.y * r4.y + -r4.x; r2.y = r2.x * r2.y + r4.x; r0.z = -r0.z * r0.z + r2.y; r1.w = r3.x * r0.z + r1.w; r0.z = sqrt(r4.y); r0.z = min(1, r0.z); r0.z = r0.z + -r4.y; r0.z = r2.x * r0.z + r4.y; r0.z = r0.z + -r2.w; r2.w = r3.x * r0.z + r2.w; } } else { o1.xyz = r1.xyz; } r2.w = saturate(r2.w); o1.w = 0.498039246 * r2.w; r1.xyz = r0.xyw >= float3(0,0,0); r1.xyz = r1.xyz ? 1.000000 : 0; r0.y = dot(r1.xyz, float3(2,4,8)); o0.xy = abs(r0.xw); o0.z = 0.00392156886 * r0.y; r0.x = 12.9200001 * r1.w; r0.y = log2(abs(r1.w)); r0.y = 0.416666657 * r0.y; r0.y = exp2(r0.y); r0.y = r0.y * 1.05499995 + -0.0549999997; r0.z = r1.w < 0.00313080009; r0.x = saturate(r0.z ? r0.x : r0.y); o0.w = 0.498039246 * r0.x; o2.xyzw = v0.zzzz; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.16384 // // using 3Dmigoto v1.2.7 on Sat Nov 14 17:43:40 2015 // // // Buffer Definitions: // // cbuffer GlobalBuffer // { // // float4x4 View; // Offset: 0 Size: 64 [unused] // float4x4 Projection; // Offset: 64 Size: 64 [unused] // float4x4 InvViewProj; // Offset: 128 Size: 64 [unused] // float3 EyePosition; // Offset: 192 Size: 12 [unused] // = 0x00000000 0x00000000 0x00000000 // float3 DirLight0_Dir; // Offset: 208 Size: 12 [unused] // = 0xbf13b646 0xbf13b646 0x3f13b646 // float4 DirLight0_Diffuse; // Offset: 224 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 PointLightActive; // Offset: 240 Size: 16 [unused] // = 0x00000000 0x00000000 0x00000000 0x00000000 // float4 PointLight0_Position_AttenStart;// Offset: 256 Size: 16 [unused] // = 0x00000000 0x00000000 0x00000000 0x461c4000 // float4 PointLight0_Diffuse_AttenInvRange;// Offset: 272 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 PointLight1_Position_AttenStart;// Offset: 288 Size: 16 [unused] // = 0x00000000 0x00000000 0x00000000 0x461c4000 // float4 PointLight1_Diffuse_AttenInvRange;// Offset: 304 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 PointLight2_Position_AttenStart;// Offset: 320 Size: 16 [unused] // = 0x00000000 0x00000000 0x00000000 0x461c4000 // float4 PointLight2_Diffuse_AttenInvRange;// Offset: 336 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 PointLight3_Position_AttenStart;// Offset: 352 Size: 16 [unused] // = 0x00000000 0x00000000 0x00000000 0x461c4000 // float4 PointLight3_Diffuse_AttenInvRange;// Offset: 368 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 SHLight[7]; // Offset: 384 Size: 112 [unused] // = 0x00000000 0x00000000 0x00000000 0x00000000 // 0x00000000 0x00000000 0x00000000 0x00000000 // 0x00000000 0x00000000 0x00000000 0x00000000 // 0x00000000 0x00000000 0x00000000 0x00000000 // 0x00000000 0x00000000 0x00000000 0x00000000 // 0x00000000 0x00000000 0x00000000 0x00000000 // 0x00000000 0x00000000 0x00000000 0x00000000 // float AmbientScale; // Offset: 496 Size: 4 [unused] // = 0x3f800000 // float AmbientScaleFX; // Offset: 500 Size: 4 [unused] // = 0x3f800000 // float4 AmbientRotation; // Offset: 512 Size: 16 [unused] // = 0x3f800000 0x00000000 0x00000000 0x3f800000 // float4x4 unAdjustedShadowViewMatrix;// Offset: 528 Size: 64 [unused] // float4x4 ShadowVPMatrix; // Offset: 592 Size: 64 [unused] // float4x4 ShadowVPMatrixNear; // Offset: 656 Size: 64 [unused] // float4x4 ShadowVPMatrixFar; // Offset: 720 Size: 64 [unused] // float4 ShadowNearShift; // Offset: 784 Size: 16 [unused] // float4 ShadowNearScale; // Offset: 800 Size: 16 [unused] // float3 ShadowNearFarCutOff; // Offset: 816 Size: 12 [unused] // float ShadowTextureResolution; // Offset: 828 Size: 4 [unused] // float2 ShadowBias; // Offset: 832 Size: 8 [unused] // = 0x3f800000 0x3dcccccd // float2 ShadowSampleOffsetPCF0; // Offset: 840 Size: 8 [unused] // float2 ShadowSampleOffsetPCF1; // Offset: 848 Size: 8 [unused] // float2 ShadowSampleOffsetPCF2; // Offset: 856 Size: 8 [unused] // float2 ShadowSampleOffsetPCF3; // Offset: 864 Size: 8 [unused] // float ShadowCubeDepthBias; // Offset: 872 Size: 4 [unused] // = 0x3f800000 // float ShadowCubeNormalBias; // Offset: 876 Size: 4 [unused] // = 0x3dcccccd // float3 ShadowCubeCoords[4]; // Offset: 880 Size: 60 [unused] // float ShadowCubeSizes[4]; // Offset: 944 Size: 52 [unused] // int CurrentShadowCube; // Offset: 996 Size: 4 [unused] // = 0xffffffff // float4x3 sun_cloud_matrix; // Offset: 1008 Size: 48 [unused] // float sun_cloud_intensity; // Offset: 1056 Size: 4 [unused] // float4 fogConstant; // Offset: 1072 Size: 16 [unused] // = 0x3b83126f 0xc6435000 0x41a00000 0x3fc00000 // float3 fog_light_direction; // Offset: 1088 Size: 12 [unused] // = 0x3f800000 0x00000000 0x00000000 // float2 g_LAO_Parameters; // Offset: 1104 Size: 8 [unused] // = 0x00000000 0x00000000 // float4 terrainSizeInv; // Offset: 1120 Size: 16 // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float2 playableSizeInv; // Offset: 1136 Size: 8 // = 0x3f800000 0x3f800000 // float2 chunkSize; // Offset: 1144 Size: 8 // = 0x3f800000 0x3f800000 // float2 terrainHeightRanges; // Offset: 1152 Size: 8 [unused] // = 0x43160000 0x43160000 // float4x4 compositorViewProjection; // Offset: 1168 Size: 64 // float4 compositorViewRemap; // Offset: 1232 Size: 16 // = 0x3f000000 0x3f000000 0x3f000000 0x3f000000 // float4 dummySpace[2]; // Offset: 1248 Size: 32 [unused] // float4 g_currentTime; // Offset: 1280 Size: 16 [unused] // = 0x00000000 0x00000000 0x00000000 0x00000000 // float4 snowParameters; // Offset: 1296 Size: 16 [unused] // = 0x00000000 0x3f800000 0x00000000 0x3f800000 // float4 snowEdgeFadeParameters; // Offset: 1312 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x41800000 0x40800000 // float4 snowDepthParameters; // Offset: 1328 Size: 16 // = 0x3ecccccd 0x3f800000 0x3f800000 0x3f800000 // float2 snowSparkleParameters; // Offset: 1344 Size: 8 [unused] // = 0x3fe66666 0x00000000 // float4 g_clipping_parameters; // Offset: 1360 Size: 16 [unused] // float4 exposure_control; // Offset: 1376 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x00000000 // float4 g_lighting_parameters; // Offset: 1392 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x00000000 0x00000000 // float4 g_desaturation; // Offset: 1408 Size: 16 [unused] // = 0x00000000 0x00000000 0x00000000 0x00000000 // float4 g_soldier_light_desaturation;// Offset: 1424 Size: 16 [unused] // = 0x00000000 0x00000000 0x00000000 0x00000000 // float4 g_vehicle_light_desaturation;// Offset: 1440 Size: 16 [unused] // = 0x00000000 0x00000000 0x00000000 0x00000000 // float2 atmosphericSkyBlend; // Offset: 1456 Size: 8 [unused] // = 0x3d21cac1 0xbd2a64c3 // float4 g_post_process_parameters; // Offset: 1472 Size: 16 [unused] // = 0x3e3851ec 0x40a00000 0x41200000 0x3f666666 // float postprocess_sepia; // Offset: 1488 Size: 4 [unused] // = 0x00000000 // float4 g_solder_light_colour; // Offset: 1504 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 g_solder_light_direction; // Offset: 1520 Size: 16 [unused] // = 0x00000000 0xbf800000 0x00000000 0x00000000 // float4 g_vehicle_light_colour; // Offset: 1536 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 g_vehicle_light_direction; // Offset: 1552 Size: 16 [unused] // = 0x00000000 0xbf800000 0x00000000 0x00000000 // float3 fxlight_sunDirection; // Offset: 1568 Size: 12 [unused] // = 0x00000000 0x00000000 0x3f800000 // float3 fxlight_sunColour; // Offset: 1584 Size: 12 [unused] // = 0x3f666666 0x3f800000 0x3f800000 // float3 fxlight_ambColour; // Offset: 1600 Size: 12 [unused] // = 0x3f000000 0x3f0ccccd 0x3f19999a // float2 fxlight_modifiers; // Offset: 1616 Size: 8 [unused] // = 0x3f800000 0x3dcccccd // float2 fx_texelSizes; // Offset: 1624 Size: 8 [unused] // = 0x3a000000 0x3f7fe000 // float4 WaterTint; // Offset: 1632 Size: 16 [unused] // float2 WaterAspectRatio; // Offset: 1648 Size: 8 [unused] // = 0x3f800000 0x3f800000 // float2 WaterColourWindScale; // Offset: 1656 Size: 8 [unused] // float4 WaterReflection_SurfaceOffset;// Offset: 1664 Size: 16 [unused] // float2 WaterReflection_WindDirection;// Offset: 1680 Size: 8 [unused] // float WaterReflection_SurfaceBumpiness;// Offset: 1688 Size: 4 [unused] // float4 WaterReflection_ScreenScaleOffset;// Offset: 1696 Size: 16 [unused] // float4 IceHealthThresholds; // Offset: 1712 Size: 16 [unused] // = 0x3ea8f5c3 0x3f28f5c3 0x3f800000 0x3f800000 // float4 IceSlushColour_Tiling; // Offset: 1728 Size: 16 [unused] // float4 IceStressedColour_Tiling; // Offset: 1744 Size: 16 [unused] // float4 IceSolidColour_Tiling; // Offset: 1760 Size: 16 [unused] // float2 IceSectorTiling_InvWidth; // Offset: 1776 Size: 8 [unused] // float2 IceSlushReveal; // Offset: 1784 Size: 8 [unused] // float4x4 ViewOverride[6]; // Offset: 1792 Size: 384 [unused] // float4x4 ProjectionOverride[6]; // Offset: 2176 Size: 384 [unused] // float4 FOWTextureWorldScaleOffset; // Offset: 2560 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x00000000 0x00000000 // float4 fow_visited; // Offset: 2576 Size: 16 [unused] // float4 fow_hidden; // Offset: 2592 Size: 16 [unused] // float4 fow_blend; // Offset: 2608 Size: 16 [unused] // float4 g_topDownRange; // Offset: 2624 Size: 16 [unused] // float4x4 topDownVPMatrix; // Offset: 2640 Size: 64 [unused] // float4 g_topDownTexureSize; // Offset: 2704 Size: 16 [unused] // = 0x00000000 0x00000000 0x3f800000 0x3f800000 // float4 muckParameters; // Offset: 2720 Size: 16 // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 g_windVectorAndTime; // Offset: 2736 Size: 16 [unused] // float4 g_trackMapSize; // Offset: 2752 Size: 16 // float g_snowIsMud; // Offset: 2768 Size: 4 // = 0x00000000 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // compositorDiffuseSampler sampler NA NA 0 1 // compositorSpecularSampler sampler NA NA 1 1 // MuckDiffuseSampler sampler NA NA 2 1 // MuckNormalSampler sampler NA NA 3 1 // MuckSpecGlossSampler sampler NA NA 4 1 // TrackSampler sampler NA NA 5 1 // muckDiffuseTexture texture float4 2d 60 1 // muckNormalTexture texture float4 2d 61 1 // muckSpecGlossTexture texture float4 2d 62 1 // TerrainTrackTexture texture float4 2d 65 1 // compositorDiffuseTexture texture float4 2d 72 1 // compositorSpecularTexture texture float4 2d 73 1 // GlobalBuffer cbuffer NA NA 0 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float z // TEXCOORD 0 xy 1 NONE float // TEXCOORD 3 z 1 NONE float z // TEXCOORD 4 w 1 NONE float // TEXCOORD 1 xyz 2 NONE float xyz // TEXCOORD 2 xyz 3 NONE float x z // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Target 0 xyzw 0 TARGET float xyzw // SV_Target 1 xyzw 1 TARGET float xyzw // SV_Target 2 xyzw 2 TARGET float xyzw // ps_4_0 dcl_constantbuffer cb0[174], immediateIndexed 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_resource_texture2d (float,float,float,float) t60 dcl_resource_texture2d (float,float,float,float) t61 dcl_resource_texture2d (float,float,float,float) t62 dcl_resource_texture2d (float,float,float,float) t65 dcl_resource_texture2d (float,float,float,float) t72 dcl_resource_texture2d (float,float,float,float) t73 dcl_input_ps_siv linear noperspective v0.z, position dcl_input_ps linear v1.z dcl_input_ps linear v2.xyz dcl_input_ps linear v3.xz dcl_output o0.xyzw dcl_output o1.xyzw dcl_output o2.xyzw dcl_temps 10 mov r0.xy, v3.xzxx mov r0.z, l(1.000000) dp3 r1.x, r0.xyzx, cb0[73].xzwx dp3 r1.y, r0.xyzx, cb0[74].xzwx dp3 r0.x, r0.xyzx, cb0[76].xzwx div r0.xy, r1.xyxx, r0.xxxx mad r0.xy, r0.xyxx, cb0[77].xyxx, cb0[77].zwzz sample_l r1.xyzw, r0.xyxx, t72.xyzw, s0, l(0.000000) sample_l r0.xyzw, r0.xyxx, t73.xyzw, s1, l(0.000000) mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000) dp2 r0.w, r0.xyxx, r0.xyxx add r0.w, -r0.w, l(1.000000) sqrt r0.w, r0.w mul r2.xyz, v2.yxzy, l(1.000000, -1.000000, 1.000000, 0.000000) mul r3.xyz, r0.xxxx, r2.xyzx mad r3.xyz, r0.wwww, v2.xyzx, r3.xyzx mul r4.xyz, v2.xzyx, l(1.000000, -1.000000, 1.000000, 0.000000) mad r0.xyw, r0.yyyy, r4.xyxz, r3.xyxz dp3 r1.w, r0.xywx, r0.xywx rsq r1.w, r1.w mul r0.xyw, r0.xyxw, r1.wwww mul r1.w, r0.z, r0.z sqrt r2.w, r0.z min r2.w, r2.w, l(1.000000) lt r3.x, l(0.500000), cb0[83].z if_nz r3.x mul r3.y, v3.z, cb0[71].y mad r3.zw, v3.xxxx, cb0[71].xxxx, l(0.000000, 0.000000, 0.500000, 0.500000) mov r5.x, cb0[172].z mov r5.yw, l(0,0.500000,0,0.500000) add r3.xz, r3.zzyz, r5.xxyx sample_l r6.xyzw, r3.xzxx, t65.xyzw, s5, l(0.000000) mov r5.z, -cb0[172].z add r3.xy, r3.wyww, r5.zwzz sample_l r3.xyzw, r3.xyxx, t65.xyzw, s5, l(0.000000) mad r3.yz, v3.xxzx, cb0[71].xxyx, l(0.000000, 0.000000, 0.500000, 0.000000) mov r5.xz, l(0.500000,0,0.500000,0) mov r5.y, cb0[172].w add r5.xy, r3.yzyy, r5.xyxx sample_l r7.xyzw, r5.xyxx, t65.xyzw, s5, l(0.000000) mov r5.w, -cb0[172].w add r3.yz, r3.yyzy, r5.zzwz sample_l r5.xyzw, r3.yzyy, t65.yzwx, s5, l(0.000000) mov_sat r5.x, r6.x mov_sat r5.y, r3.x mov_sat r5.z, r7.x mov_sat r5.w, r5.w dp4 r3.x, r5.xyzw, l(0.250000, 0.250000, 0.250000, 0.250000) lt r3.y, v1.z, l(0.100000) lt r3.z, l(0.500000), cb0[173].x or r3.y, r3.z, r3.y mul r3.w, r3.x, v1.z mul_sat r3.w, r3.w, l(10.000000) add r4.w, v1.z, l(-0.100000) mad_sat r4.w, -r4.w, l(2.857143), l(1.000000) mul r4.w, r3.x, r4.w movc r3.y, r3.y, r3.w, r4.w lt r6.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[170].xyzx if_nz r6.x mad r6.xw, v3.xxxz, cb0[70].xxxy, l(0.500000, 0.000000, 0.000000, 0.500000) mul r6.xw, r6.xxxw, cb0[71].zzzw sincos r7.x, r8.x, cb0[170].w mov r9.x, -r7.x mov r9.y, r8.x dp2 r8.x, r9.yxyy, r6.xwxx mov r9.z, r7.x dp2 r8.y, r9.zyzz, r6.xwxx movc r6.xw, r3.zzzz, r8.xxxy, r6.xxxw mul r6.xw, r6.xxxw, cb0[170].xxxx sample r7.xyzw, r6.xwxx, t60.xyzw, s2 mul r8.xyz, r1.xyzx, r7.xyzx add r9.xyz, -r1.xyzx, r7.xyzx mad r9.xyz, r7.wwww, r9.xyzx, r1.xyzx mad r7.xyz, -r1.xyzx, r7.xyzx, r9.xyzx mad r7.xyz, cb0[173].xxxx, r7.xyzx, r8.xyzx mul r3.w, r3.y, r7.w add r7.xyz, -r1.xyzx, r7.xyzx mad r1.xyz, r3.wwww, r7.xyzx, r1.xyzx endif mul r7.xyz, r3.yyyy, r1.xyzx mad o1.xyz, r7.xyzx, l(-0.149999976, -0.149999976, -0.149999976, 0.000000), r1.xyzx if_nz r6.y mad r3.yw, v3.xxxz, cb0[70].xxxy, l(0.000000, 0.500000, 0.000000, 0.500000) mul r3.yw, r3.yyyw, cb0[71].zzzw sincos r6.x, r7.x, cb0[170].w mov r8.x, -r6.x mov r8.y, r7.x dp2 r7.x, r8.yxyy, r3.ywyy mov r8.z, r6.x dp2 r7.y, r8.zyzz, r3.ywyy movc r3.yw, r3.zzzz, r7.xxxy, r3.yyyw mul r3.yw, r3.yyyw, cb0[170].yyyy sample r7.xyzw, r3.ywyy, t61.xyzw, s3 mad r7.xy, r7.wyww, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000) dp2 r3.y, r7.xyxx, r7.xyxx add r3.y, -r3.y, l(1.000000) sqrt r7.z, |r3.y| dp3 r3.y, r7.xyzx, r7.xyzx rsq r3.y, r3.y mul r6.xyw, r3.yyyy, r7.xyxz mul r2.xyz, r2.xyzx, r6.xxxx mad r2.xyz, r6.wwww, v2.xyzx, r2.xyzx mad r2.xyz, r6.yyyy, r4.xyzx, r2.xyzx dp3 r3.y, r2.xyzx, r2.xyzx rsq r3.y, r3.y mad r2.xyz, r2.xyzx, r3.yyyy, -r0.xywx mad r2.xyz, r3.xxxx, r2.xyzx, r0.xywx dp3 r3.y, r2.xyzx, r2.xyzx rsq r3.y, r3.y mul r0.xyw, r2.xyxz, r3.yyyy endif lt r2.x, cb0[173].x, l(0.500000) add r4.xy, -r5.zwzz, r5.xyxx mad r4.z, -r4.x, r4.y, l(1.000000) mov r4.w, -r4.y dp3 r2.y, r4.xzwx, r4.xzwx rsq r2.y, r2.y mul r2.z, r3.x, l(5.000000) min r2.z, r2.z, l(0.800000) mul_sat r3.y, v1.z, l(5.000000) min r2.z, r2.z, r3.y mad r4.xyz, r4.xzwx, r2.yyyy, -r0.xywx mad r4.xyz, r2.zzzz, r4.xyzx, r0.xywx dp3 r2.y, r4.xyzx, r4.xyzx rsq r2.y, r2.y mul r4.xyz, r2.yyyy, r4.xyzx movc r0.xyw, r2.xxxx, r4.xyxz, r0.xyxw if_nz r6.z mad r2.xy, v3.xzxx, cb0[70].xyxx, l(0.500000, 0.500000, 0.000000, 0.000000) mul r2.xy, r2.xyxx, cb0[71].zwzz sincos r4.x, r5.x, cb0[170].w mov r6.x, -r4.x mov r6.y, r5.x dp2 r5.x, r6.yxyy, r2.xyxx mov r6.z, r4.x dp2 r5.y, r6.zyzz, r2.xyxx movc r2.xy, r3.zzzz, r5.xyxx, r2.xyxx mul r2.xy, r2.xyxx, cb0[170].zzzz sample r4.xyzw, r2.xyxx, t62.xyzw, s4 ge r2.x, cb0[173].x, l(0.500000) and r2.x, r2.x, l(0x3f800000) mad r2.y, r4.y, r4.y, -r4.x mad r2.y, r2.x, r2.y, r4.x mad r0.z, -r0.z, r0.z, r2.y mad r1.w, r3.x, r0.z, r1.w sqrt r0.z, r4.y min r0.z, r0.z, l(1.000000) add r0.z, -r4.y, r0.z mad r0.z, r2.x, r0.z, r4.y add r0.z, -r2.w, r0.z mad r2.w, r3.x, r0.z, r2.w endif else mov o1.xyz, r1.xyzx endif mov_sat r2.w, r2.w mul o1.w, r2.w, l(0.498039246) ge r1.xyz, r0.xywx, l(0.000000, 0.000000, 0.000000, 0.000000) and r1.xyz, r1.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0) dp3 r0.y, r1.xyzx, l(2.000000, 4.000000, 8.000000, 0.000000) mov o0.xy, |r0.xwxx| mul o0.z, r0.y, l(0.00392156886) mul r0.x, r1.w, l(12.920000) log r0.y, |r1.w| mul r0.y, r0.y, l(0.416666657) exp r0.y, r0.y mad r0.y, r0.y, l(1.055000), l(-0.055000) lt r0.z, r1.w, l(0.00313080009) movc_sat r0.x, r0.z, r0.x, r0.y mul o0.w, r0.x, l(0.498039246) mov o2.xyzw, v0.zzzz ret // Approximately 172 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code] here is the code in question I guess I could not have chosen a worse start lol [/quote] Hi - I looked at this and the VS you posted and this looks like a common pattern. I have not tried it, so I might be wrong, but what is going on is the VS is sending out the World coord in o3, then it's being used in the PS in the variable v3, in particular it is being multiplied by one of the shadow matrices cb0[73-75]. This will be wrong. So the variable v3 needs correcting. I put some code below in the PS, but to be honest its probably better to fix it in the VS as the same VS will probably feed several PS. Let me know if this does anything. Oh, yeah, and there are some errors in the HLSL, the header information is chopped off. [code] //PS cbuffer GlobalBuffer : register(b0) { float4x4 View : packoffset(c0); float4x4 Projection : packoffset(c4); float4x4 InvViewProj : packoffset(c8); float3 EyePosition : packoffset(c12) = float3(0,0,0); float3 DirLight0_Dir : packoffset(c13) = float3(-0.577000022,-0.577000022,0.577000022); float4 DirLight0_Diffuse : packoffset(c14) = float4(1,1,1,1); float4 PointLightActive : packoffset(c15) = float4(0,0,0,0); float4 PointLight0_Position_AttenStart : packoffset(c16) = float4(0,0,0,10000); float4 PointLight0_Diffuse_AttenInvRange : packoffset(c17) = float4(1,1,1,1); float4 PointLight1_Position_AttenStart : packoffset(c18) = float4(0,0,0,10000); float4 PointLight1_Diffuse_AttenInvRange : packoffset(c19) = float4(1,1,1,1); float4 PointLight2_Position_AttenStart : packoffset(c20) = float4(0,0,0,10000); float4 PointLight2_Diffuse_AttenInvRange : packoffset(c21) = float4(1,1,1,1); float4 PointLight3_Position_AttenStart : packoffset(c22) = float4(0,0,0,10000); float4 PointLight3_Diffuse_AttenInvRange : packoffset(c23) = float4(1,1,1,1); float4 SHLight[7] : packoffset(c24) = float4(0,0,0,0); //** ERROR HERE AS THE BUFFER DEFINITION IS CUT OFF SamplerState compositorDiffuseSampler_s : register(s0); SamplerState compositorSpecularSampler_s : register(s1); SamplerState MuckDiffuseSampler_s : register(s2); SamplerState MuckNormalSampler_s : register(s3); SamplerState MuckSpecGlossSampler_s : register(s4); SamplerState TrackSampler_s : register(s5); Texture2D<float4> muckDiffuseTexture : register(t60); Texture2D<float4> muckNormalTexture : register(t61); Texture2D<float4> muckSpecGlossTexture : register(t62); Texture2D<float4> TerrainTrackTexture : register(t65); Texture2D<float4> compositorDiffuseTexture : register(t72); Texture2D<float4> compositorSpecularTexture : register(t73); Texture2D<float4> StereoParams : register(t125); Texture1D<float4> IniParams : register(t120); void main( float4 v0 : SV_Position0, float2 v1 : TEXCOORD0, float w1 : TEXCOORD3, float w1 : TEXCOORD4, float4 v2 : TEXCOORD1, float3 v3 : TEXCOORD2, out float4 o0 : SV_Target0, out float4 o1 : SV_Target1, out float4 o2 : SV_Target2) { float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9; uint4 bitmask, uiDest; float4 fDest; r0.xy = v3.xz; //From the VS, v3 is the WORLD COORD. But this shader is in stereo space, so the World Coord will be wrong. So we need to fix it. r0.z = 1; //Try this: float4 r20, r21; r20.xyz = v3.xyz; r20.w = 1; r21.x = dot(r20.xyzw, View._m00_m10_m20_m30); r21.y = dot(r20.xyzw, View._m01_m11_m21_m31); r21.z = dot(r20.xyzw, View._m02_m12_m22_m32); r21.w = dot(r20.xyzw, View._m03_m13_m23_m33); r20.x = dot(r21.xyzw, Projection._m00_m10_m20_m30); r20.y = dot(r21.xyzw, Projection._m01_m11_m21_m31); r20.z = dot(r21.xyzw, Projection._m02_m12_m22_m32); r20.w = dot(r21.xyzw, Projection._m03_m13_m23_m33); float4 stereo = StereoParams.Load(0); r20.x -= stereo.x*(r20.w - stereo.y); // Note this may need to be "+=", try that as well r21.x = dot(r20.xyzw, InvViewProj._m00_m10_m20_m30); r21.y = dot(r20.xyzw, InvViewProj._m01_m11_m21_m31); r21.z = dot(r20.xyzw, InvViewProj._m02_m12_m22_m32); r21.w = dot(r20.xyzw, InvViewProj._m03_m13_m23_m33); r0.xy = r21.xy /r21.ww; r0.z = 1; //...continue with original code r1.x = dot(r0.xyz, cb0[73].xzwx); //From the ASM section of the shader, cb0[73] is one of the Shadow Matrices r1.y = dot(r0.xyz, cb0[74].xzwx); r0.x = dot(r0.xyz, cb0[76].xzwx); r0.xy = r1.xy / r0.xx; r0.xy = r0.xy * cb0[77].xyxx + cb0[77].zwzz; r1.xyzw = compositorDiffuseTexture.SampleLevel(compositorDiffuseSampler_s, r0.xy, 0).xyzw; r0.xyzw = compositorSpecularTexture.SampleLevel(compositorSpecularSampler_s, r0.xy, 0).xyzw; r0.xy = r0.xy * float2(2,2) + float2(-1,-1); r0.w = dot(r0.xy, r0.xy); r0.w = 1 + -r0.w; r0.w = sqrt(r0.w); r2.xyz = float3(1,-1,1) * v2.yxz; r3.xyz = r2.xyz * r0.xxx; r3.xyz = r0.www * v2.xyz + r3.xyz; r4.xyz = float3(1,-1,1) * v2.xzy; r0.xyw = r0.yyy * r4.xyz + r3.xyz; r1.w = dot(r0.xyw, r0.xyw); r1.w = rsqrt(r1.w); r0.xyw = r1.www * r0.xyw; r1.w = r0.z * r0.z; r2.w = sqrt(r0.z); r2.w = min(1, r2.w); r3.x = 0.5 < cb0[83].z; if (r3.x != 0) { r3.y = cb0[71].y * v3.z; r3.zw = v3.xx * cb0[71].xxxx + float2(0.5,0.5); r5.x = cb0[172].z; r5.yw = float2(0.5,0.5); r3.xz = r5.xy + r3.zy; r6.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.xz, 0).xyzw; r5.z = cb0[172].z; r3.xy = r5.zw + r3.wy; r3.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.xy, 0).xyzw; r3.yz = v3.xz * cb0[71].xxyx + float2(0,0.5); r5.xz = float2(0.5,0.5); r5.y = cb0[172].w; r5.xy = r5.xy + r3.yz; r7.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r5.xy, 0).xyzw; r5.w = cb0[172].w; r3.yz = r5.zw + r3.yz; r5.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.yz, 0).yzwx; r5.x = saturate(r6.x); r5.y = saturate(r3.x); r5.z = saturate(r7.x); r5.w = saturate(r5.w); r3.x = dot(r5.xyzw, float4(0.25,0.25,0.25,0.25)); r3.y = w1.x < 0.100000001; r3.z = 0.5 < cb0[173].x; r3.y = (int)r3.z | (int)r3.y; r3.w = w1.x * r3.x; r3.w = saturate(10 * r3.w); r4.w = -0.100000001 + w1.x; r4.w = saturate(-r4.w * 2.85714293 + 1); r4.w = r4.w * r3.x; r3.y = r3.y ? r3.w : r4.w; r6.xyz = float3(0,0,0) < cb0[170].xyzx; if (r6.x != 0) { r6.xw = v3.xz * cb0[70].xxxy + float2(0.5,0.5); r6.xw = cb0[71].zzzw * r6.xw; sincos(cb0[170].w, r7.x, r8.x); r9.x = -r7.x; r9.y = r8.x; r8.x = dot(r9.yx, r6.xw); r9.z = r7.x; r8.y = dot(r9.zy, r6.xw); r6.xw = r3.zz ? r8.xy : r6.xw; r6.xw = cb0[170].xxxx * r6.xw; r7.xyzw = muckDiffuseTexture.Sample(MuckDiffuseSampler_s, r6.xw).xyzw; r8.xyz = r7.xyz * r1.xyz; r9.xyz = r7.xyz + -r1.xyz; r9.xyz = r7.www * r9.xyz + r1.xyz; r7.xyz = -r1.xyz * r7.xyz + r9.xyz; r7.xyz = cb0[173].xxxx * r7.xyz + r8.xyz; r3.w = r7.w * r3.y; r7.xyz = r7.xyz + -r1.xyz; r1.xyz = r3.www * r7.xyz + r1.xyz; } r7.xyz = r1.xyz * r3.yyy; o1.xyz = r7.xyz * float3(-0.149999976,-0.149999976,-0.149999976) + r1.xyz; if (r6.y != 0) { r3.yw = v3.xz * cb0[70].xxxy + float2(0.5,0.5); r3.yw = cb0[71].zzzw * r3.yw; sincos(cb0[170].w, r6.x, r7.x); r8.x = -r6.x; r8.y = r7.x; r7.x = dot(r8.yx, r3.yw); r8.z = r6.x; r7.y = dot(r8.zy, r3.yw); r3.yw = r3.zz ? r7.xy : r3.yw; r3.yw = cb0[170].yyyy * r3.yw; r7.xyzw = muckNormalTexture.Sample(MuckNormalSampler_s, r3.yw).xyzw; r7.xy = r7.wy * float2(2,2) + float2(-1,-1); r3.y = dot(r7.xy, r7.xy); r3.y = 1 + -r3.y; r7.z = sqrt(abs(r3.y)); r3.y = dot(r7.xyz, r7.xyz); r3.y = rsqrt(r3.y); r6.xyw = r7.xyz * r3.yyy; r2.xyz = r6.xxx * r2.xyz; r2.xyz = r6.www * v2.xyz + r2.xyz; r2.xyz = r6.yyy * r4.xyz + r2.xyz; r3.y = dot(r2.xyz, r2.xyz); r3.y = rsqrt(r3.y); r2.xyz = r2.xyz * r3.yyy + -r0.xyw; r2.xyz = r3.xxx * r2.xyz + r0.xyw; r3.y = dot(r2.xyz, r2.xyz); r3.y = rsqrt(r3.y); r0.xyw = r3.yyy * r2.xyz; } r2.x = cb0[173].x < 0.5; r4.xy = r5.xy + -r5.zw; r4.z = -r4.x * r4.y + 1; r4.w = -r4.y; r2.y = dot(r4.xzw, r4.xzw); r2.y = rsqrt(r2.y); r2.z = 5 * r3.x; r2.z = min(0.800000012, r2.z); r3.y = saturate(5 * w1.x); r2.z = min(r3.y, r2.z); r4.xyz = r4.xzw * r2.yyy + -r0.xyw; r4.xyz = r2.zzz * r4.xyz + r0.xyw; r2.y = dot(r4.xyz, r4.xyz); r2.y = rsqrt(r2.y); r4.xyz = r4.xyz * r2.yyy; r0.xyw = r2.xxx ? r4.xyz : r0.xyw; if (r6.z != 0) { r2.xy = v3.xz * cb0[70].xyxx + float2(0.5,0.5); r2.xy = cb0[71].zwzz * r2.xy; sincos(cb0[170].w, r4.x, r5.x); r6.x = -r4.x; r6.y = r5.x; r5.x = dot(r6.yx, r2.xy); r6.z = r4.x; r5.y = dot(r6.zy, r2.xy); r2.xy = r3.zz ? r5.xy : r2.xy; r2.xy = cb0[170].zzzz * r2.xy; r4.xyzw = muckSpecGlossTexture.Sample(MuckSpecGlossSampler_s, r2.xy).xyzw; r2.x = cb0[173].x >= 0.5; r2.x = r2.x ? 1.000000 : 0; r2.y = r4.y * r4.y + -r4.x; r2.y = r2.x * r2.y + r4.x; r0.z = -r0.z * r0.z + r2.y; r1.w = r3.x * r0.z + r1.w; r0.z = sqrt(r4.y); r0.z = min(1, r0.z); r0.z = r0.z + -r4.y; r0.z = r2.x * r0.z + r4.y; r0.z = r0.z + -r2.w; r2.w = r3.x * r0.z + r2.w; } } else { o1.xyz = r1.xyz; } r2.w = saturate(r2.w); o1.w = 0.498039246 * r2.w; r1.xyz = r0.xyw >= float3(0,0,0); r1.xyz = r1.xyz ? 1.000000 : 0; r0.y = dot(r1.xyz, float3(2,4,8)); o0.xy = abs(r0.xw); o0.z = 0.00392156886 * r0.y; r0.x = 12.9200001 * r1.w; r0.y = log2(abs(r1.w)); r0.y = 0.416666657 * r0.y; r0.y = exp2(r0.y); r0.y = r0.y * 1.05499995 + -0.0549999997; r0.z = r1.w < 0.00313080009; r0.x = saturate(r0.z ? r0.x : r0.y); o0.w = 0.498039246 * r0.x; o2.xyzw = v0.zzzz; return; } [/code]
tehace said:
cbuffer GlobalBuffer : register(b0)
{
float4x4 View : packoffset(c0);
float4x4 Projection : packoffset(c4);
float4x4 InvViewProj : packoffset(c8);
float3 EyePosition : packoffset(c12) = float3(0,0,0);
float3 DirLight0_Dir : packoffset(c13) = float3(-0.577000022,-0.577000022,0.577000022);
float4 DirLight0_Diffuse : packoffset(c14) = float4(1,1,1,1);
float4 PointLightActive : packoffset(c15) = float4(0,0,0,0);
float4 PointLight0_Position_AttenStart : packoffset(c16) = float4(0,0,0,10000);
float4 PointLight0_Diffuse_AttenInvRange : packoffset(c17) = float4(1,1,1,1);
float4 PointLight1_Position_AttenStart : packoffset(c18) = float4(0,0,0,10000);
float4 PointLight1_Diffuse_AttenInvRange : packoffset(c19) = float4(1,1,1,1);
float4 PointLight2_Position_AttenStart : packoffset(c20) = float4(0,0,0,10000);
float4 PointLight2_Diffuse_AttenInvRange : packoffset(c21) = float4(1,1,1,1);
float4 PointLight3_Position_AttenStart : packoffset(c22) = float4(0,0,0,10000);
float4 PointLight3_Diffuse_AttenInvRange : packoffset(c23) = float4(1,1,1,1);
float4 SHLight[7] : packoffset(c24) = float4(0,0,0,0);
SamplerState compositorDiffuseSampler_s : register(s0);
SamplerState compositorSpecularSampler_s : register(s1);
SamplerState MuckDiffuseSampler_s : register(s2);
SamplerState MuckNormalSampler_s : register(s3);
SamplerState MuckSpecGlossSampler_s : register(s4);
SamplerState TrackSampler_s : register(s5);
Texture2D<float4> muckDiffuseTexture : register(t60);
Texture2D<float4> muckNormalTexture : register(t61);
Texture2D<float4> muckSpecGlossTexture : register(t62);
Texture2D<float4> TerrainTrackTexture : register(t65);
Texture2D<float4> compositorDiffuseTexture : register(t72);
Texture2D<float4> compositorSpecularTexture : register(t73);

Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main(
float4 v0 : SV_Position0,
float2 v1 : TEXCOORD0,
float w1 : TEXCOORD3,
float w1 : TEXCOORD4,
float4 v2 : TEXCOORD1,
float3 v3 : TEXCOORD2,
out float4 o0 : SV_Target0,
out float4 o1 : SV_Target1,
out float4 o2 : SV_Target2)
{
float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9;
uint4 bitmask, uiDest;
float4 fDest;

r0.xy = v3.xz;
r0.z = 1;
r1.x = dot(r0.xyz, cb0[73].xzwx);
r1.y = dot(r0.xyz, cb0[74].xzwx);
r0.x = dot(r0.xyz, cb0[76].xzwx);
r0.xy = r1.xy / r0.xx;
r0.xy = r0.xy * cb0[77].xyxx + cb0[77].zwzz;
r1.xyzw = compositorDiffuseTexture.SampleLevel(compositorDiffuseSampler_s, r0.xy, 0).xyzw;
r0.xyzw = compositorSpecularTexture.SampleLevel(compositorSpecularSampler_s, r0.xy, 0).xyzw;
r0.xy = r0.xy * float2(2,2) + float2(-1,-1);
r0.w = dot(r0.xy, r0.xy);
r0.w = 1 + -r0.w;
r0.w = sqrt(r0.w);
r2.xyz = float3(1,-1,1) * v2.yxz;
r3.xyz = r2.xyz * r0.xxx;
r3.xyz = r0.www * v2.xyz + r3.xyz;
r4.xyz = float3(1,-1,1) * v2.xzy;
r0.xyw = r0.yyy * r4.xyz + r3.xyz;
r1.w = dot(r0.xyw, r0.xyw);
r1.w = rsqrt(r1.w);
r0.xyw = r1.www * r0.xyw;
r1.w = r0.z * r0.z;
r2.w = sqrt(r0.z);
r2.w = min(1, r2.w);
r3.x = 0.5 < cb0[83].z;
if (r3.x != 0) {
r3.y = cb0[71].y * v3.z;
r3.zw = v3.xx * cb0[71].xxxx + float2(0.5,0.5);
r5.x = cb0[172].z;
r5.yw = float2(0.5,0.5);
r3.xz = r5.xy + r3.zy;
r6.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.xz, 0).xyzw;
r5.z = cb0[172].z;
r3.xy = r5.zw + r3.wy;
r3.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.xy, 0).xyzw;
r3.yz = v3.xz * cb0[71].xxyx + float2(0,0.5);
r5.xz = float2(0.5,0.5);
r5.y = cb0[172].w;
r5.xy = r5.xy + r3.yz;
r7.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r5.xy, 0).xyzw;
r5.w = cb0[172].w;
r3.yz = r5.zw + r3.yz;
r5.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.yz, 0).yzwx;
r5.x = saturate(r6.x);
r5.y = saturate(r3.x);
r5.z = saturate(r7.x);
r5.w = saturate(r5.w);
r3.x = dot(r5.xyzw, float4(0.25,0.25,0.25,0.25));
r3.y = w1.x < 0.100000001;
r3.z = 0.5 < cb0[173].x;
r3.y = (int)r3.z | (int)r3.y;
r3.w = w1.x * r3.x;
r3.w = saturate(10 * r3.w);
r4.w = -0.100000001 + w1.x;
r4.w = saturate(-r4.w * 2.85714293 + 1);
r4.w = r4.w * r3.x;
r3.y = r3.y ? r3.w : r4.w;
r6.xyz = float3(0,0,0) < cb0[170].xyzx;
if (r6.x != 0) {
r6.xw = v3.xz * cb0[70].xxxy + float2(0.5,0.5);
r6.xw = cb0[71].zzzw * r6.xw;
sincos(cb0[170].w, r7.x, r8.x);
r9.x = -r7.x;
r9.y = r8.x;
r8.x = dot(r9.yx, r6.xw);
r9.z = r7.x;
r8.y = dot(r9.zy, r6.xw);
r6.xw = r3.zz ? r8.xy : r6.xw;
r6.xw = cb0[170].xxxx * r6.xw;
r7.xyzw = muckDiffuseTexture.Sample(MuckDiffuseSampler_s, r6.xw).xyzw;
r8.xyz = r7.xyz * r1.xyz;
r9.xyz = r7.xyz + -r1.xyz;
r9.xyz = r7.www * r9.xyz + r1.xyz;
r7.xyz = -r1.xyz * r7.xyz + r9.xyz;
r7.xyz = cb0[173].xxxx * r7.xyz + r8.xyz;
r3.w = r7.w * r3.y;
r7.xyz = r7.xyz + -r1.xyz;
r1.xyz = r3.www * r7.xyz + r1.xyz;
}
r7.xyz = r1.xyz * r3.yyy;
o1.xyz = r7.xyz * float3(-0.149999976,-0.149999976,-0.149999976) + r1.xyz;
if (r6.y != 0) {
r3.yw = v3.xz * cb0[70].xxxy + float2(0.5,0.5);
r3.yw = cb0[71].zzzw * r3.yw;
sincos(cb0[170].w, r6.x, r7.x);
r8.x = -r6.x;
r8.y = r7.x;
r7.x = dot(r8.yx, r3.yw);
r8.z = r6.x;
r7.y = dot(r8.zy, r3.yw);
r3.yw = r3.zz ? r7.xy : r3.yw;
r3.yw = cb0[170].yyyy * r3.yw;
r7.xyzw = muckNormalTexture.Sample(MuckNormalSampler_s, r3.yw).xyzw;
r7.xy = r7.wy * float2(2,2) + float2(-1,-1);
r3.y = dot(r7.xy, r7.xy);
r3.y = 1 + -r3.y;
r7.z = sqrt(abs(r3.y));
r3.y = dot(r7.xyz, r7.xyz);
r3.y = rsqrt(r3.y);
r6.xyw = r7.xyz * r3.yyy;
r2.xyz = r6.xxx * r2.xyz;
r2.xyz = r6.www * v2.xyz + r2.xyz;
r2.xyz = r6.yyy * r4.xyz + r2.xyz;
r3.y = dot(r2.xyz, r2.xyz);
r3.y = rsqrt(r3.y);
r2.xyz = r2.xyz * r3.yyy + -r0.xyw;
r2.xyz = r3.xxx * r2.xyz + r0.xyw;
r3.y = dot(r2.xyz, r2.xyz);
r3.y = rsqrt(r3.y);
r0.xyw = r3.yyy * r2.xyz;
}
r2.x = cb0[173].x < 0.5;
r4.xy = r5.xy + -r5.zw;
r4.z = -r4.x * r4.y + 1;
r4.w = -r4.y;
r2.y = dot(r4.xzw, r4.xzw);
r2.y = rsqrt(r2.y);
r2.z = 5 * r3.x;
r2.z = min(0.800000012, r2.z);
r3.y = saturate(5 * w1.x);
r2.z = min(r3.y, r2.z);
r4.xyz = r4.xzw * r2.yyy + -r0.xyw;
r4.xyz = r2.zzz * r4.xyz + r0.xyw;
r2.y = dot(r4.xyz, r4.xyz);
r2.y = rsqrt(r2.y);
r4.xyz = r4.xyz * r2.yyy;
r0.xyw = r2.xxx ? r4.xyz : r0.xyw;
if (r6.z != 0) {
r2.xy = v3.xz * cb0[70].xyxx + float2(0.5,0.5);
r2.xy = cb0[71].zwzz * r2.xy;
sincos(cb0[170].w, r4.x, r5.x);
r6.x = -r4.x;
r6.y = r5.x;
r5.x = dot(r6.yx, r2.xy);
r6.z = r4.x;
r5.y = dot(r6.zy, r2.xy);
r2.xy = r3.zz ? r5.xy : r2.xy;
r2.xy = cb0[170].zzzz * r2.xy;
r4.xyzw = muckSpecGlossTexture.Sample(MuckSpecGlossSampler_s, r2.xy).xyzw;
r2.x = cb0[173].x >= 0.5;
r2.x = r2.x ? 1.000000 : 0;
r2.y = r4.y * r4.y + -r4.x;
r2.y = r2.x * r2.y + r4.x;
r0.z = -r0.z * r0.z + r2.y;
r1.w = r3.x * r0.z + r1.w;
r0.z = sqrt(r4.y);
r0.z = min(1, r0.z);
r0.z = r0.z + -r4.y;
r0.z = r2.x * r0.z + r4.y;
r0.z = r0.z + -r2.w;
r2.w = r3.x * r0.z + r2.w;
}
} else {
o1.xyz = r1.xyz;
}
r2.w = saturate(r2.w);
o1.w = 0.498039246 * r2.w;
r1.xyz = r0.xyw >= float3(0,0,0);
r1.xyz = r1.xyz ? 1.000000 : 0;
r0.y = dot(r1.xyz, float3(2,4,8));
o0.xy = abs(r0.xw);
o0.z = 0.00392156886 * r0.y;
r0.x = 12.9200001 * r1.w;
r0.y = log2(abs(r1.w));
r0.y = 0.416666657 * r0.y;
r0.y = exp2(r0.y);
r0.y = r0.y * 1.05499995 + -0.0549999997;
r0.z = r1.w < 0.00313080009;
r0.x = saturate(r0.z ? r0.x : r0.y);
o0.w = 0.498039246 * r0.x;
o2.xyzw = v0.zzzz;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.16384
//
// using 3Dmigoto v1.2.7 on Sat Nov 14 17:43:40 2015
//
//
// Buffer Definitions:
//
// cbuffer GlobalBuffer
// {
//
// float4x4 View; // Offset: 0 Size: 64 [unused]
// float4x4 Projection; // Offset: 64 Size: 64 [unused]
// float4x4 InvViewProj; // Offset: 128 Size: 64 [unused]
// float3 EyePosition; // Offset: 192 Size: 12 [unused]
// = 0x00000000 0x00000000 0x00000000
// float3 DirLight0_Dir; // Offset: 208 Size: 12 [unused]
// = 0xbf13b646 0xbf13b646 0x3f13b646
// float4 DirLight0_Diffuse; // Offset: 224 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 PointLightActive; // Offset: 240 Size: 16 [unused]
// = 0x00000000 0x00000000 0x00000000 0x00000000
// float4 PointLight0_Position_AttenStart;// Offset: 256 Size: 16 [unused]
// = 0x00000000 0x00000000 0x00000000 0x461c4000
// float4 PointLight0_Diffuse_AttenInvRange;// Offset: 272 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 PointLight1_Position_AttenStart;// Offset: 288 Size: 16 [unused]
// = 0x00000000 0x00000000 0x00000000 0x461c4000
// float4 PointLight1_Diffuse_AttenInvRange;// Offset: 304 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 PointLight2_Position_AttenStart;// Offset: 320 Size: 16 [unused]
// = 0x00000000 0x00000000 0x00000000 0x461c4000
// float4 PointLight2_Diffuse_AttenInvRange;// Offset: 336 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 PointLight3_Position_AttenStart;// Offset: 352 Size: 16 [unused]
// = 0x00000000 0x00000000 0x00000000 0x461c4000
// float4 PointLight3_Diffuse_AttenInvRange;// Offset: 368 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 SHLight[7]; // Offset: 384 Size: 112 [unused]
// = 0x00000000 0x00000000 0x00000000 0x00000000
// 0x00000000 0x00000000 0x00000000 0x00000000
// 0x00000000 0x00000000 0x00000000 0x00000000
// 0x00000000 0x00000000 0x00000000 0x00000000
// 0x00000000 0x00000000 0x00000000 0x00000000
// 0x00000000 0x00000000 0x00000000 0x00000000
// 0x00000000 0x00000000 0x00000000 0x00000000
// float AmbientScale; // Offset: 496 Size: 4 [unused]
// = 0x3f800000
// float AmbientScaleFX; // Offset: 500 Size: 4 [unused]
// = 0x3f800000
// float4 AmbientRotation; // Offset: 512 Size: 16 [unused]
// = 0x3f800000 0x00000000 0x00000000 0x3f800000
// float4x4 unAdjustedShadowViewMatrix;// Offset: 528 Size: 64 [unused]
// float4x4 ShadowVPMatrix; // Offset: 592 Size: 64 [unused]
// float4x4 ShadowVPMatrixNear; // Offset: 656 Size: 64 [unused]
// float4x4 ShadowVPMatrixFar; // Offset: 720 Size: 64 [unused]
// float4 ShadowNearShift; // Offset: 784 Size: 16 [unused]
// float4 ShadowNearScale; // Offset: 800 Size: 16 [unused]
// float3 ShadowNearFarCutOff; // Offset: 816 Size: 12 [unused]
// float ShadowTextureResolution; // Offset: 828 Size: 4 [unused]
// float2 ShadowBias; // Offset: 832 Size: 8 [unused]
// = 0x3f800000 0x3dcccccd
// float2 ShadowSampleOffsetPCF0; // Offset: 840 Size: 8 [unused]
// float2 ShadowSampleOffsetPCF1; // Offset: 848 Size: 8 [unused]
// float2 ShadowSampleOffsetPCF2; // Offset: 856 Size: 8 [unused]
// float2 ShadowSampleOffsetPCF3; // Offset: 864 Size: 8 [unused]
// float ShadowCubeDepthBias; // Offset: 872 Size: 4 [unused]
// = 0x3f800000
// float ShadowCubeNormalBias; // Offset: 876 Size: 4 [unused]
// = 0x3dcccccd
// float3 ShadowCubeCoords[4]; // Offset: 880 Size: 60 [unused]
// float ShadowCubeSizes[4]; // Offset: 944 Size: 52 [unused]
// int CurrentShadowCube; // Offset: 996 Size: 4 [unused]
// = 0xffffffff
// float4x3 sun_cloud_matrix; // Offset: 1008 Size: 48 [unused]
// float sun_cloud_intensity; // Offset: 1056 Size: 4 [unused]
// float4 fogConstant; // Offset: 1072 Size: 16 [unused]
// = 0x3b83126f 0xc6435000 0x41a00000 0x3fc00000
// float3 fog_light_direction; // Offset: 1088 Size: 12 [unused]
// = 0x3f800000 0x00000000 0x00000000
// float2 g_LAO_Parameters; // Offset: 1104 Size: 8 [unused]
// = 0x00000000 0x00000000
// float4 terrainSizeInv; // Offset: 1120 Size: 16
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float2 playableSizeInv; // Offset: 1136 Size: 8
// = 0x3f800000 0x3f800000
// float2 chunkSize; // Offset: 1144 Size: 8
// = 0x3f800000 0x3f800000
// float2 terrainHeightRanges; // Offset: 1152 Size: 8 [unused]
// = 0x43160000 0x43160000
// float4x4 compositorViewProjection; // Offset: 1168 Size: 64
// float4 compositorViewRemap; // Offset: 1232 Size: 16
// = 0x3f000000 0x3f000000 0x3f000000 0x3f000000
// float4 dummySpace[2]; // Offset: 1248 Size: 32 [unused]
// float4 g_currentTime; // Offset: 1280 Size: 16 [unused]
// = 0x00000000 0x00000000 0x00000000 0x00000000
// float4 snowParameters; // Offset: 1296 Size: 16 [unused]
// = 0x00000000 0x3f800000 0x00000000 0x3f800000
// float4 snowEdgeFadeParameters; // Offset: 1312 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x41800000 0x40800000
// float4 snowDepthParameters; // Offset: 1328 Size: 16
// = 0x3ecccccd 0x3f800000 0x3f800000 0x3f800000
// float2 snowSparkleParameters; // Offset: 1344 Size: 8 [unused]
// = 0x3fe66666 0x00000000
// float4 g_clipping_parameters; // Offset: 1360 Size: 16 [unused]
// float4 exposure_control; // Offset: 1376 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x00000000
// float4 g_lighting_parameters; // Offset: 1392 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x00000000 0x00000000
// float4 g_desaturation; // Offset: 1408 Size: 16 [unused]
// = 0x00000000 0x00000000 0x00000000 0x00000000
// float4 g_soldier_light_desaturation;// Offset: 1424 Size: 16 [unused]
// = 0x00000000 0x00000000 0x00000000 0x00000000
// float4 g_vehicle_light_desaturation;// Offset: 1440 Size: 16 [unused]
// = 0x00000000 0x00000000 0x00000000 0x00000000
// float2 atmosphericSkyBlend; // Offset: 1456 Size: 8 [unused]
// = 0x3d21cac1 0xbd2a64c3
// float4 g_post_process_parameters; // Offset: 1472 Size: 16 [unused]
// = 0x3e3851ec 0x40a00000 0x41200000 0x3f666666
// float postprocess_sepia; // Offset: 1488 Size: 4 [unused]
// = 0x00000000
// float4 g_solder_light_colour; // Offset: 1504 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 g_solder_light_direction; // Offset: 1520 Size: 16 [unused]
// = 0x00000000 0xbf800000 0x00000000 0x00000000
// float4 g_vehicle_light_colour; // Offset: 1536 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 g_vehicle_light_direction; // Offset: 1552 Size: 16 [unused]
// = 0x00000000 0xbf800000 0x00000000 0x00000000
// float3 fxlight_sunDirection; // Offset: 1568 Size: 12 [unused]
// = 0x00000000 0x00000000 0x3f800000
// float3 fxlight_sunColour; // Offset: 1584 Size: 12 [unused]
// = 0x3f666666 0x3f800000 0x3f800000
// float3 fxlight_ambColour; // Offset: 1600 Size: 12 [unused]
// = 0x3f000000 0x3f0ccccd 0x3f19999a
// float2 fxlight_modifiers; // Offset: 1616 Size: 8 [unused]
// = 0x3f800000 0x3dcccccd
// float2 fx_texelSizes; // Offset: 1624 Size: 8 [unused]
// = 0x3a000000 0x3f7fe000
// float4 WaterTint; // Offset: 1632 Size: 16 [unused]
// float2 WaterAspectRatio; // Offset: 1648 Size: 8 [unused]
// = 0x3f800000 0x3f800000
// float2 WaterColourWindScale; // Offset: 1656 Size: 8 [unused]
// float4 WaterReflection_SurfaceOffset;// Offset: 1664 Size: 16 [unused]
// float2 WaterReflection_WindDirection;// Offset: 1680 Size: 8 [unused]
// float WaterReflection_SurfaceBumpiness;// Offset: 1688 Size: 4 [unused]
// float4 WaterReflection_ScreenScaleOffset;// Offset: 1696 Size: 16 [unused]
// float4 IceHealthThresholds; // Offset: 1712 Size: 16 [unused]
// = 0x3ea8f5c3 0x3f28f5c3 0x3f800000 0x3f800000
// float4 IceSlushColour_Tiling; // Offset: 1728 Size: 16 [unused]
// float4 IceStressedColour_Tiling; // Offset: 1744 Size: 16 [unused]
// float4 IceSolidColour_Tiling; // Offset: 1760 Size: 16 [unused]
// float2 IceSectorTiling_InvWidth; // Offset: 1776 Size: 8 [unused]
// float2 IceSlushReveal; // Offset: 1784 Size: 8 [unused]
// float4x4 ViewOverride[6]; // Offset: 1792 Size: 384 [unused]
// float4x4 ProjectionOverride[6]; // Offset: 2176 Size: 384 [unused]
// float4 FOWTextureWorldScaleOffset; // Offset: 2560 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x00000000 0x00000000
// float4 fow_visited; // Offset: 2576 Size: 16 [unused]
// float4 fow_hidden; // Offset: 2592 Size: 16 [unused]
// float4 fow_blend; // Offset: 2608 Size: 16 [unused]
// float4 g_topDownRange; // Offset: 2624 Size: 16 [unused]
// float4x4 topDownVPMatrix; // Offset: 2640 Size: 64 [unused]
// float4 g_topDownTexureSize; // Offset: 2704 Size: 16 [unused]
// = 0x00000000 0x00000000 0x3f800000 0x3f800000
// float4 muckParameters; // Offset: 2720 Size: 16
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 g_windVectorAndTime; // Offset: 2736 Size: 16 [unused]
// float4 g_trackMapSize; // Offset: 2752 Size: 16
// float g_snowIsMud; // Offset: 2768 Size: 4
// = 0x00000000
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// compositorDiffuseSampler sampler NA NA 0 1
// compositorSpecularSampler sampler NA NA 1 1
// MuckDiffuseSampler sampler NA NA 2 1
// MuckNormalSampler sampler NA NA 3 1
// MuckSpecGlossSampler sampler NA NA 4 1
// TrackSampler sampler NA NA 5 1
// muckDiffuseTexture texture float4 2d 60 1
// muckNormalTexture texture float4 2d 61 1
// muckSpecGlossTexture texture float4 2d 62 1
// TerrainTrackTexture texture float4 2d 65 1
// compositorDiffuseTexture texture float4 2d 72 1
// compositorSpecularTexture texture float4 2d 73 1
// GlobalBuffer cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float z
// TEXCOORD 0 xy 1 NONE float
// TEXCOORD 3 z 1 NONE float z
// TEXCOORD 4 w 1 NONE float
// TEXCOORD 1 xyz 2 NONE float xyz
// TEXCOORD 2 xyz 3 NONE float x z
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
// SV_Target 1 xyzw 1 TARGET float xyzw
// SV_Target 2 xyzw 2 TARGET float xyzw
//
ps_4_0
dcl_constantbuffer cb0[174], immediateIndexed
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_resource_texture2d (float,float,float,float) t60
dcl_resource_texture2d (float,float,float,float) t61
dcl_resource_texture2d (float,float,float,float) t62
dcl_resource_texture2d (float,float,float,float) t65
dcl_resource_texture2d (float,float,float,float) t72
dcl_resource_texture2d (float,float,float,float) t73
dcl_input_ps_siv linear noperspective v0.z, position
dcl_input_ps linear v1.z
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_temps 10
mov r0.xy, v3.xzxx
mov r0.z, l(1.000000)
dp3 r1.x, r0.xyzx, cb0[73].xzwx
dp3 r1.y, r0.xyzx, cb0[74].xzwx
dp3 r0.x, r0.xyzx, cb0[76].xzwx
div r0.xy, r1.xyxx, r0.xxxx
mad r0.xy, r0.xyxx, cb0[77].xyxx, cb0[77].zwzz
sample_l r1.xyzw, r0.xyxx, t72.xyzw, s0, l(0.000000)
sample_l r0.xyzw, r0.xyxx, t73.xyzw, s1, l(0.000000)
mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.w, r0.xyxx, r0.xyxx
add r0.w, -r0.w, l(1.000000)
sqrt r0.w, r0.w
mul r2.xyz, v2.yxzy, l(1.000000, -1.000000, 1.000000, 0.000000)
mul r3.xyz, r0.xxxx, r2.xyzx
mad r3.xyz, r0.wwww, v2.xyzx, r3.xyzx
mul r4.xyz, v2.xzyx, l(1.000000, -1.000000, 1.000000, 0.000000)
mad r0.xyw, r0.yyyy, r4.xyxz, r3.xyxz
dp3 r1.w, r0.xywx, r0.xywx
rsq r1.w, r1.w
mul r0.xyw, r0.xyxw, r1.wwww
mul r1.w, r0.z, r0.z
sqrt r2.w, r0.z
min r2.w, r2.w, l(1.000000)
lt r3.x, l(0.500000), cb0[83].z
if_nz r3.x
mul r3.y, v3.z, cb0[71].y
mad r3.zw, v3.xxxx, cb0[71].xxxx, l(0.000000, 0.000000, 0.500000, 0.500000)
mov r5.x, cb0[172].z
mov r5.yw, l(0,0.500000,0,0.500000)
add r3.xz, r3.zzyz, r5.xxyx
sample_l r6.xyzw, r3.xzxx, t65.xyzw, s5, l(0.000000)
mov r5.z, -cb0[172].z
add r3.xy, r3.wyww, r5.zwzz
sample_l r3.xyzw, r3.xyxx, t65.xyzw, s5, l(0.000000)
mad r3.yz, v3.xxzx, cb0[71].xxyx, l(0.000000, 0.000000, 0.500000, 0.000000)
mov r5.xz, l(0.500000,0,0.500000,0)
mov r5.y, cb0[172].w
add r5.xy, r3.yzyy, r5.xyxx
sample_l r7.xyzw, r5.xyxx, t65.xyzw, s5, l(0.000000)
mov r5.w, -cb0[172].w
add r3.yz, r3.yyzy, r5.zzwz
sample_l r5.xyzw, r3.yzyy, t65.yzwx, s5, l(0.000000)
mov_sat r5.x, r6.x
mov_sat r5.y, r3.x
mov_sat r5.z, r7.x
mov_sat r5.w, r5.w
dp4 r3.x, r5.xyzw, l(0.250000, 0.250000, 0.250000, 0.250000)
lt r3.y, v1.z, l(0.100000)
lt r3.z, l(0.500000), cb0[173].x
or r3.y, r3.z, r3.y
mul r3.w, r3.x, v1.z
mul_sat r3.w, r3.w, l(10.000000)
add r4.w, v1.z, l(-0.100000)
mad_sat r4.w, -r4.w, l(2.857143), l(1.000000)
mul r4.w, r3.x, r4.w
movc r3.y, r3.y, r3.w, r4.w
lt r6.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[170].xyzx
if_nz r6.x
mad r6.xw, v3.xxxz, cb0[70].xxxy, l(0.500000, 0.000000, 0.000000, 0.500000)
mul r6.xw, r6.xxxw, cb0[71].zzzw
sincos r7.x, r8.x, cb0[170].w
mov r9.x, -r7.x
mov r9.y, r8.x
dp2 r8.x, r9.yxyy, r6.xwxx
mov r9.z, r7.x
dp2 r8.y, r9.zyzz, r6.xwxx
movc r6.xw, r3.zzzz, r8.xxxy, r6.xxxw
mul r6.xw, r6.xxxw, cb0[170].xxxx
sample r7.xyzw, r6.xwxx, t60.xyzw, s2
mul r8.xyz, r1.xyzx, r7.xyzx
add r9.xyz, -r1.xyzx, r7.xyzx
mad r9.xyz, r7.wwww, r9.xyzx, r1.xyzx
mad r7.xyz, -r1.xyzx, r7.xyzx, r9.xyzx
mad r7.xyz, cb0[173].xxxx, r7.xyzx, r8.xyzx
mul r3.w, r3.y, r7.w
add r7.xyz, -r1.xyzx, r7.xyzx
mad r1.xyz, r3.wwww, r7.xyzx, r1.xyzx
endif
mul r7.xyz, r3.yyyy, r1.xyzx
mad o1.xyz, r7.xyzx, l(-0.149999976, -0.149999976, -0.149999976, 0.000000), r1.xyzx
if_nz r6.y
mad r3.yw, v3.xxxz, cb0[70].xxxy, l(0.000000, 0.500000, 0.000000, 0.500000)
mul r3.yw, r3.yyyw, cb0[71].zzzw
sincos r6.x, r7.x, cb0[170].w
mov r8.x, -r6.x
mov r8.y, r7.x
dp2 r7.x, r8.yxyy, r3.ywyy
mov r8.z, r6.x
dp2 r7.y, r8.zyzz, r3.ywyy
movc r3.yw, r3.zzzz, r7.xxxy, r3.yyyw
mul r3.yw, r3.yyyw, cb0[170].yyyy
sample r7.xyzw, r3.ywyy, t61.xyzw, s3
mad r7.xy, r7.wyww, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r3.y, r7.xyxx, r7.xyxx
add r3.y, -r3.y, l(1.000000)
sqrt r7.z, |r3.y|
dp3 r3.y, r7.xyzx, r7.xyzx
rsq r3.y, r3.y
mul r6.xyw, r3.yyyy, r7.xyxz
mul r2.xyz, r2.xyzx, r6.xxxx
mad r2.xyz, r6.wwww, v2.xyzx, r2.xyzx
mad r2.xyz, r6.yyyy, r4.xyzx, r2.xyzx
dp3 r3.y, r2.xyzx, r2.xyzx
rsq r3.y, r3.y
mad r2.xyz, r2.xyzx, r3.yyyy, -r0.xywx
mad r2.xyz, r3.xxxx, r2.xyzx, r0.xywx
dp3 r3.y, r2.xyzx, r2.xyzx
rsq r3.y, r3.y
mul r0.xyw, r2.xyxz, r3.yyyy
endif
lt r2.x, cb0[173].x, l(0.500000)
add r4.xy, -r5.zwzz, r5.xyxx
mad r4.z, -r4.x, r4.y, l(1.000000)
mov r4.w, -r4.y
dp3 r2.y, r4.xzwx, r4.xzwx
rsq r2.y, r2.y
mul r2.z, r3.x, l(5.000000)
min r2.z, r2.z, l(0.800000)
mul_sat r3.y, v1.z, l(5.000000)
min r2.z, r2.z, r3.y
mad r4.xyz, r4.xzwx, r2.yyyy, -r0.xywx
mad r4.xyz, r2.zzzz, r4.xyzx, r0.xywx
dp3 r2.y, r4.xyzx, r4.xyzx
rsq r2.y, r2.y
mul r4.xyz, r2.yyyy, r4.xyzx
movc r0.xyw, r2.xxxx, r4.xyxz, r0.xyxw
if_nz r6.z
mad r2.xy, v3.xzxx, cb0[70].xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mul r2.xy, r2.xyxx, cb0[71].zwzz
sincos r4.x, r5.x, cb0[170].w
mov r6.x, -r4.x
mov r6.y, r5.x
dp2 r5.x, r6.yxyy, r2.xyxx
mov r6.z, r4.x
dp2 r5.y, r6.zyzz, r2.xyxx
movc r2.xy, r3.zzzz, r5.xyxx, r2.xyxx
mul r2.xy, r2.xyxx, cb0[170].zzzz
sample r4.xyzw, r2.xyxx, t62.xyzw, s4
ge r2.x, cb0[173].x, l(0.500000)
and r2.x, r2.x, l(0x3f800000)
mad r2.y, r4.y, r4.y, -r4.x
mad r2.y, r2.x, r2.y, r4.x
mad r0.z, -r0.z, r0.z, r2.y
mad r1.w, r3.x, r0.z, r1.w
sqrt r0.z, r4.y
min r0.z, r0.z, l(1.000000)
add r0.z, -r4.y, r0.z
mad r0.z, r2.x, r0.z, r4.y
add r0.z, -r2.w, r0.z
mad r2.w, r3.x, r0.z, r2.w
endif
else
mov o1.xyz, r1.xyzx
endif
mov_sat r2.w, r2.w
mul o1.w, r2.w, l(0.498039246)
ge r1.xyz, r0.xywx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r1.xyz, r1.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
dp3 r0.y, r1.xyzx, l(2.000000, 4.000000, 8.000000, 0.000000)
mov o0.xy, |r0.xwxx|
mul o0.z, r0.y, l(0.00392156886)
mul r0.x, r1.w, l(12.920000)
log r0.y, |r1.w|
mul r0.y, r0.y, l(0.416666657)
exp r0.y, r0.y
mad r0.y, r0.y, l(1.055000), l(-0.055000)
lt r0.z, r1.w, l(0.00313080009)
movc_sat r0.x, r0.z, r0.x, r0.y
mul o0.w, r0.x, l(0.498039246)
mov o2.xyzw, v0.zzzz
ret
// Approximately 172 instruction slots used

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


here is the code in question I guess I could not have chosen a worse start lol

Hi - I looked at this and the VS you posted and this looks like a common pattern. I have not tried it, so I might be wrong, but what is going on is the VS is sending out the World coord in o3, then it's being used in the PS in the variable v3, in particular it is being multiplied by one of the shadow matrices cb0[73-75]. This will be wrong. So the variable v3 needs correcting. I put some code below in the PS, but to be honest its probably better to fix it in the VS as the same VS will probably feed several PS.
Let me know if this does anything. Oh, yeah, and there are some errors in the HLSL, the header information is chopped off.
//PS
cbuffer GlobalBuffer : register(b0)
{
float4x4 View : packoffset(c0);
float4x4 Projection : packoffset(c4);
float4x4 InvViewProj : packoffset(c8);
float3 EyePosition : packoffset(c12) = float3(0,0,0);
float3 DirLight0_Dir : packoffset(c13) = float3(-0.577000022,-0.577000022,0.577000022);
float4 DirLight0_Diffuse : packoffset(c14) = float4(1,1,1,1);
float4 PointLightActive : packoffset(c15) = float4(0,0,0,0);
float4 PointLight0_Position_AttenStart : packoffset(c16) = float4(0,0,0,10000);
float4 PointLight0_Diffuse_AttenInvRange : packoffset(c17) = float4(1,1,1,1);
float4 PointLight1_Position_AttenStart : packoffset(c18) = float4(0,0,0,10000);
float4 PointLight1_Diffuse_AttenInvRange : packoffset(c19) = float4(1,1,1,1);
float4 PointLight2_Position_AttenStart : packoffset(c20) = float4(0,0,0,10000);
float4 PointLight2_Diffuse_AttenInvRange : packoffset(c21) = float4(1,1,1,1);
float4 PointLight3_Position_AttenStart : packoffset(c22) = float4(0,0,0,10000);
float4 PointLight3_Diffuse_AttenInvRange : packoffset(c23) = float4(1,1,1,1);
float4 SHLight[7] : packoffset(c24) = float4(0,0,0,0);

//** ERROR HERE AS THE BUFFER DEFINITION IS CUT OFF

SamplerState compositorDiffuseSampler_s : register(s0);
SamplerState compositorSpecularSampler_s : register(s1);
SamplerState MuckDiffuseSampler_s : register(s2);
SamplerState MuckNormalSampler_s : register(s3);
SamplerState MuckSpecGlossSampler_s : register(s4);
SamplerState TrackSampler_s : register(s5);
Texture2D<float4> muckDiffuseTexture : register(t60);
Texture2D<float4> muckNormalTexture : register(t61);
Texture2D<float4> muckSpecGlossTexture : register(t62);
Texture2D<float4> TerrainTrackTexture : register(t65);
Texture2D<float4> compositorDiffuseTexture : register(t72);
Texture2D<float4> compositorSpecularTexture : register(t73);

Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main(
float4 v0 : SV_Position0,
float2 v1 : TEXCOORD0,
float w1 : TEXCOORD3,
float w1 : TEXCOORD4,
float4 v2 : TEXCOORD1,
float3 v3 : TEXCOORD2,
out float4 o0 : SV_Target0,
out float4 o1 : SV_Target1,
out float4 o2 : SV_Target2)
{
float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9;
uint4 bitmask, uiDest;
float4 fDest;

r0.xy = v3.xz; //From the VS, v3 is the WORLD COORD. But this shader is in stereo space, so the World Coord will be wrong. So we need to fix it.
r0.z = 1;

//Try this:
float4 r20, r21;
r20.xyz = v3.xyz;
r20.w = 1;
r21.x = dot(r20.xyzw, View._m00_m10_m20_m30);
r21.y = dot(r20.xyzw, View._m01_m11_m21_m31);
r21.z = dot(r20.xyzw, View._m02_m12_m22_m32);
r21.w = dot(r20.xyzw, View._m03_m13_m23_m33);
r20.x = dot(r21.xyzw, Projection._m00_m10_m20_m30);
r20.y = dot(r21.xyzw, Projection._m01_m11_m21_m31);
r20.z = dot(r21.xyzw, Projection._m02_m12_m22_m32);
r20.w = dot(r21.xyzw, Projection._m03_m13_m23_m33);

float4 stereo = StereoParams.Load(0);
r20.x -= stereo.x*(r20.w - stereo.y); // Note this may need to be "+=", try that as well

r21.x = dot(r20.xyzw, InvViewProj._m00_m10_m20_m30);
r21.y = dot(r20.xyzw, InvViewProj._m01_m11_m21_m31);
r21.z = dot(r20.xyzw, InvViewProj._m02_m12_m22_m32);
r21.w = dot(r20.xyzw, InvViewProj._m03_m13_m23_m33);

r0.xy = r21.xy /r21.ww;
r0.z = 1;

//...continue with original code
r1.x = dot(r0.xyz, cb0[73].xzwx); //From the ASM section of the shader, cb0[73] is one of the Shadow Matrices
r1.y = dot(r0.xyz, cb0[74].xzwx);
r0.x = dot(r0.xyz, cb0[76].xzwx);
r0.xy = r1.xy / r0.xx;
r0.xy = r0.xy * cb0[77].xyxx + cb0[77].zwzz;
r1.xyzw = compositorDiffuseTexture.SampleLevel(compositorDiffuseSampler_s, r0.xy, 0).xyzw;
r0.xyzw = compositorSpecularTexture.SampleLevel(compositorSpecularSampler_s, r0.xy, 0).xyzw;
r0.xy = r0.xy * float2(2,2) + float2(-1,-1);
r0.w = dot(r0.xy, r0.xy);
r0.w = 1 + -r0.w;
r0.w = sqrt(r0.w);
r2.xyz = float3(1,-1,1) * v2.yxz;
r3.xyz = r2.xyz * r0.xxx;
r3.xyz = r0.www * v2.xyz + r3.xyz;
r4.xyz = float3(1,-1,1) * v2.xzy;
r0.xyw = r0.yyy * r4.xyz + r3.xyz;
r1.w = dot(r0.xyw, r0.xyw);
r1.w = rsqrt(r1.w);
r0.xyw = r1.www * r0.xyw;
r1.w = r0.z * r0.z;
r2.w = sqrt(r0.z);
r2.w = min(1, r2.w);
r3.x = 0.5 < cb0[83].z;
if (r3.x != 0) {
r3.y = cb0[71].y * v3.z;
r3.zw = v3.xx * cb0[71].xxxx + float2(0.5,0.5);
r5.x = cb0[172].z;
r5.yw = float2(0.5,0.5);
r3.xz = r5.xy + r3.zy;
r6.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.xz, 0).xyzw;
r5.z = cb0[172].z;
r3.xy = r5.zw + r3.wy;
r3.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.xy, 0).xyzw;
r3.yz = v3.xz * cb0[71].xxyx + float2(0,0.5);
r5.xz = float2(0.5,0.5);
r5.y = cb0[172].w;
r5.xy = r5.xy + r3.yz;
r7.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r5.xy, 0).xyzw;
r5.w = cb0[172].w;
r3.yz = r5.zw + r3.yz;
r5.xyzw = TerrainTrackTexture.SampleLevel(TrackSampler_s, r3.yz, 0).yzwx;
r5.x = saturate(r6.x);
r5.y = saturate(r3.x);
r5.z = saturate(r7.x);
r5.w = saturate(r5.w);
r3.x = dot(r5.xyzw, float4(0.25,0.25,0.25,0.25));
r3.y = w1.x < 0.100000001;
r3.z = 0.5 < cb0[173].x;
r3.y = (int)r3.z | (int)r3.y;
r3.w = w1.x * r3.x;
r3.w = saturate(10 * r3.w);
r4.w = -0.100000001 + w1.x;
r4.w = saturate(-r4.w * 2.85714293 + 1);
r4.w = r4.w * r3.x;
r3.y = r3.y ? r3.w : r4.w;
r6.xyz = float3(0,0,0) < cb0[170].xyzx;
if (r6.x != 0) {
r6.xw = v3.xz * cb0[70].xxxy + float2(0.5,0.5);
r6.xw = cb0[71].zzzw * r6.xw;
sincos(cb0[170].w, r7.x, r8.x);
r9.x = -r7.x;
r9.y = r8.x;
r8.x = dot(r9.yx, r6.xw);
r9.z = r7.x;
r8.y = dot(r9.zy, r6.xw);
r6.xw = r3.zz ? r8.xy : r6.xw;
r6.xw = cb0[170].xxxx * r6.xw;
r7.xyzw = muckDiffuseTexture.Sample(MuckDiffuseSampler_s, r6.xw).xyzw;
r8.xyz = r7.xyz * r1.xyz;
r9.xyz = r7.xyz + -r1.xyz;
r9.xyz = r7.www * r9.xyz + r1.xyz;
r7.xyz = -r1.xyz * r7.xyz + r9.xyz;
r7.xyz = cb0[173].xxxx * r7.xyz + r8.xyz;
r3.w = r7.w * r3.y;
r7.xyz = r7.xyz + -r1.xyz;
r1.xyz = r3.www * r7.xyz + r1.xyz;
}
r7.xyz = r1.xyz * r3.yyy;
o1.xyz = r7.xyz * float3(-0.149999976,-0.149999976,-0.149999976) + r1.xyz;
if (r6.y != 0) {
r3.yw = v3.xz * cb0[70].xxxy + float2(0.5,0.5);
r3.yw = cb0[71].zzzw * r3.yw;
sincos(cb0[170].w, r6.x, r7.x);
r8.x = -r6.x;
r8.y = r7.x;
r7.x = dot(r8.yx, r3.yw);
r8.z = r6.x;
r7.y = dot(r8.zy, r3.yw);
r3.yw = r3.zz ? r7.xy : r3.yw;
r3.yw = cb0[170].yyyy * r3.yw;
r7.xyzw = muckNormalTexture.Sample(MuckNormalSampler_s, r3.yw).xyzw;
r7.xy = r7.wy * float2(2,2) + float2(-1,-1);
r3.y = dot(r7.xy, r7.xy);
r3.y = 1 + -r3.y;
r7.z = sqrt(abs(r3.y));
r3.y = dot(r7.xyz, r7.xyz);
r3.y = rsqrt(r3.y);
r6.xyw = r7.xyz * r3.yyy;
r2.xyz = r6.xxx * r2.xyz;
r2.xyz = r6.www * v2.xyz + r2.xyz;
r2.xyz = r6.yyy * r4.xyz + r2.xyz;
r3.y = dot(r2.xyz, r2.xyz);
r3.y = rsqrt(r3.y);
r2.xyz = r2.xyz * r3.yyy + -r0.xyw;
r2.xyz = r3.xxx * r2.xyz + r0.xyw;
r3.y = dot(r2.xyz, r2.xyz);
r3.y = rsqrt(r3.y);
r0.xyw = r3.yyy * r2.xyz;
}
r2.x = cb0[173].x < 0.5;
r4.xy = r5.xy + -r5.zw;
r4.z = -r4.x * r4.y + 1;
r4.w = -r4.y;
r2.y = dot(r4.xzw, r4.xzw);
r2.y = rsqrt(r2.y);
r2.z = 5 * r3.x;
r2.z = min(0.800000012, r2.z);
r3.y = saturate(5 * w1.x);
r2.z = min(r3.y, r2.z);
r4.xyz = r4.xzw * r2.yyy + -r0.xyw;
r4.xyz = r2.zzz * r4.xyz + r0.xyw;
r2.y = dot(r4.xyz, r4.xyz);
r2.y = rsqrt(r2.y);
r4.xyz = r4.xyz * r2.yyy;
r0.xyw = r2.xxx ? r4.xyz : r0.xyw;
if (r6.z != 0) {
r2.xy = v3.xz * cb0[70].xyxx + float2(0.5,0.5);
r2.xy = cb0[71].zwzz * r2.xy;
sincos(cb0[170].w, r4.x, r5.x);
r6.x = -r4.x;
r6.y = r5.x;
r5.x = dot(r6.yx, r2.xy);
r6.z = r4.x;
r5.y = dot(r6.zy, r2.xy);
r2.xy = r3.zz ? r5.xy : r2.xy;
r2.xy = cb0[170].zzzz * r2.xy;
r4.xyzw = muckSpecGlossTexture.Sample(MuckSpecGlossSampler_s, r2.xy).xyzw;
r2.x = cb0[173].x >= 0.5;
r2.x = r2.x ? 1.000000 : 0;
r2.y = r4.y * r4.y + -r4.x;
r2.y = r2.x * r2.y + r4.x;
r0.z = -r0.z * r0.z + r2.y;
r1.w = r3.x * r0.z + r1.w;
r0.z = sqrt(r4.y);
r0.z = min(1, r0.z);
r0.z = r0.z + -r4.y;
r0.z = r2.x * r0.z + r4.y;
r0.z = r0.z + -r2.w;
r2.w = r3.x * r0.z + r2.w;
}
} else {
o1.xyz = r1.xyz;
}
r2.w = saturate(r2.w);
o1.w = 0.498039246 * r2.w;
r1.xyz = r0.xyw >= float3(0,0,0);
r1.xyz = r1.xyz ? 1.000000 : 0;
r0.y = dot(r1.xyz, float3(2,4,8));
o0.xy = abs(r0.xw);
o0.z = 0.00392156886 * r0.y;
r0.x = 12.9200001 * r1.w;
r0.y = log2(abs(r1.w));
r0.y = 0.416666657 * r0.y;
r0.y = exp2(r0.y);
r0.y = r0.y * 1.05499995 + -0.0549999997;
r0.z = r1.w < 0.00313080009;
r0.x = saturate(r0.z ? r0.x : r0.y);
o0.w = 0.498039246 * r0.x;
o2.xyzw = v0.zzzz;
return;
}

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

#56
Posted 11/16/2015 08:27 PM   
Yes, at the moment, the Decompiler is choking on that big array initializer. So, the remaining parts are lost. Only way to fix this shader at the moment is to use the Assembler. Should be possible to use Mike's suggestion, but insert that as Assembly code instead.
Yes, at the moment, the Decompiler is choking on that big array initializer. So, the remaining parts are lost. Only way to fix this shader at the moment is to use the Assembler.

Should be possible to use Mike's suggestion, but insert that as Assembly code instead.

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

#57
Posted 11/17/2015 08:27 AM   
I feel a bit stupid but I have no idea what do you mean by 'but insert that as Assembly code instead'. I still havent gone trough all of your lessons so im most likely missing some information to be able to process that properly. I did put that code in the PS for the ground and I dont seem to be having any errors when loading that shader (d3d11_log.txt seem to be free of errors). Unfortunately the ground is still rendered as it was. I've tried [code]r20.x += stereo.x*(r20.w - stereo.y);[/code] but with error [code]F:\SteamLibrary\steamapps\common\Company of Heroes 2\wrapper1349(19,14-59): error X3017: cannot implicitly convert from 'const float4' to 'const float4[7]'[/code] Than when I try to change it back to -= and reload the shaders it gives me the same error. At one point I had the nvapi_log.txt containing [code]Tue Nov 17 16:28:34 2015 - Stereo_CreateHandleFromIUnknown called with device = 066447A8. Result = 0 Tue Nov 17 16:28:35 2015 - Stereo_CreateHandleFromIUnknown called with device = 1CFFF820. Result = 0 Tue Nov 17 16:29:42 2015 - GetSeparation value=8.000000e+001, hex=42a00000 Tue Nov 17 16:29:42 2015 - GetConvergence value=3.823647e+001, hex=4218f224[/code] but after im starting to get the errors in d3d11_log the nvapi log is 0bytes. Sorting files by date modified shows that shaderusage.txt is being modified but thats probably irrelevant.
I feel a bit stupid but I have no idea what do you mean by 'but insert that as Assembly code instead'. I still havent gone trough all of your lessons so im most likely missing some information to be able to process that properly.

I did put that code in the PS for the ground and I dont seem to be having any errors when loading that shader (d3d11_log.txt seem to be free of errors). Unfortunately the ground is still rendered as it was.

I've tried
r20.x += stereo.x*(r20.w - stereo.y);


but with error
F:\SteamLibrary\steamapps\common\Company of Heroes 2\wrapper1349(19,14-59): error X3017: cannot implicitly convert from 'const float4' to 'const float4[7]'


Than when I try to change it back to -= and reload the shaders it gives me the same error.


At one point I had the nvapi_log.txt containing
Tue Nov 17 16:28:34 2015
- Stereo_CreateHandleFromIUnknown called with device = 066447A8. Result = 0
Tue Nov 17 16:28:35 2015
- Stereo_CreateHandleFromIUnknown called with device = 1CFFF820. Result = 0
Tue Nov 17 16:29:42 2015
- GetSeparation value=8.000000e+001, hex=42a00000
Tue Nov 17 16:29:42 2015
- GetConvergence value=3.823647e+001, hex=4218f224

but after im starting to get the errors in d3d11_log the nvapi log is 0bytes. Sorting files by date modified shows that shaderusage.txt is being modified but thats probably irrelevant.

Acer H5360 / BenQ XL2420T + 3D Vision 2 Kit - EVGA GTX 980TI 6GB - i7-3930K@4.0GHz - DX79SI- 16GB RAM@2133 - Win10x64 Home - HTC VIVE

#58
Posted 11/17/2015 03:55 PM   
[quote="tehace"]I feel a bit stupid but I have no idea what do you mean by 'but insert that as Assembly code instead'. I still havent gone trough all of your lessons so im most likely missing some information to be able to process that properly. [/quote] Hi - no you are not being stupid, this just means that this game is more complicated to fix... The HLSL files you have been looking at are not being generated correctly, and so cannot be used to fix the problems. There is a separate set of files that can get created in assembly language (this is the same as helixmod uses) and this *can* be fixed. I will look at this for you and create a fix for the same shader that you provided in HLSL earlier. At this point, it's come full circle to what I said originally - 3DMigoto has too many errors to fix the game effectively. HOWEVER, since I last looked at it, 3Dmigoto now has Flugan's assembly compiler, so that is now an option.
tehace said:I feel a bit stupid but I have no idea what do you mean by 'but insert that as Assembly code instead'. I still havent gone trough all of your lessons so im most likely missing some information to be able to process that properly.

Hi - no you are not being stupid, this just means that this game is more complicated to fix... The HLSL files you have been looking at are not being generated correctly, and so cannot be used to fix the problems. There is a separate set of files that can get created in assembly language (this is the same as helixmod uses) and this *can* be fixed. I will look at this for you and create a fix for the same shader that you provided in HLSL earlier.
At this point, it's come full circle to what I said originally - 3DMigoto has too many errors to fix the game effectively. HOWEVER, since I last looked at it, 3Dmigoto now has Flugan's assembly compiler, so that is now an option.

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

#59
Posted 11/17/2015 05:43 PM   
Ok its been a while so from what I understand I would have to wait for bo3b to fix somehting within 3dmigoto so it properly dump that ground shader. I dont really get how the other "assembly option" would work... on a side note I have just recently picked up DA:I and Im really blown away on how good the game looks with the 3dfix provided by this community :) I really have no idea how could I go back to gaming on 'flat' screen
Ok its been a while so from what I understand I would have to wait for bo3b to fix somehting within 3dmigoto so it properly dump that ground shader. I dont really get how the other "assembly option" would work...

on a side note I have just recently picked up DA:I and Im really blown away on how good the game looks with the 3dfix provided by this community :) I really have no idea how could I go back to gaming on 'flat' screen

Acer H5360 / BenQ XL2420T + 3D Vision 2 Kit - EVGA GTX 980TI 6GB - i7-3930K@4.0GHz - DX79SI- 16GB RAM@2133 - Win10x64 Home - HTC VIVE

#60
Posted 11/28/2015 03:27 PM   
  4 / 5    
Scroll To Top