-
Notifications
You must be signed in to change notification settings - Fork 175
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
SDEX games incorrect upscaling in HLE #936
Comments
Fixed in LLE, kinda. (Game develops different visual errors.) |
I corrected sprite sizes and applied the new filtering method. Most of the issues are gone. |
interesting! |
Could it be the usage by the devs of the effect of gSPObjRenderMode, G_OBJRM_WIDEN? I tried to figure out this is working in your code, no idea where it is :( |
I don ' t know about that rendermode |
http://n64devkit.square7.ch/n64man/gsp/gSPObjRenderMode.htm G_OBJRM_WIDEN |
Hmm. I need to read the code. May be it is processed somewhere, but I don't remember that. |
as far as I can see in gSP.cpp: if (gDP.otherMode.cycleType != G_CYC_COPY) { No idea why only in copy mode only the shrink happens. Why not in another cycles? No G_OBJRM_WIDEN |
It is old bug iirc. An it is 3D. |
The sizes of the sprites are incorrect. I remember comparing them in HLE and LLE. That solves some of the issues, but there is still a general texture coordinate issue. |
Do you know in texel the difference or the proportion compared to the sprite size between lle and hle? |
Not sure I understand what you mean. In HLE sprites are one texel short, except in copy mode (31 vs 32 on the first screenshot). I am speaking the measures GlideN64 gives to them. Look at that. I think I messed up that branch, but I got it working with that change (remove the -1) and a hacky way of handling texture coordinates. I'm trying to reproduce it on current master, but I'm having some trouble. |
I investigated this a little bit. The problem seems to be in sprite coordinate creation, in ObjCoordinates constructor. This is how the sprite is handled in HLE. In LLE the rsp plugin readies a texrect command, which then the graphic plugin (GlideN64 executes). The sprite size seems incorrect currently. In LLE sprite sizes are 1 pixel larger than in HLE when not in copy mode. I can't see any real reason why to subtract 1 to The texture coordinates, however, coincide in both LLE and HLE, but I get different results. In LLE mode, I measure them after the last addition is done in 6301e99 @gonetz Any ideas why the same texture coordinates are giving different result? The only difference is that in LLE the primitives are rendered through I checked the flags @olivieryuyu suggested and objRendermode is set to 0, so they shouldn't be used anyway. |
texrect command does not provide texture coordinates for all 4 vertices. lrs and lrt calculated from other texrects parameters. drawTexturedRect passes ready GL texture coordinates to vertex shader. drawScreenSpaceTriangle works as drawTriangles : it passes vertices with N64 texture coordinate to vertex shader. Vertex shader calculates GL coordinates. Vertex shader does the same calculations as texrect, so result should be the same for the same input. However, there are 2 nuances:
ObjCoordinates does not add dsdx and dtdy. edit: it should not matter, because in gDPTextureRectangle
thus
|
those games uses gSPBgRect1Cyc? |
SD Hiryuu no Ken Densetsu does. |
@olivieryuyu by any chance, do you have a demo with source code for S2DEX? |
here you go |
thanks a lot @olivieryuyu! Imo, fixing S2DEX is important 😄 . |
while searching for data on certain macros, I came across this https://github.com/shlomnissan/ultra64demos/tree/master/gs2dex . Do you kno where I can get the ROM for this? I'm collecting demos so that I can learn more about HLE gfx 😄 . |
nope |
it seems that Culture Brain does not use the normal S2DEX ucode. Need further checks but it looks so. Amazing ... |
I was incorrect, Culture Brain used the normal ucode SDEX ucode. |
Reopen since the fix is reverted. |
I started to investigate the issue but it seems the bugs has been reduced (without being totally fixed). What changed this? |
it used to be correct with the version of the 5 November in any resolution! i guess the new issue started as from this commit: |
I finally went through gSPBgRectCopy command. It is really a hard stuff. Let's see if we can finally improve the games using this command. |
Can I have a build that includes this fix? |
there is no fix yet, just reverse engineering. |
Glad your looking into it. This and the viewport stuff with some of the multiplayer’s games would be nice if they get fixed. |
From this one: |
fixed |
on top of being slow, there is gfx bug not related to scaling or filtering apparently
The text was updated successfully, but these errors were encountered: