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

graphics issues in Ninja Gaiden black and DOA2U #270

Closed
ko81e24wy opened this issue Mar 23, 2021 · 16 comments · Fixed by #778
Closed

graphics issues in Ninja Gaiden black and DOA2U #270

ko81e24wy opened this issue Mar 23, 2021 · 16 comments · Fixed by #778

Comments

@ko81e24wy
Copy link

ko81e24wy commented Mar 23, 2021

I upload them in one post,cause they may use same engine,and have similar graphics issues
title:54430006
some high-light effect(or bloom?) missing(also in Ninja Gaiden)
777
222
title:5443000d
and some shadow problems(sometimes missing,sometimes incorrect)
4455
fixed by #778 some steam effect broken in chapter 12,
8889
fixed by #599 and this issue may some anti piracy thing?
000

@SK91no
Copy link

SK91no commented Mar 23, 2021

The last bit there isn't an anti-piracy measure, its a bug
the Discord user Caroline has given a possible explanation so look it up in the Discord search bar if you can with the keyword "Ryu"

@ko81e24wy
Copy link
Author

The last bit there isn't an anti-piracy measure, its a bug
the Discord user Caroline has given a possible explanation so look it up in the Discord search bar if you can with the keyword "Ryu"

yes,I had try that way,its a good solution,but not perfect.if you set the texture transparent,the evil RYU costume in chapter 15 will
be incorrect.
555

@ko81e24wy ko81e24wy changed the title graphics issues in Ninja Gaiden blcak and DOA2U graphics issues in Ninja Gaiden black and DOA2U Mar 24, 2021
@vanderleivieirainacio
Copy link

So is it possible to fix this Ryu Hayabusa bug? If possible, would it be very difficult to make this correction?

@ko81e24wy
Copy link
Author

ko81e24wy commented Mar 26, 2021

So is it possible to fix this Ryu Hayabusa bug? If possible, would it be very difficult to make this correction?

I think it is possible in the future,and the fix will make other games better.but now its good enough to enjoy the game .so let's be paient.

@vanderleivieirainacio
Copy link

Ok, thanks for the information and for taking time to answer my question.

@micjgam
Copy link

micjgam commented Dec 19, 2021

So... are the steam effects able to be fixed? Does this same issue exist in ch. 16?

@ko81e24wy
Copy link
Author

ko81e24wy commented Feb 6, 2022

test with this build(#599 ) https://github.com/mborgerson/xemu/actions/runs/1698535861 fiend texture were fixed,still has stream issues in chapter 12
mater build before this pr
2022-02-07 02-06-27 的屏幕截图
#599
2022-02-07 02-07-35 的屏幕截图

@abaire
Copy link
Contributor

abaire commented Mar 11, 2022

pgraph dump of the issue in the Magma Cavern level

ngb_steam.txt

The heat shimmer is applied to a 512x256 capture of the backbuffer after the full scene is rendered. An alpha blended 128x128 white circle is used as the second texture input.

Shaders used in the initial pass:
ngb_vs.glsl.txt
ngb_fs.glsl.txt

In my particular test case, the framebuffer is 720x480. In the initial shimmer pass, I see that it appears to center the 512x256 texture with clamping happening on the left and bottom. This is extremely pronounced if I temporarily disable the alpha adjustment in the second stage combiner:

ShimmerPassAlphaDisabled

Texture border color is set to white, which probably explains why it looks like white steam.
LOD_BIAS for the framebuffer texture is set to 7937, for the cloud texture it's 0.
The minification filter for the framebuffer texture is set to TENT_NEAREST_LOD

Texture planes for stage 0:

c[64] 1.00, 0.00, 0.00, 0.00 float4
c[65] 0.00, 1.00, 0.00, 0.00 float4
c[66] 0.00, 0.00, 1.00, 0.00 float4
c[67] 0.00, 0.00, 0.00, 1.00 float4

There's also a texture matrix enabled for texture 0:

0.708939, 0.000000, 0.515000,  0.000000,
0.000000, 1.260336, 0.490000, 0.000000,
0.000000,  0.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000

SKIN_MODE is set to off

Alpha kill is enabled on the cloud texture. Interestingly if I set the threshold to something higher than 0.0 (e.g., 0.25), I see a shape that looks more plausibly correct (the shimmer effect is still wrong, but seems to float over lava pools).

I also see that TEXGEN S, T, and R are all set to 0x2400 = EYE_LINEAR, which seems like it may be an interesting place to start investigating.

@abaire
Copy link
Contributor

abaire commented Mar 15, 2022

The white contribution is actually not due to the border color, so somehow the second texture channel is being rendered to screen directly. This is particularly strange as the combiner does not use the t1 color channel at all; all color comes from t0 (the downscaled backbuffer content).

Edit: On closer inspection, the captured framebuffer has 1 pixel white lines along the top and right, so this is entirely explainable by the edge clamping behavior that is seen along the left and bottom edges.

@abaire
Copy link
Contributor

abaire commented Mar 16, 2022

It looks like the combination of texgen + texture matrix leads to incorrect behavior. I wrote tests for texgen and texture matrix individually and both appear to match hardware, but a test using both differs dramatically (it appears to disregard the texture matrix)

@abaire
Copy link
Contributor

abaire commented Mar 16, 2022

It looks like the issue is that the Q and R generation planes are swapped. Switching them gives reasonable output:

fixed_shader

It's not entirely clear to me why this is the case, but the actual values do look wrong (the constant at 0x42 is [0,0,1,0] which looks like it should be R, but is assigned to Q; the constant at 0x43 is [0,0,0,1] which looks like it should be Q).

I'm not sure if this is dependent on the texgen mode or if it's actually indicative that the texture matrix needs to have rows swapped.

@ko81e24wy
Copy link
Author

ko81e24wy commented Mar 16, 2022

test PR #778,fix the graphical issue in CH12
https://www.youtube.com/watch?v=ahl9URuvbLw

@mborgerson
Copy link
Member

Can you re-file any issues that persist (e.g. dim lighting) individually so we can track them independently @ko81e24wy

@ko81e24wy
Copy link
Author

ko81e24wy commented Mar 17, 2022

open a new issue or just edit this one?

@mborgerson
Copy link
Member

mborgerson commented Mar 17, 2022

@ko81e24wy just open a new issue for each one that persists, so we can have a clean slate

Thanks in advance!

@ko81e24wy
Copy link
Author

@ko81e24wy just open a new issue for each one that persists, so we can have a clean slate

Thanks in advance!

will do.

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

Successfully merging a pull request may close this issue.

6 participants