-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DX12: Naruto Shippuden: Ultimate Ninja Storm Generations- Shadow and depth issue #1949
Comments
It's an issue with the way depth buffer is used in the engine (I assume it's the same for every Naruto game). The game renders the scene normally then overwrites it (hence the missing geometry). I had a patch that copied d24_X8 texture to a buffer which is then copied to a RGBA8 textures which solved the glitches but there might be a better way to do by hacking shader. |
How come its not possible to query directly as RGBA8 like RSX? |
Modern gpu uses compression algorithm on depth stencil which hides actual implementation. Additionally not every gpu supports d24x8 internally, radeons fallback to d32x8. We can transform depth value to rgba before sampling (it's only a compute shader task) or split depth in 3 part in fragment shader |
I think we can just use a sample_depth_as_rgba in fs to return a 3/4 component vector that is already weighted. Not sure how to split the depth value into pieces at the moment though. Maybe we can use the naruto shader weighting vector to reconstruct the split. |
After analyzing the shader the values used are roughly (1.f, 1/256.f, 1/50k) or roughly what i'd expect from bitshift of 0, 8 and 16. Using these values in shader workarounds works very well (and I'm assuming gets around some precision issues), but unfortunately, some programs seem to sample the depth texture as RGBA8 when it seems otherwise unexpected e.g the depth gcm sample. |
Nevermind. Seems to work fine like that. |
@vlj Are you still in RPCS3 team? |
@ikki84 I think probably not :( |
Please retest this @SakataGintokiYT |
@kd-11 |
#2861 fixed shadows, game displays correctly now, I verified, didn't check on D3D12 though |
@vlj
@kd-11
Shader-Log : https://mega.nz/#!MdpSCAwT!RXmjPlCuOrYp3Ymb4MF8azLwf9efnqXEnXT-GxDBm1U
The text was updated successfully, but these errors were encountered: