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

  • thugorgibson
  • Topic Author
More
2 years 8 months ago #1 by thugorgibson Can a depth buffer be used to draw shadows in screen space? was created 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.

  • lordbean
More
2 years 8 months ago #2 by lordbean Replied by lordbean on topic Can a depth buffer be used to draw shadows in screen space?
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.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.