Can a depth buffer be used to draw shadows in screen space?

More
1 month 3 weeks ago #1 by thugorgibson
I'm currently playing the original Just Cause on pc but, after seeing what the Xbox360 version has better than it, I decided to try and improve upon its look. The major issue I see in it is a shadow issue of some sort (maybe intended somehow): shadows are rendered much lighter on top of grass than on the roads. And at night time they completely vanish from any textures but the roads. This leads them to be almost unnoticeable, leaving the game world very bland and with low contrast. While messing with Reshade and Special K, i've noticed the game renders shadows in the game world via a 1024x1024 "vertex buffer(?)" of some sort. Changing random values in Cheat Engine from "1024" to "2048" or "4096" was what eventually led me to this finding. When this "buffer"s width or height resolution gets changed, the shadows get completely misaligned from the world objects and move around with the camera perspective. I eventually stumbled upon the d3d9 tab on the top menu of Reshade, where this particular "buffer" shows up. Also, this "buffer" shows up in Special K under the "Live Render Target View" with a D24S8 format.

To the main question:
Would it be possible, either with Reshade, a modified .dll or any other tool (e.g. Cheat Engine), to use this "buffer"'s information to render new shadows in screen space atop the old ones or even replace them altogether?

Here's a link to an album with captioned images to better demonstrate my points, Just in Cause: imgur.com/a/rIirvl0
Thanks for reading!

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #2 by lordbean
You can't inject a new shadowmap into the game but you can add ambient occlusion as long as it's not a multiplayer game. When you install ReShade and it asks what presets you want to download, put a checkmark in the qUINT package and then look for MXAO in the shader list in the game.

Please Log in or Create an account to join the conversation.