ThirteenAG / WidescreenFixesPack

Plugins to make or improve widescreen resolutions support in games, add more features and fix bugs.
https://thirteenag.github.io/wfp
MIT License
2.33k stars 222 forks source link

[SCCT] Shadows become more broken the wider the screen resolution #725

Closed Ghaleon4 closed 2 years ago

Ghaleon4 commented 5 years ago

Hello!! To start with, I would like to say thank you for these patches. As a long-time gamer, I constantly marvel at the volume of game fixes, hacks, updates, and mods that we all get to enjoy thanks to developers like you.

I've noticed a problem with in-game shadows that I have not seen anyone else mention.

This one illustrates a kind of stretching and separation between each shadow sample (?): brokenshadows1

Hard to illustrates, but when I pan the camera left/right in these scenes, the whole shadow seems to "shimmer".

brokenshadows2

These problems manifest while playing the game at a triple-monitor resolution with NVSurround: 5860x1080 (includes bezel compensation)

The problem, so far, seems absent while playing at a more conventional 16:9.

The problem is made worse by enabling SM 3.0 with Soft Shadows, but these screenshots were taken with SM 1.1 on a GeForce GTX 970.

ThirteenAG commented 5 years ago

Yeah, I don't really patch anything related to rendering, so that's how the game does it. Probably not an easy fix.

Ghaleon4 commented 5 years ago

Hello!! Indeed, I was pretty sure that this problem wasn't being introduced by your fixes, and was hoping to just put it on your radar. Thank you for looking, Thirteen!

Ghaleon4 commented 5 years ago

Bah, I couldn't find a place to message you directly:

I have been itching to learn some of the skills necessary to start building my own game fixes, and/or to fix existing ones for which the source code is available. I know how invaluable things like ProcessMonitor and CheatEngine are for identifying and exploiting hookable .dlls, or for changing data in running memory addresses -but it's still overwhelming. I can't code yet. Perhaps I just need to pick a specific project to start with, but I don't have the skills to identify something that would be easy enough for me to cut my teeth on. Like, I don't want to pick a game/fix, learn the minimum to begin writing and playing with scripts or code, and then find out that the whole enterprise was unrealistic. Like, "If only I had known 2 weeks ago that this wouldn't work!" sort of thing.

I've rambled a bit. Perhaps just keep me in mind if you come across a mundane task or exercise that is beneath you, but that could be used as a training exercise for a guy like me. Thank you!!!

killer-m commented 5 years ago

Shadow map size (2048→8192) 68 00 08 00 00 68 00 08 00 00 → 68 00 20 00 00 68 00 20 00 00

Some constants that related to shadows rendering 89 8C 24 E0 00 00 00 B9 00 01 00 00 → 89 8C 24 E0 00 00 00 B9 00 00 01 00 BB 9A 99 99 3F → BB 00 00 80 3E C7 86 C8 07 00 00 9A 99 99 BE → C7 86 C8 07 00 00 9A 99 19 BE

Before -https://funkyimg.com/i/2WTUV.jpg After - https://funkyimg.com/i/2WTUW.jpg

Ghaleon4 commented 5 years ago

Oh. My. God. Killer-m, that is so cool!!!!! Hxd, here I come. I'll be back in a minute.

Ghaleon4 commented 5 years ago

It worked! Now I just need to understand how you discovered those values? I mean, these values were in the executable, so it's not like you could change a setting in the game to see what the difference was? I feel like the best way to show my gratitude is to learn how you did it.

d4rkne55 commented 5 years ago

@ghaleon4 Same here. I am already a developer, but not this kind and I don't have knowledge of C++ (yet, do understand the code for the most part though). Want to learn and gain some experience with C++ in the future though and also would like to get into that process for this kind of stuff. Mostly it's playing around for this, like changing a shadow setting and looking what changes in memory may be relevant, I guess, but also dunno how some stuff like this gets discovered (no shadow setting ingame).^^

killer-m commented 5 years ago

You need a debugger (Cheat Engine, IDA, x64dbg, ollydbg etc...) to find stuff like this. Shadow maps are usually have sizes from 128 to 4096. To increase them you need to find push or mov commands. Something like this: push 400 mov eax, 400 mov eax, [pointer to shadow map value] etc.. Keep in mind that 8192x8192 is usually the maximum texture size in DirectX 9. sctct

Changing 89 8C 24 E0 00 00 00 B9 00 01 00 00 → 89 8C 24 E0 00 00 00 B9 00 00 01 00 (MOV ECX,100 → MOV ECX,10000) seems to break the function that adjusts contrast and shadow filtering according to the angle of the camera. This only works if the "Soft shadows" option is disabled. sctct1

For "Soft shadows" option enabled, other changes BB 9A 99 99 3F → BB 00 00 80 3E (MOV EBX, 3F99999A → MOV EBX, 3E800000) C7 86 C8 07 00 00 9A 99 99 BE → C7 86 C8 07 00 00 9A 99 19 BE (MOV DWORD [ESI+7C8], BE99999A → MOV DWORD [ESI+7C8], BE19999A) will make the shadows less soft, but will fix them for a multi-monitor screen resolution. sctct2

Of course it's a "dirty" fix because the shadows look different from the original ones.

Ghaleon4 commented 5 years ago

Killer-M, I'm going to use your info to get into a Debugger tonight and see if I can follow your logic! Thank you!! BTW, I had so much fun replaying this game last night.

chrisdavis925 commented 4 years ago

@killer-m - I know it's been a while since you posted this - but is there any way you could do a walk through like this for Splinter Cell 4 (Double Agent) ? That game has notoriously bad shadow map resolution with no way to increase it with the in-game settings.

Any way you can help guide us on how to increase the shadow resolution for that game? :)

killer-m commented 4 years ago

@chrisdavis925 Open System\D3DDrv.dll in HEX-editor

Find and replace these bytes:

Default - https://funkyimg.com/i/33GJ6.png

2048x2048 - https://funkyimg.com/i/33GJ7.png

3072x3072 - https://funkyimg.com/i/33GJ8.png

4096x4096 - https://funkyimg.com/i/33GJ9.png

6144x6144 - https://funkyimg.com/i/33GJa.png

8192x8192 - https://funkyimg.com/i/33GJb.png

chrisdavis925 commented 4 years ago

I'm going to try this later today. This is great!

This game has soft shadows disabled. I know this might be a total stretch, but is there anything that you can think of that could be modified to enable this setting by editing the dll or exe files?

On Mon, Apr 6, 2020, 4:49 AM killer-m notifications@github.com wrote:

@chrisdavis925 https://github.com/chrisdavis925 Open System\D3DDrv.dll in HEX-editor

Find and replace these bytes: Default - https://funkyimg.com/i/33GJ6.png 2048x2048 - https://funkyimg.com/i/33GJ7.png

-

B8 00 04 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 04 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 02 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 02 00 00 C3 → B8 00 08 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 08 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 08 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 08 00 00 C3

B8 00 04 00 00 D3 F8 80 → B8 00 08 00 00 D3 F8 80

6A 00 B8 00 04 00 00 → 6A 00 B8 00 08 00 00

6A 02 B8 00 02 00 00 → 6A 02 B8 00 08 00 00

B8 00 02 00 00 D3 F8 8D 8E 60 5B 00 00 51 8B → B8 00 08 00 00 D3 F8 8D 8E 60 5B 00 00 51 8B

6A 01 B8 00 04 00 00 → 6A 01 B8 00 08 00 00

6A 00 6A 00 B8 00 02 00 00 → 6A 00 6A 00 B8 00 08 00 00

B8 00 02 00 00 D3 F8 8D 8E 60 5B 00 00 51 6A 00 → B8 00 08 00 00 D3 F8 8D 8E 60 5B 00 00 51 6A 00

B8 00 02 00 00 EB 11 8B 96 04 03 00 00 8A 8A 5E 5D 00 00 B8 00 04 00 00 → B8 00 08 00 00 EB 11 8B 96 04 03 00 00 8A 8A 5E 5D 00 00 B8 00 08 00 00

3072x3072 - https://funkyimg.com/i/33GJ8.png

-

B8 00 04 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 04 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 02 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 02 00 00 C3 → B8 00 0C 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 0C 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 0C 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 0C 00 00 C3

B8 00 04 00 00 D3 F8 80 → B8 00 0C 00 00 D3 F8 80

6A 00 B8 00 04 00 00 → 6A 00 B8 00 0C 00 00

6A 02 B8 00 02 00 00 → 6A 02 B8 00 0C 00 00

B8 00 02 00 00 D3 F8 8D 8E 60 5B 00 00 51 8B → B8 00 0C 00 00 D3 F8 8D 8E 60 5B 00 00 51 8B

6A 01 B8 00 04 00 00 → 6A 01 B8 00 0C 00 00

6A 00 6A 00 B8 00 02 00 00 → 6A 00 6A 00 B8 00 0C 00 00

B8 00 02 00 00 D3 F8 8D 8E 60 5B 00 00 51 6A 00 → B8 00 0C 00 00 D3 F8 8D 8E 60 5B 00 00 51 6A 00

B8 00 02 00 00 EB 11 8B 96 04 03 00 00 8A 8A 5E 5D 00 00 B8 00 04 00 00 → B8 00 0C 00 00 EB 11 8B 96 04 03 00 00 8A 8A 5E 5D 00 00 B8 00 0C 00 00

4096x4096 - https://funkyimg.com/i/33GJ9.png

-

B8 00 04 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 04 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 02 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 02 00 00 C3 → B8 00 10 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 10 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 10 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 10 00 00 C3

B8 00 04 00 00 D3 F8 80 → B8 00 10 00 00 D3 F8 80

6A 00 B8 00 04 00 00 → 6A 00 B8 00 10 00 00

6A 02 B8 00 02 00 00 → 6A 02 B8 00 10 00 00

B8 00 02 00 00 D3 F8 8D 8E 60 5B 00 00 51 8B → B8 00 10 00 00 D3 F8 8D 8E 60 5B 00 00 51 8B

6A 01 B8 00 04 00 00 → 6A 01 B8 00 10 00 00

6A 00 6A 00 B8 00 02 00 00 → 6A 00 6A 00 B8 00 10 00 00

B8 00 02 00 00 D3 F8 8D 8E 60 5B 00 00 51 6A 00 → B8 00 10 00 00 D3 F8 8D 8E 60 5B 00 00 51 6A 00

B8 00 02 00 00 EB 11 8B 96 04 03 00 00 8A 8A 5E 5D 00 00 B8 00 04 00 00 → B8 00 10 00 00 EB 11 8B 96 04 03 00 00 8A 8A 5E 5D 00 00 B8 00 10 00 00

6144x6144 - https://funkyimg.com/i/33GJa.png

-

B8 00 04 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 04 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 02 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 02 00 00 C3 → B8 00 18 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 18 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 18 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 18 00 00 C3

B8 00 04 00 00 D3 F8 80 → B8 00 18 00 00 D3 F8 80

6A 00 B8 00 04 00 00 → 6A 00 B8 00 18 00 00

6A 02 B8 00 02 00 00 → 6A 02 B8 00 18 00 00

B8 00 02 00 00 D3 F8 8D 8E 60 5B 00 00 51 8B → B8 00 18 00 00 D3 F8 8D 8E 60 5B 00 00 51 8B

6A 01 B8 00 04 00 00 → 6A 01 B8 00 18 00 00

6A 00 6A 00 B8 00 02 00 00 → 6A 00 6A 00 B8 00 18 00 00

B8 00 02 00 00 D3 F8 8D 8E 60 5B 00 00 51 6A 00 → B8 00 18 00 00 D3 F8 8D 8E 60 5B 00 00 51 6A 00

B8 00 02 00 00 EB 11 8B 96 04 03 00 00 8A 8A 5E 5D 00 00 B8 00 04 00 00 → B8 00 18 00 00 EB 11 8B 96 04 03 00 00 8A 8A 5E 5D 00 00 B8 00 18 00 00

8192x8192 - https://funkyimg.com/i/33GJb.png

-

B8 00 04 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 04 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 02 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 02 00 00 C3 → B8 00 20 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 20 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 20 00 00 C3 CC CC CC CC CC CC CC CC CC CC B8 00 20 00 00 C3

B8 00 04 00 00 D3 F8 80 → B8 00 20 00 00 D3 F8 80

6A 00 B8 00 04 00 00 → 6A 00 B8 00 02 00 00

6A 02 B8 00 02 00 00 → 6A 02 B8 00 20 00 00

B8 00 02 00 00 D3 F8 8D 8E 60 5B 00 00 51 8B → B8 00 20 00 00 D3 F8 8D 8E 60 5B 00 00 51 8B

6A 01 B8 00 04 00 00 → 6A 01 B8 00 20 00 00

6A 00 6A 00 B8 00 02 00 00 → 6A 00 6A 00 B8 00 20 00 00

B8 00 02 00 00 D3 F8 8D 8E 60 5B 00 00 51 6A 00 → B8 00 20 00 00 D3 F8 8D 8E 60 5B 00 00 51 6A 00

B8 00 02 00 00 EB 11 8B 96 04 03 00 00 8A 8A 5E 5D 00 00 B8 00 04 00 00 → B8 00 20 00 00 EB 11 8B 96 04 03 00 00 8A 8A 5E 5D 00 00 B8 00 20 00 00

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThirteenAG/WidescreenFixesPack/issues/725#issuecomment-609746081, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWHYIQYBTSK6OJKP5IG64LRLG6WDANCNFSM4IVAUJ5Q .

killer-m commented 4 years ago

@chrisdavis925 Soft shadows are not disabled. Depending on the scene, the game engine uses shadow maps or/and shadow volumes. Setting "HIGH QUALITY SOFT SHADOWS" in the game menu ("bUseSmoothShadow = True" in SplinterCell4.ini) only applies when the game uses shadow volumes as a shadow rendering technique.

Soft shadows OFF - https://funkyimg.com/i/33LSK.png Soft shadows ON - https://funkyimg.com/i/33LSL.png

chrisdavis925 commented 4 years ago

I think the actual shader for smooth shadow is missing. If you make some changes to the SplinterCell4.ini file you can make the game render what appears to be three shadow passes, but it's not actually "smooth". Here is a picture of what I mean: https://funkyimg.com/i/33LUR.png

The game looks way better with the increase in shadow map resolution. THANK YOU!!!!!

If you don't mind - one more question for you. The game is using some older form of bloom effect. The higher the resolution of the monitor the more obvious the low resolution sampling of the bloom effect is. It's hard to show the low sampling effect with just a picture since it's mostly obvious when the camera is moving. I am guessing that somewhere in the D3DrV the resolution of the bloom / emissive effect can be changed.

Do you have any possible idea or suggestions on how to increase he emissive resolution?

On Wed, Apr 8, 2020 at 11:03 AM killer-m notifications@github.com wrote:

@chrisdavis925 https://github.com/chrisdavis925 Soft shadows are not disabled. Depending on the scene, the game engine uses shadow maps or/and shadow volumes. Setting "HIGH QUALITY SOFT SHADOWS" in the game menu ("bUseSmoothShadow = True" in SplinterCell4.ini) only applies when the game uses shadow volumes as a shadow rendering technique.

Soft shadows OFF - https://funkyimg.com/i/33LSK.png Soft shadows ON - https://funkyimg.com/i/33LSL.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThirteenAG/WidescreenFixesPack/issues/725#issuecomment-611106404, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWHYIS73W2JCDHKJKXSMXDRLS37JANCNFSM4IVAUJ5Q .

chrisdavis925 commented 4 years ago

Here is an example of a high emissive / bloom area at 3440x1440. Again, looks really bad when the camera is moving, but here you can see the low resolution grid like effect even in the picture.

Original: https://funkyimg.com/i/33LYn.png Outlined in red: https://funkyimg.com/i/33LYm.png

On Wed, Apr 8, 2020 at 11:17 AM Chris Davis chris.davis925@gmail.com wrote:

I think the actual shader for smooth shadow is missing. If you make some changes to the SplinterCell4.ini file you can make the game render what appears to be three shadow passes, but it's not actually "smooth". Here is a picture of what I mean: https://funkyimg.com/i/33LUR.png

The game looks way better with the increase in shadow map resolution. THANK YOU!!!!!

If you don't mind - one more question for you. The game is using some older form of bloom effect. The higher the resolution of the monitor the more obvious the low resolution sampling of the bloom effect is. It's hard to show the low sampling effect with just a picture since it's mostly obvious when the camera is moving. I am guessing that somewhere in the D3DrV the resolution of the bloom / emissive effect can be changed.

Do you have any possible idea or suggestions on how to increase he emissive resolution?

On Wed, Apr 8, 2020 at 11:03 AM killer-m notifications@github.com wrote:

@chrisdavis925 https://github.com/chrisdavis925 Soft shadows are not disabled. Depending on the scene, the game engine uses shadow maps or/and shadow volumes. Setting "HIGH QUALITY SOFT SHADOWS" in the game menu ("bUseSmoothShadow = True" in SplinterCell4.ini) only applies when the game uses shadow volumes as a shadow rendering technique.

Soft shadows OFF - https://funkyimg.com/i/33LSK.png Soft shadows ON - https://funkyimg.com/i/33LSL.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThirteenAG/WidescreenFixesPack/issues/725#issuecomment-611106404, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWHYIS73W2JCDHKJKXSMXDRLS37JANCNFSM4IVAUJ5Q .

killer-m commented 4 years ago

What changes in SplinterCell4.ini are needed to get three shadows?

chrisdavis925 commented 4 years ago

UseHWShadowMapping=False ShadowResolutionDegree=0 UseSmoothShadow=False

That will get you three layer shadows. You would think that "UseSmoothShadow" would then give you the effect of SCCT soft shadows, but it doesn't. Also be careful about what type of shadow you are looking at. The Cozumel ship picture you sent me is using a global "sun" shadow derived from Unreal Engine 3 style shadows. The shadow from the first picture (First level) is a "SCX" shadow. SCX is the same (or very similar) tech to that of SCCT.

I am saying this because it's not clear to me if they tried to re-work the "SmoothShadow" code when they merged UE3 lighting / shadow stuff and just broke it. Or if they ripped out the SCX soft shadow stuff. Not sure.

On Wed, Apr 8, 2020 at 11:57 AM killer-m notifications@github.com wrote:

What changes in SplinterCell4.ini are needed to get three shadows?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThirteenAG/WidescreenFixesPack/issues/725#issuecomment-611132596, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWHYIRSUNBGMMFGTIVEMH3RLTCJFANCNFSM4IVAUJ5Q .

killer-m commented 4 years ago

3x3 PCF (Percentage-Closer Filtering) gives these three shadows - https://funkyimg.com/i/33T7o.png If you break the PCF shader, then the shadows will look less soft - https://funkyimg.com/i/33T7n.png When "UseHWShadowMapping=True", then the shadows get bilinear filtering - https://funkyimg.com/i/33T7p.png I think it's possible to improve PCF shader and add blurring to shadows edges. Unfortunately, I don't know anything about shader programming.

https://imgsli.com/MTQ0NTM To get high resolution for the glow effect open System\D3DDrv.dll in HEX-editor Find and replace these bytes:

chrisdavis925 commented 4 years ago

hmmm many of the values you list don't exist in my D3Drv.dll file. For example, I don't have these:

-

C7 44 24 68 40 00 00 00 E8 24 A5 00 00 → C7 44 E4 68 00 02 00 00 E8 24 A5 00 00

C7 84 24 8C 00 00 00 20 00 00 00 E8 B8 A4 00 00 → C7 84 E4 8C 00 00 00 00 01 00 00 E8 B8 A4 00 00

C7 84 24 B0 00 00 00 10 00 00 00 E8 3D A4 00 00 → C7 84 E4 B0 00 00 00 80 00 00 00 E8 3D A4 00 00

E8 83 D3 FE FF → E9 4D 1D 06 00

Any ideas what's going on? Can you send me your .dll?

On Sun, Apr 12, 2020 at 6:24 AM killer-m notifications@github.com wrote:

3x3 PCF (Percentage-Closer Filtering) gives these three shadows - https://funkyimg.com/i/33T7o.png If you break the PCF shader, then the shadows will look less soft - https://funkyimg.com/i/33T7n.png When "UseHWShadowMapping=True", then the shadows get bilinear filtering - https://funkyimg.com/i/33T7p.png I think it's possible to improve PCF shader and add blurring to shadows edges. Unfortunately, I don't know anything about shader programming.

https://imgsli.com/MTQ0NTM To get high resolution for the glow effect open System\D3DDrv.dll in HEX-editor Find and replace these bytes:

-

6A 15 68 00 01 00 00 68 00 01 00 00 → 6A 15 68 00 08 00 00 68 00 08 00 00

6A 15 68 80 00 00 00 68 80 00 00 00 → 6A 15 68 00 04 00 00 68 00 04 00 00

6A 15 6A 40 6A 40 → E9 1C 39 09 00 90

6A 15 6A 20 6A 20 → E9 ED 38 09 00 90

6A 15 6A 10 6A 10 → E9 BE 38 09 00 90

68 00 00 84 3F 68 00 00 00 3D 68 00 00 80 BF 8B 08 68 00 00 80 3F 68 00 00 82 3F 68 00 00 80 3C 68 00 00 80 BF 68 00 00 80 3F 68 00 00 81 3F 68 00 00 00 3C 68 00 00 80 BF 68 00 00 80 3F 68 00 80 80 3F 68 00 00 80 3B → 68 00 80 80 3F 68 00 00 80 3B 68 00 00 80 BF 8B 08 68 00 00 80 3F 68 00 40 80 3F 68 00 00 00 3B 68 00 00 80 BF 68 00 00 80 3F 68 00 20 80 3F 68 00 00 80 3A 68 00 00 80 BF 68 00 00 80 3F 68 00 10 80 3F 68 00 00 00 3A

8B 00 8B 16 68 00 01 00 00 68 00 01 00 00 → 8B 00 8B 16 68 00 08 00 00 68 00 08 00 00

8B 00 8B 16 68 80 00 00 00 68 80 00 00 00 → 8B 00 8B 16 68 00 04 00 00 68 00 04 00 00

8B 00 8B 16 6A 40 6A 40 51 → 8B 00 8B 16 E9 F7 30 07 00

8B 00 8B 16 6A 20 6A 20 51 → 8B 00 8B 16 E9 51 30 07 00

8B 00 8B 16 6A 10 6A 10 51 → 8B 00 8B 16 E9 B6 2F 07 00

8B 88 68 5A 00 00 C7 44 24 1C 00 01 00 00 → 8B 88 68 5A 00 00 C7 44 E4 1C 00 08 00 00

89 54 24 3C C7 44 24 40 80 00 00 00 → 89 54 24 3C C7 44 E4 40 00 04 00 00

C7 44 24 64 40 00 00 00 E8 31 A7 01 00 → C7 44 E4 64 00 02 00 00 E8 31 A7 01 00

C7 84 24 88 00 00 00 20 00 00 00 E8 C8 A6 01 00 → C7 84 E4 88 00 00 00 00 01 00 00 E8 C8 A6 01 00

C7 84 24 AC 00 00 00 10 00 00 00 E8 4D A6 01 00 → C7 84 E4 AC 00 00 00 80 00 00 00 E8 4D A6 01 00

E8 B1 D5 FF FF → E9 1F 1F 07 00

C7 44 24 20 00 01 00 00 E8 09 A6 00 00 → C7 44 E4 20 00 08 00 00 E8 09 A6 00 00

C7 44 24 44 80 00 00 00 E8 84 A5 00 00 → C7 44 E4 44 00 04 00 00 E8 84 A5 00 00

C7 44 24 68 40 00 00 00 E8 24 A5 00 00 → C7 44 E4 68 00 02 00 00 E8 24 A5 00 00

C7 84 24 8C 00 00 00 20 00 00 00 E8 B8 A4 00 00 → C7 84 E4 8C 00 00 00 00 01 00 00 E8 B8 A4 00 00

C7 84 24 B0 00 00 00 10 00 00 00 E8 3D A4 00 00 → C7 84 E4 B0 00 00 00 80 00 00 00 E8 3D A4 00 00

E8 83 D3 FE FF → E9 4D 1D 06 00

51 68 00 00 82 3F 68 00 00 80 3C 68 00 00 80 BF 68 00 00 80 3F 68 00 00 81 3F 68 00 00 00 3C 68 00 00 80 BF 68 00 00 80 3F 68 00 80 80 3F 68 00 00 80 3B → 51 68 00 40 80 3F 68 00 00 00 3B 68 00 00 80 BF 68 00 00 80 3F 68 00 20 80 3F 68 00 00 80 3A 68 00 00 80 BF 68 00 00 80 3F 68 00 10 80 3F 68 00 00 00 3A

10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 → 10 6A 15 68 00 02 00 00 68 00 02 00 00 E9 D4 C6 F6 FF 6A 15 68 00 01 00 00 68 00 01 00 00 E9 03 C7 F6 FF 6A 15 68 80 00 00 00 68 80 00 00 00 E9 32 C7 F6 FF C7 44 E4 6C 00 00 00 45 C7 44 E4 70 00 00 00 45 C7 84 E4 90 00 00 00 00 00 80 44 C7 84 E4 94 00 00 00 00 00 80 44 C7 84 E4 B4 00 00 00 00 00 00 44 C7 84 E4 B8 00 00 00 00 00 00 44 C7 84 E4 D8 00 00 00 00 00 80 43 C7 84 E4 DC 00 00 00 00 00 80 43 E8 3B B6 F8 FF E9 85 E0 F8 FF C7 44 E4 70 00 00 00 45 C7 44 E4 74 00 00 00 45 C7 84 E4 94 00 00 00 00 00 80 44 C7 84 E4 98 00 00 00 00 00 80 44 C7 84 E4 B8 00 00 00 00 00 00 44 C7 84 E4 BC 00 00 00 00 00 00 44 C7 84 E4 DC 00 00 00 00 00 80 43 C7 84 E4 E0 00 00 00 00 00 80 43 E8 DF B5 F8 FF E9 57 E2 F9 FF 68 00 02 00 00 68 00 02 00 00 51 E9 F9 CE F8 FF 68 00 01 00 00 68 00 01 00 00 51 E9 9F CF F8 FF 68 80 00 00 00 68 80 00 00 00 51 E9 3A D0 F8 FF

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThirteenAG/WidescreenFixesPack/issues/725#issuecomment-612613927, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWHYIT6J3774NTQEIMZJ5LRMG6IZANCNFSM4IVAUJ5Q .

killer-m commented 4 years ago

https://mega.nz/file/NQUASCIA#6nNgIHEUeVs_lm6yRctj1nHXJDAPKTW3hWi3Q_0RcR4

chrisdavis925 commented 4 years ago

What version of the game / patch are you using? This D3Drv crashes the game at launch.

On Sun, Apr 12, 2020 at 3:06 PM killer-m notifications@github.com wrote:

https://mega.nz/file/NQUASCIA#6nNgIHEUeVs_lm6yRctj1nHXJDAPKTW3hWi3Q_0RcR4

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThirteenAG/WidescreenFixesPack/issues/725#issuecomment-612683236, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWHYIT27BTBRVKNPCD4CSTRMI3O5ANCNFSM4IVAUJ5Q .

chrisdavis925 commented 4 years ago

@killer-m It seems the Steam version of the game doesn't install the 2.0a path. If I apply that patch, the D3Drv file you sent works ok.

I notice that while edges do appear much sharper, things don't see to "glow" or appear to not actually bloom around the edges as much. Do you know if any of the bytes you change relate to the glow / edge bloom radius?

Also for some reason my game now renders what appears to be the bloom render pass in a small box in the top left corner of the screen. Not sure what's up with that.

Here is a picture of that and of the how the bloom triangle looks now: https://funkyimg.com/i/33Uc5.png

Original: https://funkyimg.com/i/33LYn.png

Are you on Discord? Would love to chat.

ThirteenAG commented 4 years ago

If you have more interesting findings in the future, please keep posting here, because I will be implementing them within the fix some time later.

killer-m commented 4 years ago

@chrisdavis925 That's right, you need the latest version 1.02a http://patches.ubi.com/splinter_cell_double_agent/

There is no radius value, only screen offset value to each texture. The increased resolution makes the edges sharper and the glow becomes less noticeable. I will try different values for resolution and texture offset to get the best result.

I need your saves with this triangle to check what went wrong. %PROGRAMDATA%\Ubisoft\SplinterCell4

killer-m#8383

killer-m commented 4 years ago

If you have more interesting findings in the future, please keep posting here, because I will be implementing them within the fix some time later.

Framerate limit - SplinterCell4.exe

Preferable screen refresh rate - D3DDrv.dll

namloki18 commented 4 years ago

hey, can I ask if sb tried this ?, at the first level (ice plant) if I enable FSAA=2 or 4 or 8 in the ini file, I can see the transparent ice exactly like Xbox version, but cant enable RT and MXAO in reshade. Can I somehow get both of it ? I also think the skin detail option in the ini file is broken, Fisher skin look not as good as xbox 360, one (x) version (which has sweat and scar details).

killer-m commented 4 years ago

Reshade does not have access to the depth buffer when FSAA is enabled, and because of this, some effects do not work.

You can get transparent ice without FSAA

FSAA will not work in this case, the ice will be transparent and ReShade will be able to use effects with access to the depth buffer.

namloki18 commented 4 years ago

Reshade does not have access to the depth buffer when FSAA is enabled, and because of this, some effects do not work.

You can get transparent ice without FSAA

* Find and replace these bytes in **D3DDrv.dll**:
  8A 86 5D 5D 00 00 83 C4 10 → 30 C0 90 90 90 90 83 C4 10

* Set **FSAADegree=2** in **SplinterCell4.ini**

FSAA will not work in this case, the ice will be transparent and ReShade will be able to use effects with access to the depth buffer.

Tks, you changed my life, the game looks really good now, FSAA is suck tho, dont need it anyway. btw afaik, some light source in the game still disappear when out of range, no matter what value you put into the line ShadowTurnOffDegree in the ini file. Is it possible to solve this problem through D3DDrv.dll file editing ?

Ghaleon4 commented 4 years ago

Wow; this thing blew up a little while after my last post! Is there any chance that we can get those bloom/emissive lighting fixes into Chaos Theory? It's juuust as bad.

Ghaleon4 commented 4 years ago

Due to some of the latest posts, I decided to purchase Double Agent. Now if only we could get bloom/emissive lighting resolution improvements in both Chaos Theory AND Double Agent!

chrisdavis925 commented 4 years ago

Killer-m has been a really huge help with all of this!

What I found after his investigation, is that if you increase the resolution of the bloom it starts to lose its bloom effect. Perhaps there is a way to edit the shader or make some other type of change which will allow a higher resolution bloom while retaining a soft / large bloom area?

On Thu, Jul 30, 2020, 5:10 PM Ghaleon4 notifications@github.com wrote:

Due to some of the latest posts, I decided to purchase Double Agent. Now if only we could get bloom/emissive lighting resolution improvements in both Chaos Theory AND Double Agent!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThirteenAG/WidescreenFixesPack/issues/725#issuecomment-666808118, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWHYITJS3QJCJJHISHG5TLR6IDYVANCNFSM4IVAUJ5Q .

Ghaleon4 commented 4 years ago

Killer-m has been a really huge help with all of this! What I found after his investigation, is that if you increase the resolution of the bloom it starts to lose its bloom effect. Perhaps there is a way to edit the shader or make some other type of change which will allow a higher resolution bloom while retaining a soft / large bloom area? On Thu, Jul 30, 2020, 5:10 PM Ghaleon4 @.**> wrote: Due to some of the latest posts, I decided to purchase Double Agent. Now if only we could get bloom/emissive lighting resolution improvements in both Chaos Theory AND* Double Agent! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#725 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWHYITJS3QJCJJHISHG5TLR6IDYVANCNFSM4IVAUJ5Q .

Ooooh, I saw that; now I know what you meant. Well, let me use this opportunity to yet again express gratitude for ThirteenAG, Killer-M, and everyone else that contributes to this stuff. : )

kusmider commented 4 years ago

I may sound like a noob but I can't find these values "68 00 08 00 00 68 00 08 00 00" in my SPLINTER CELL 3.exe. I'm using HxD. And my game version is 1.05 (non-english). I opened the .exe, hit ctrl+f, search these values but cannot find.

Keith94 commented 4 years ago

Make sure to search as hex values rather than text after pressing ctrl+f

kusmider commented 4 years ago

Make sure to search as hex values rather than text after pressing ctrl+f

Thank you for responding. Unfortunately that doesn't work either :(

ArhumMK commented 4 years ago

@killer-m Sorry for commenting this late on something old on this post. My PC runs SCCT at smooth 1080p60 but your shadow fix's bump up to 8192 is a little too overkill for my 16:9 display as my framerate drops all the way to 10fps when I see shadows. So I was wondering if it would be possible for you to make a more lower end friendly version of the fix, perhaps dropping the shadowmaps to 4096 or any other tweak that could improve performance but still keep the shadows intact in 16:9 (I don't mind blurry shadows, as long as it is like the original and fixed)? Thank you and keep up the good work!

killer-m commented 4 years ago

@ArhumMK

ArhumMK commented 4 years ago

@killer-m Oh Wow never expected you to respond so quick! Thank you very very much!

Edit: the 3072 .exe makes the shadows look as good as 8192 (atleast for 1080p) but runs 3x better, thanks again!

Duelx24 commented 4 years ago

Hi @killer-m

I am currently re-working "Splinter Cell Chaos Theory" and turning it into HD version, the way PS3 and Xbox got their refined versions, while PC version was left to pick dust. I am reworking the graphical aspects of the game, but currently I am stuck with BINK videos not able to play at a higher resolution than 640x480. I was wondering if you could point me to the right direction. I assume that BINK video resolution is hidden somewhere within splintercell.exe , would like to upscale videos to 4K.

And also was wondering if there is a way, to change in-game resolution to widescreen natively.

Thank you in advance!

Regards,

killer-m commented 4 years ago

@Duelx24 To play video up to 3840x2160, find and replace these bytes in splintercell3.exe

Duelx24 commented 4 years ago

@killer-m

Yes. working flawlessly. Thank you very much sir!

NoUserNameForYou commented 4 years ago

@killer-m

Holy shit! Killer-m, you are a killer!

Thanks a lot!

I have a very similar request. In the original SC, in the first episode, some shadows disappear when you get close to them (I know, it should be the opposite, lol).

https://www.youtube.com/watch?v=iQMS39c3ggg

25:30

Same thing doesn't happen on the Xbox copy.

Can you help with this. Also Double Agent is (I believe) missing HDR rendering, it's just bloom.

https://www.youtube.com/watch?v=WQJ3OdCLWKk - 54:32

https://www.youtube.com/watch?v=Cv8PnaKNsvc&list=PLjRn9IUTqS1AWtEghNIDsE54CLEjL6Esh&index=4 0:43

thanks again man!

chrisdavis925 commented 4 years ago

@NoUserNameForYou that's a level design choice Ubisoft made. They have set that light to cast shadows only in that "zone". Unreal engine has zones / portals for legacy rendering optimization. Level designs can choose what zones a light can emit / cast shadows in. You will notice in that example you shared that the shadows disappear as zone as the camera exits the inside room, which is surely where they have placed the perimeter of the zone / portal.

On Mon, Nov 2, 2020 at 4:53 AM NoUserNameForYou notifications@github.com wrote:

Holy shit! Killer-m, you are a killer!

Thanks a lot!

I have a very similar request. In the original SC, in the first episode, some shadows disappear when you get close to them (I know, it should be the opposite, lol).

https://www.youtube.com/watch?v=iQMS39c3ggg

25:30

Same thing doesn't happen on the Xbox copy.

Can you help with this. Also Double Agent is (I believe) missing HDR rendering, it's just bloom.

https://www.youtube.com/watch?v=WQJ3OdCLWKk - 54:32

https://www.youtube.com/watch?v=Cv8PnaKNsvc&list=PLjRn9IUTqS1AWtEghNIDsE54CLEjL6Esh&index=4 0:43

thanks again man!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThirteenAG/WidescreenFixesPack/issues/725#issuecomment-720453319, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWHYITJWMAVLQO7VZVCQCTSN2TUXANCNFSM4IVAUJ5Q .

NoUserNameForYou commented 4 years ago

@chrisdavis925

@NoUserNameForYou that's a level design choice Ubisoft made. They have set that light to cast shadows only in that "zone". Unreal engine has zones / portals for legacy rendering optimization. Level designs can choose what zones a light can emit / cast shadows in. You will notice in that example you shared that the shadows disappear as zone as the camera exits the inside room, which is surely where they have placed the perimeter of the zone / portal.

Yeah but it doesn't happen on the XB OG version.

https://www.youtube.com/watch?v=JriSe12tzd8 32:00

I also hex edited the XBE file of the xbox version for widescreen and it's not a camera/fov issue either.

splinterCellFan commented 3 years ago

This is pure gold right here.

@killer-m I dont want to abuse your generosity but would it be possble to look in other issues regarding this great series? So somebody over at Vogons(https://www.vogons.org/viewtopic.php?f=59&t=51724&start=120) high praised your work and i couldnt help asking here. Please note that i raised a issues severel years ago: https://github.com/ThirteenAG/WidescreenFixesPack/issues/275 but probably got overlooked as is not related to @ThirteenAG great work. (talk about karma numbers and persistence) I 've started a thread there(https://www.vogons.org/viewtopic.php?f=59&t=51724) with the issues mainly from Splinter Cell 1 and 2 using DgVoodoo wrapper. But remaining issues are not really wrapper related so they remained unresolved.

So if you are interested (you must use DgVoodoo wrapper 4800Ti preset before hand, to restore shadows and things)here goes: For Splinter Cell 1 there is a 10+ year old issue(anybody that will fix this will make history..lol) called Shiny texture bug in the CIA(inside building) level: https://i.imgur.com/c1G3fAZ.png image

Here's the original: https://i.imgur.com/NJDdaUy.png image

So this part worked correctly only GeForce 4 cards back in the day. Any other cards will have issues with this thing. There are other small gltiches but this is the main ugly bad one. :) If this can get fixed + DgVoodoo wrapper+Widescreen patch will make the ultimate experience.

For Splinter Cell 2 there are 2 nasty bugs:

1.Heat haze is resolution dependent.(fire places are the best ones to notice this) _https://i.imgur.com/lyWFOaP.png image

Here's how it looks on 640x480(distorted image of the wood in the background). On higher res the effect will be less. 4k it's almost non existing_

2.Flickering of the corona of lights.(exterior button lights of elevator/lift, candles in the first level, etc) https://i.imgur.com/CEU5Jso.jpg After mouse move: https://i.imgur.com/P8JETCZ.jpg

I know this can be a lot and i understand, it takes time. If you dont have time or something, there is no problem. I had to try because It would mean a lot for the comunity and fans out there to have these fixed. Imagine the joy reliving ones childhood. :)

Using DgVoodoo with res Forcing 'fixes' heat haze(this code still think it's 480p and renders ok) and is breaking bloom/aura(rendering at that forced resolution) around some objects. (because of this higher res flickering dissappears)

So it appears the game must not apply the resolution to bloom and heat haze, i tihnk.

Zaphero1 commented 3 years ago

Cold Fear has the same issue, where the shadows will change size more erratically and be more detached from the object the wider the resolution. 20210525133315_1 20210525133653_1 Unless I'm missing an important setting, Dgvoodoo and Dxwnd oddly seem to break this game's effects, like Dgvoodoo breaks some lighting and Dxwnd breaks the lens water droplet effect for whatever reason.

I've fallen in love with this game, but I do not know where to start for finding out how to fix this.

killer-m commented 3 years ago

@Zaphero1 Shadows must be excluded from the FOV correction. To fix this, copy scripts.zip folder to the game folder.

Zaphero1 commented 3 years ago

@killer-m DANG yeah it works! That was so fast; thank you very much! Fixed Shadows

ThirteenAG commented 3 years ago

Perhaps a pull request to merge it in the main branch?

Zaphero1 commented 3 years ago

On top of that, as absurd as it sounds, perhaps that widescreen patch for Cold Fear should be updated to support 4:3 so that it can be a universal change for those who just want to increase the FOV and not change the aspect ratio. For whatever reason the game doesn't launch if you put a 4:3 resolution in the ini file.