Nier Automata, surching for help/solution

about everything
Post Reply
  • Author
  • Message
Offline
Posts: 2
Joined: 06 May 2020, 06:15

Nier Automata, surching for help/solution

Hello, I'm active Nier moder and trying to make Nier automata more playable. Currently the game have one big issue remaning.
(see the wall)


Why it's looks like this. Kaldaien(specialK developer):
I remember putting a little bit of work into the cascaded shadow map problem, but as it turns out this problem is related to the Global Illumination performance issues and occasional driver resets (white screen). The engine is trying to write to the depth buffer in pixel shaders and read from it in compute shaders simultaneously, which is not doable in D3D11.
As a compromise, they seem to have just massively reduced shadow draw distance to make the problem appear to go away. If you try to boost the amount of shadow data, then the render and compute pipelines go back to fighting for control of the depth buffer and performance tanks and the driver eventually resets itself because compute shaders are taking too long :-\
There are ways around this, but none are simple. I tried recording and replaying draw calls to do depth write / read as two separate passes and it very nearly worked, but it's ever so slightly beyond my capabilities. It is very frustrating, because if I could get that working it has a massive impact on performance without any loss in image quality
My goal is fix this problem(i know this will be very problematic) or turn off/hide/remove that part of the shadows and use external ssao injection.

There was an attempt to manipulate shadow shader (dumped with d3migoto)
Attempt to fix(megai2), good result but shadows glitch on some camera angles/player position.

Code: Select all

r0.xyzw = float4(3,3,0,0);
  while (true) {
    r1.x = cmp((uint)r0.y >= 4);
    if (r1.x != 0) break;
    r1.xyzw = x0[r0.y+0].xyzw;
    r1.xy = r1.xy / r1.ww;
    r1.z = max(abs(r1.y), abs(r1.z));
    r1.z = max(abs(r1.x), r1.z);
    r1.z = cmp(0.99000001 >= r1.z);
    if (r1.z != 0) {
      r0.zw = r1.xy;
      break;
    }
    r0.xy = (int2)r0.xy + int2(1,1);
    r0.zw = r1.xy;
  }

Renderdoc frame
Nier injector/debugger

This game is on same engine with Bayonetta as I know. Also I can compleatly disable shadows, so asking If it possible to cast shadows with enb like in GTA or Skyrim?

Sorry for my english(If something is not clear I can speak Italian/Russian). And hope for your help.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17447
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: Nier Automata, surching for help/solution

Such bug usually happens when game render different geometry lods to shadowmap or when one of shadow cascade in that distance is having much higher pixel density (to area in 3d world) than another. Sometime, if shadow offset is applied when some cascade is rendered or when sampled to reduce artifacts (that's easy to disable in shaders usually). If there is no data in next level of cascade to blend with it or no next cascade level at all, then simplest way is to make fade out by distance or by UV of that cascade level, if game set it strict enough to know which UV edges are responsible for far distance. You can make detailed shadows like i do, it's simply depth based tracing of rays to sun direction, but this effect could take a lot of time to tweak and to extract required data from shaders, for example need inverse matrices to transform depth to world and back world to screen space, usually shadow codes do not have both. Also sun direction is mostly just matrix to transform depth to shadow space, so need code to generate sun direction from shadow matrix (with cascade it's more complicated, could be several shadow matrices or offsets). It's very individual per game. Oh, almost forgot, if there is another cascade, also possible easily to blend two by making dithering pattern as mix factor on the edge of cascades to choose one of them instead of writing lot of code to sample two and then mix both. It's like opacity in some modern games made via holes (or in GTA4).
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
Posts: 2
Joined: 06 May 2020, 06:15

Re: Nier Automata, surching for help/solution

Unfortunately this is out of my capabilities. Still thank you for the responce.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17447
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: Nier Automata, surching for help/solution

You are welcome
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7
Post Reply