Closed gonetz closed 5 years ago
Related open issues:
Ok just did some testing. I am using the latest development build of Project 64.
Found a minor issue with Mario Kart 64. This happens in both LLE and HLE mode when not using Original N64 Res option. Render 2D does nothing to it.
Edit Also Killer Instinct still has alignment issues in LLE and HLE mode even using Original N64 Res.
@Kidboy17 MarioKart and Killer Instinct do not use S2DEX. I know, that there are plenty of various 2D issues. This task is to find issues in HLE implementation of S2DEX ucode and only such issues. If the same issue reproduced in LLE mode, it need not be reported here. We need to know only about HLE issues.
List of games, which use S2DEX ucode (thanks to theboy181):
Resident Evil 2 glitchy backgrounds seem to be improved. Problem seen here https://github.com/gonetz/GLideN64/issues/1869 The hallway background renders correctly, and options menu only has some faint vertical lines on the text instead of heavily glitched lines. I'd post screenshots but Github isn't allowing it right now for some reason.
Resident Evil 2 glitchy backgrounds seem to be improved.
This is strange. New background code is currently incompatible with RE2, thus old code is used. So, if something is improved in this game, it is because of some general fixes in texturing, which I've done in that branch.
a new bug here (must be very recent)
It looks like there are also alignment issues in the mini map
The last 0 on the speedometer also looks like there is an extra column of black pixels on the right. (Just before the k in km)
Regression in GT 64 speedometer is fixed with f0b9f02e0. Mini map looks a bit different in HLE and LLE.
1080 has a regression with the background using this WIP Not sure why its not an SDEX title.
I made several corrections in general texturing code, so any game can be affected. I'll check, may be this regression caused by these corrections.
Indiana Jones first level sky is looking strange.
Same issue in 1080 Snowboarding.
I think and I can’t double check right now that there is 2d regressions in Mario Golf again too.
After upgrading to ubuntu 18.04 and getting everything running again i had some time to test s2dex_fixes branch. Everything looks fine. I experience significant slowdown in Bakuretsu Muteki Bangaioh compared to an old branch from november 18.
So none of the bugs reported ? @gizmo98
@theboy181 Ok. I just tested s2dex games. I will check the posted issues.
I reverted commit, which causes issues reported by theboy181 and OtavioRaposo. Thanks for help! Link on updated build is in WIP builds 3
The Neon Genesis commit that was just reverted seemed to solve several problems in Majora's Mask. This glitched ground seam in north clock town was fixed by the initial S2DEX merge and is now broken again in the new WIP build:
Also, before the S2DEX merge objects that combined a larger grayscale texture with a smaller color texture had required that the new custom color texture be offset from the grayscale one by a few pixels diagonally to align correctly, otherwise this blurred/ doubled effect would be created:
After the S2DEX merge this offsetting was no longer necessary and the new HD color and grayscale textures aligned perfectly right from the start. This seems like the correct behavior, since it's also how the same custom textures load in Dolphin. The new build once again requires the textures to be offset.
One last thing is that some custom textures aren't loading consistently after the S2DEX merge, and this is true in the latest WIP build as well. The skybox textures flicker on and off suddenly; the entire skybox is dumping new textures with different filenames, but the old textures still seem to load intermittently. Here's a brief video of the problem: https://youtu.be/PJ5gT6binCA
@Nerrel It's a bad news :( Everything related to N64 texturing emulation is so complex and fragile. My current goal is to fix all regressions and make new release. Than I'm going to rewrite GLideN64 texturing to make it more friendly to HD textures.
Right, I don't expect custom texture fixes until that rewrite, but the mapping/positioning of many of the default textures was also improved by that commit. The ground seam in that first photo also occurs with the original textures, for instance. I just wanted to make a note of that build's fixes in case it wasn't known that it improved Zelda as well.
Will the texture rewrite change the way the way the default textures are handled as well as custom textures?
for instance. I just wanted to make a note of that build's fixes in case it wasn't known that it improved Zelda as well.
I did not notice that, thanks
Will the texture rewrite change the way the way the default textures are handled as well as custom textures?
Yes. As I understand, the main source of issues with HD textures is the way plugin handles texture wrapping and mirroring. In some cases, plugin does software texture mirroring for tiles loaded from TMEM. Texture loading is full of legacy code, I'm not sure why it was made this way. May be it is a heritage of dark times, when npot textures were not supported by mainstream hardware. I'm going to revise these parts of code.
@IceLancerSR I'll check, what is wrong with txPath. Please open new task for it. This one is about S2DEX fixes, so I may just forget about your request as it has no separate open task for it.
can it be closed?
I think it can
Current HLE implementation for backgrounds commands is too high level. Actual commands are very complex. The microcode is documented, but the documentation does not cover some tiny details in internal mechanics. Thus, existing implementation does not always work right. olivieryuyu decided to not rely on documentation and decode the microcode itself. The goal of that new decoding project was to implement commands in HLE as close as possible to LLE and obtain the result, which is as good as with LLE or better.
It was very long and hard project, which took circa six months. It is not finished yet, but we are close. Both background commands implemented and they produce exactly the same result as in LLE mode on all games we tested.
You may run current versions of the plugin in LLE mode and find numerous graphics glitches in 2D games. Some of glitches caused by errors in texture loading code. Backgrounds commands do texture loading in quite weird manner, which "normal" game code never uses. I fixed several hard issues in plugin's texturing subsystem during development of that project. However, many glitches remained after these fixes. These glitches can be called "the curse of hardware rendering". There are two main groups of such glitches:
gaps between polygons. Background commands can not draw background by one piece because of limited texture memory. Background image becomes split on narrow strips. Each strip is loaded in texture memory and rendered by separate rectangle. There are no gaps between rectangles, but gaps between images in them may appear when rendering resolution is higher than game's native resolution. It usually happens when size of the image is not exactly the same as size of area where it will be rendered. Texture scaling in higher resolution may cause fetching texels out of texture image bounds, thus cause artifacts, which look as gaps between polygons.
garbage between polygons. Looks like a line of colored garbage between two polygons. Is is seldom kind of glitches, but it does not fixed by switching to native resolution. I did not find yet, how it can be cured.
So, new implementation has issues, but most of them appears only in non-native resolutions. GLideN64 already has tool to eliminate issues with 2D graphics in high resolutions. You may enable "Render 2D elements in native resolution" option to activate it. I adopted that tool to work with new background commands. StarCraft backgrounds have glitches in high-res, but "Render 2D elements in native resolution" eliminates them. However, the tool is not bug-free by itself and in some games its use may cause disappearance of part of graphics. Besides, sometimes it is slow.
As you may guess from my explanations above, it is in rather alpha state. We tested it a lot, but with only two of us we could miss some regressions. Please test and leave bug reports. Sources reside in s2dex_fixes branch. I suggest to start with "Render 2D elements in native resolution" disabled and enable it only when you see aforementioned glitches. If use of "Render 2D elements in native resolution" causes new glitches, please report about it. Also, if you see glitches, please switch to LLE mode and compare. It is important for us to know about cases where LLE is still better.