Skip to content
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

GL/Vulkan: Naruto Shippuden: UNS Generations / RenderDoc #2149

Closed
SakataGintokiYT opened this issue Sep 21, 2016 · 47 comments
Closed

GL/Vulkan: Naruto Shippuden: UNS Generations / RenderDoc #2149

SakataGintokiYT opened this issue Sep 21, 2016 · 47 comments

Comments

@SakataGintokiYT
Copy link
Contributor

@kd-11
Vulkan:
Fotoszok.pl

Title Screen.rdc
Menu.rdc


OpenGL:
Fotoszok.pl

Title Screen.rdc
Menu.rdc

@kd-11
Copy link
Contributor

kd-11 commented Sep 22, 2016

I think this is related to #1949
I'll start working on this as it has been on the list of graphical issues for a while.

@kd-11
Copy link
Contributor

kd-11 commented Sep 22, 2016

Please test https://ci.appveyor.com/project/kd-11/rpcs3/build/1.0.262/artifacts when its done building (opengl only)

@kd-11
Copy link
Contributor

kd-11 commented Sep 22, 2016

If its still not working, get the title screen renderdoc trace with opengl and the build i've posted.

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 22, 2016

@kd-11
Fotoszok.pl
Title Screen.rdc

@kd-11
Copy link
Contributor

kd-11 commented Sep 22, 2016

Oops. I messed up generating the reconstruction function; its missing a constructor declaration. This should have that specific issue fixed. Check if anything has changed.
https://ci.appveyor.com/project/kd-11/rpcs3/build/1.0.263/artifacts

@kd-11
Copy link
Contributor

kd-11 commented Sep 23, 2016

https://ci.appveyor.com/project/kd-11/rpcs3/build/1.0.264/artifacts Should fix the black and white bug when using regular textures.

@kd-11
Copy link
Contributor

kd-11 commented Sep 24, 2016

https://ci.appveyor.com/project/kd-11/rpcs3/build/1.0.267/artifacts
Hopefully it works better this time.

@kd-11
Copy link
Contributor

kd-11 commented Sep 24, 2016

Uggh. I forgot something else. Will update with a better build. (Depth scale is logarithmic, not linear)

EDIT: I'm losing precision elsewhere during the reconstruction.

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 24, 2016

@kd-11
Pixels are rendered , in menu and at title screen
[ 9fce47f ]
Fotoszok.pl
Title Screen.rdc
Menu.rdc

@kd-11
Copy link
Contributor

kd-11 commented Sep 24, 2016

There's another problem with early exit in fragment shader: we should write depth before returning. I've started to understand the algorithm in place here.

image

@kd-11
Copy link
Contributor

kd-11 commented Sep 24, 2016

https://ci.appveyor.com/project/kd-11/rpcs3/build/1.0.268/artifacts Manually re-uploads the texture data. I'll need it to compare my reconstruction with the proper upload.

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 24, 2016

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

Fixed re-upload of the texture. If this doesnt work, we probably have another error elsewhere. If it runs correctly (or somewhat correctly) using dx12, i'd like to take a look at the dx12 shaderlog.

https://ci.appveyor.com/project/kd-11/rpcs3/build/1.0.269/artifacts

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 25, 2016

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

The problem is elsewhere. There's another RTT being sampled even before we reach the code where depth reconstruction is done. As such, I think the reconstruction function works quite well.
The problem seems to be the fact that OGL and VK ignore render target swizzles, but DX12 has select cases enabled. Will have to implement some RTT channel remapping.

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

https://ci.appveyor.com/project/kd-11/rpcs3/build/1.0.270/artifacts
Remaps render targets as well. Might break some games (probable wierd blue-red swapping)

@Nezarn
Copy link

Nezarn commented Sep 25, 2016

@kd-11 its not just "might" break some games, it does break some :P (project diva games)
http://i.imgur.com/tm3hXs3.png
http://i.imgur.com/l9HqzsW.png

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

I know it does; its hacky right now. I removed this from the vulkan renderer for this very reason, but if there are games that rely on the remap behaviour, I need to know.

@SakataGintokiYT
Copy link
Contributor Author

@kd-11
No change

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

That means something else is broken. Its not the same issue as #1949 then. Something about the texture coordinates used is wierd.

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

image

With the texture reconstruction and some minor tinkering:
Now, to make thes changes stick.

P.S: I've finally figured out why this is happening. Will need to rewrite parts of the glsl code generator. The method "return" as inserted in the middle of a shader does not mean exit and abandon all, we have discard for that. The main_end has to be invoked upon routine termination. I was right here: #2149 (comment)

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

https://ci.appveyor.com/project/kd-11/rpcs3/build/1.0.271/artifacts Should fix this on opengl. The depth reconstruction is still WIP so if you can get ingame, check for depth artifacts.

@SakataGintokiYT
Copy link
Contributor Author

@kd-11
I get this error before the title screen

E {rsx::thread} RSX: Failed to compile vertex shader: 0(79) : error C1038: declaration of "dst_reg6" conflicts with previous declaration at 0(79)
0(221) : error C1038: declaration of "dst_reg6" conflicts with previous declaration at 0(211)

F {rsx::thread} class gl::glsl::link_exception thrown: linkage failed: 'Vertex info
-----------
0(79) : error C1038: declaration of "dst_reg6" conflicts with previous declaration at 0(79)
0(221) : error C1038: declaration of "dst_reg6" conflicts with previous declaration at 0(211)
(0) : error C2003: incompatible options for link
'

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

I'm guessing the shader contains a tc9 or clip plane input. Could you attach the shader. Just clear the shaderlog folder and attach the last vertex shader generated. It will have the largest number.

@SakataGintokiYT
Copy link
Contributor Author

@kd-11
shaderlog

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 25, 2016

Fotoszok.pl

@kd-11
I can't run any mode, because a game stuck at black screen after choosing mode

@Nekotekina
Regression by #2043

Log
TTY

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

I'm creating a PR with the shader stuff without the depth reinterpret stuff as it seems kinda broken at the moment. Also, depth read sample binds a depth buffer as RGBA, but expects to read a normal depth value from it, not a reconstructed one. At least until we can go ingame, then we can proceed.

EDIT: Seems removing the depth reconstruction code causes the fence and structure behind naruto disappear.

EDIT2: I have a workaround for that as well.

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

#2155 should fix this issue without the wierd depth reconstruction glitches

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 25, 2016

[ add58c01 ]
OpenGL
Fotoszok.pl

Vulkan
Fotoszok.pl

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 25, 2016

[ add58c01 ]
@kd-11

Naruto Shippuden: UNS 3 ( In Game )
[OpenGL]

Fotoszok.pl

[Vulkan]
Fotoszok.pl

Shaderlog-GL
Shaderlog-Vulkan

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

Is the red color present in the title screen and menus as well? Also, a trace of opengl would help a lot.
EDIT: Just noticed that this is UNS3 is UNS generations okay?

@SakataGintokiYT
Copy link
Contributor Author

Naruto Shippuden: UNS Generations ( Menu works well )

@kd-11
Copy link
Contributor

kd-11 commented Sep 25, 2016

okay. then just attach the renderdoc trace for that red UNS3 scene. Does it show correctly using DX12?

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 25, 2016

DX12
Fotoszok.pl
Shaderlog-DX12

@SakataGintokiYT
Copy link
Contributor Author

@kd-11
[OpenGL-Trace]
red-scene

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 26, 2016

@kd-11
[ 9469c03a ]
Naruto Shippuden: UNS Generations
[OpenGL]
Fotoszok.pl
[Vulkan] Perfect render this scene
Fotoszok.pl


Naruto Shippuden: UNS 3
[OpenGL]
Fotoszok.pl

[Vulkan]
Fotoszok.pl

OpenGL-Trace

@kd-11
Copy link
Contributor

kd-11 commented Sep 26, 2016

#2155 might solve this.

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 26, 2016

@kd-11
Naruto Shippuden: UNS 3 / still not fixed yet

@kd-11
Copy link
Contributor

kd-11 commented Sep 26, 2016

Actually, the image has changed from the look of things. You can see the correct scene covered by the fullscreen effect. Only the post-process stuff needs some adjustment now. Attach a new opengl trace.

@kd-11
Copy link
Contributor

kd-11 commented Sep 26, 2016

The scene is now correctly rendered but the post-process effects are upside-down. Can you retest with current master? Some fixes have been implemented opengl side. I'm not sure its anything that'll fix it, but just take a look.

@kd-11
Copy link
Contributor

kd-11 commented Sep 26, 2016

The problem is that the game is using an input texture as the render target which is just crazy. Maybe I should force copying of surfaces in cases like these

@SakataGintokiYT
Copy link
Contributor Author

SakataGintokiYT commented Sep 26, 2016

@kd-11
Naruto Shippuden: UNS 3:

OpenGL-Trace
Moon
Village
VS Fox

@kd-11
Copy link
Contributor

kd-11 commented Sep 27, 2016

GL and vulkan dont mirror wpos based on window origin!
Will submit a fix ASAP

@kd-11
Copy link
Contributor

kd-11 commented Sep 28, 2016

This should have been fixed now. If its fixed, please close this ticket.

@raven02 raven02 closed this as completed Sep 28, 2016
@EmulationPsycho
Copy link

I'm getting this error in Naruto storm generations and can not go in the game, with WHAT this could be related?
capturar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants