Nintendo 64 RGB Blur fixing

The place for all discussion on gaming hardware
User avatar
Kez
Posts: 820
Joined: Thu Jul 20, 2017 7:09 am

Re: Nintendo 64 RGB Blur fixing

Post by Kez »

Josh128 wrote: Tue Mar 26, 2024 11:15 pm Maybe a silly question, but can adjusting the horizontal sampling on the RT5X perform the same 640 to 320 deblur that is being done with the Ultra HDMI? Certainly seems like it should be able to??
Yeah totally, if you sample 320 pixels and get the sampling phase correct (i.e. within the first pixel of each pair) then it's effectively the same.
User avatar
Josh128
Posts: 2145
Joined: Thu Jan 16, 2014 9:01 am

Re: Nintendo 64 RGB Blur fixing

Post by Josh128 »

Cool. I wasnt sure if it would work being that the already filtered output of the N64 was being sent to the 5X. I assume the Ultra HDMI does it on the digital signal before it hits the DAC, which would be different.
RebeL9
Posts: 178
Joined: Mon Jan 02, 2012 9:38 am

Re: Nintendo 64 RGB Blur fixing

Post by RebeL9 »

bobrocks95 wrote: Tue Mar 26, 2024 7:30 pm
Josh128 wrote: Tue Mar 26, 2024 6:37 pm So with Wonder Project J2, it has these dithering issues by default and you are trying to turn on the filters to patch them out? Does U64aap allow you to change anything for that game? IIRC, someone posted on Reddit a long while back that the dithering on the cars bothered them, and they were able to patch the rom to turn on the dithering filter and it worked for them. If you havent yet tried it, maybe it would work for this one?
It uses the "noise" style dithering seen here: https://mattpierce.info/n64-dither

The de-dither filter appears to be on by default for this game, it looks even worse with it off. No emulator options in Mupen or Ares have been able to remove it- I've seen video from one MiSTer user that seemingly showed it disappearing with a setting, but then another much more thorough video from someone in the MiSTer discord kindly stepping through all the options for me showed that nothing cleared it up. Tried various U64aap options and nothing got rid of it.

It looks hideous and I'm debating between putting up a $100 bounty to patch it out or trying to learn how to do it myself. Again according to the MiSTer N64 core dev himself, the game's draw calls themselves are asking for this noise dither and would need to be patched.
Can you please take a photo of that noise in Wonder Project J2 and post here?
User avatar
bobrocks95
Posts: 3471
Joined: Mon Apr 30, 2012 2:27 am
Location: Kentucky

Re: Nintendo 64 RGB Blur fixing

Post by bobrocks95 »

RebeL9 wrote: Wed Mar 27, 2024 3:57 pm
bobrocks95 wrote: Tue Mar 26, 2024 7:30 pm
Josh128 wrote: Tue Mar 26, 2024 6:37 pm So with Wonder Project J2, it has these dithering issues by default and you are trying to turn on the filters to patch them out? Does U64aap allow you to change anything for that game? IIRC, someone posted on Reddit a long while back that the dithering on the cars bothered them, and they were able to patch the rom to turn on the dithering filter and it worked for them. If you havent yet tried it, maybe it would work for this one?
It uses the "noise" style dithering seen here: https://mattpierce.info/n64-dither

The de-dither filter appears to be on by default for this game, it looks even worse with it off. No emulator options in Mupen or Ares have been able to remove it- I've seen video from one MiSTer user that seemingly showed it disappearing with a setting, but then another much more thorough video from someone in the MiSTer discord kindly stepping through all the options for me showed that nothing cleared it up. Tried various U64aap options and nothing got rid of it.

It looks hideous and I'm debating between putting up a $100 bounty to patch it out or trying to learn how to do it myself. Again according to the MiSTer N64 core dev himself, the game's draw calls themselves are asking for this noise dither and would need to be patched.
Can you please take a photo of that noise in Wonder Project J2 and post here?
Here's the video from the person on the MiSTer discord if you're curious: https://drive.google.com/file/d/1CTAzBK ... sp=sharing
PS1 Disc-Based Game ID BIOS patch for MemCard Pro and SD2PSX automatic VMC switching.
User avatar
Josh128
Posts: 2145
Joined: Thu Jan 16, 2014 9:01 am

Re: Nintendo 64 RGB Blur fixing

Post by Josh128 »

lol I was going to say I could try it for you , but thats pretty comprehensive. Honestly, that "noise" type dithering is similar to what Starfox 64 uses, but I think it can be turned off on SF. It really doesnt look too bad here Bob. Are you playing on a CRT?

Also, Bob, do you know how to use Gameshark codes to turn off just VI gamma dither and VI Divot? Ive found disabling those two with Saturnus patcher is the optimum solution for all N64 games on CRT for my taste. Turn just those off and leave AA on and it looks so much better and you still have smooth edges from AA. But none of the Gameshark codes do it and Im struggling to understand how to do it with the GS codes.

Say you use 8XXXXXXX 0000 to turn off the dither filter
8XXXXXXX 0000

and 8XXXXXXX 0032
8XXXXXXX 0032 to turn off AA

for a particular game. What code would turn off the VI Divot? Ive seen the assembler games thread, and I believe either 0000 or 0032 must change, but my brain is not understanding which one and which number to change.
User avatar
vol.2
Posts: 2475
Joined: Mon Oct 31, 2016 3:13 pm
Location: bmore

Re: Nintendo 64 RGB Blur fixing

Post by vol.2 »

I actually thought it looked pretty good when the bilinear filtering was switched off.
User avatar
Josh128
Posts: 2145
Joined: Thu Jan 16, 2014 9:01 am

Re: Nintendo 64 RGB Blur fixing

Post by Josh128 »

It does on CRT, but thats not possible on real hardware via patches or GS codes, just mods like Ultra HDMI. Side note about KI Gold -- I always thought the character sprites looked soft and washed out vs the arcade. Turns out yet again, its due to the texture filter ("tri-linear mip-map interpolation) being applied not only to the backgrounds (good) but to the character sprites as well (terrible). On the MiSTer, when you turn that off, the characters look every bit as sharp and colorful as the arcade, but the backgrounds look like crap. Its like Nintendo and the developers tried their best to make the N64 look as shitty as they could, when a few minor tweaks or even options to turn certain filters on and off would have made a world of difference. The hardware was certainly capable of razor sharp and clear graphics.
RebeL9
Posts: 178
Joined: Mon Jan 02, 2012 9:38 am

Re: Nintendo 64 RGB Blur fixing

Post by RebeL9 »

Josh128 wrote: Tue Mar 26, 2024 5:33 pm ** Disclaimer**-- my opinions on this are based on outputting a real N64 to a 36" trinitron via RGB with the old school RGB amp method.

Ive been playing around with the MiSTer and its awesome N64 core in the past couple weeks, and found some rather interesting stuff that led down yet another interesting rabbit hole. The MiSTer, like the emulator ParaLLEl N64, emulates the N64 RCP at a low level, and enables you to set certain VI (video interface) registers. Whilst playing around on my 1440p monitor with the MiSTer, I tried different settings, but came across two that really make the N64 "pop". VI Dither, and VI Divot. Turning off dither removes a vaseline like color filter that hides dithering present in 16 bit color mode games. VI Divot does something really unique to some textures, such as the windows on the castle, the trunks of the puffy trees, and fences and bannisters in SM64---it removes some sort of specific blur filter on such objects but leaves untouched everything else. It makes them more easily visible at a distance, yet does not make them appear pixelated.

The VI Antialias, which infamously and unfairly takes most of the blame for many N64 games blurry look, actually doesnt do anything at all to add blur to textures or bitmaps, all it does is smooth line edges and intersections, and I have found that it most definitely needs to stay On/ at default for games that use AA (most of them). On games that dont use AA, toggling it makes no difference and will not apply AA to a non AA game. Anyways, enough about N64 on MiSTer.


On a real N64 and games, many of the same options available in the MiSTer core can be either enabled via game shark or pre-patched into the game ROMs. Below is a great page on ways to do this. Ive found that the U64aap044.zip program set that Saturnu created is superior to the set of .ips/.aps patches by Porregon because the U64AAP044 program allows you to individually toggle dither or divot on or off apart from turning off the AA. This is significant because when you turn off the AA via the known methods, it doesnt just turn off AA, it turns off the dither filter and the divot filter as well.

Ive found that just turning off the dither filter is the single best sharpening mod, as it seems to lift a veil of vaseline-like smear from all the textures of 3D rendered objects. It sharpens them quite visibly. The downside to this is that on darker scenery especially (Castlevania is a prime example), the dithering is very visible and can be distracting. Personally though, for me, even heavily dithered scenes are worth the tradeoff for the blur removal. Interestingly enough, even on pure 2D games like Rampage: World Tour, turning this dither filter off really sharpens the image, making it look more crisp and with better contrast between colors, equaling or bettering the PS1 2D output, which Ive always found noticeably sharper than N64.

Second is the Divot filter. As mentioned above, it only works on seemingly 2D objects working in a 3D space, but turning it off removes a level of blur from them and looks superior in all cases that Ive seen, with no downsides that I know of.

Last is AA. Using the .ips patches and possibly Gameshark codes (not sure if you can piecemeal those) to turn off AA is misleading, because they also turn off the dither and divot filters-- the two most responsible for cleaning up the image. Those aside, turning off the AA itself is not good. Line and polygon edges become remarkably rough and jagged, and Ive not found a single game that I prefer to turn AA off vs just turning off the divot and dither filters. From all the methods Ive seen, turning off AA also turns off divot and dither, and theres no way to just turn off AA by itself-- except on the MiSTer.

Oh and also, the horizontal 640/320 blur is not possible as of yet to turn off with any of these registers, but when gaming on a very sharp 36" Trinitron I really couldnt see the difference when I tried it on an N64 RGB a few years ago, try that I did. It is possible with the MiSTer though.

In any case, if you havent dont it yet, give U64aap044.zip a try and experiment with just dither and divot filters without touching AA. The difference from those alone is very impressive to me. Some games, like SoTE, Blast Corps, and KI Gold dont work with it and I havent seen Gameshark codes for them yet, (Well I did see one for SoTE PAL version, but havent tried it) so Im guessing no one was able to find the VI register addresses for those for some reason. I have half a mind to try myself but dont know if I ever will.




https://consolemods.org/wiki/N64:N64blur
Thanks for the tips about removing divot. That one really does a difference!
User avatar
Syntax
Posts: 1776
Joined: Wed Aug 09, 2017 12:10 am
Location: Australia

Re: Nintendo 64 RGB Blur fixing

Post by Syntax »

You can choose to attack any number of filter combos, check out the test pack on porygons old site the combo list is a page long!
But it make little difference.
Tools are available to patch roms however you please.
And I've made a more recent set of AA patches, from memory they only turn off 2 things.
viewtopic.php?p=1545287#p1545287
User avatar
Josh128
Posts: 2145
Joined: Thu Jan 16, 2014 9:01 am

Re: Nintendo 64 RGB Blur fixing

Post by Josh128 »

Thanks for the link, Its nice to have everything in one place but it doesnt help with what Im trying to do/understand. All of these freely available.ips patches and GS codes only affect the (de)dither filter and/or the AA. The only way Ive been able to turn off only the VI Divot and the VI Dither is with Saturnu's u64aap tool, but unfortunately, it doesnt work with 3 of the games I want to use it on ( SOTE, Blast Corps)

Blast Corps however, does have GS codes available, that Ive been tinkering with:

80306D2D 0000 - dither off
80306D5D 0000 - dither off
80306D2E 0032 - AA off
80306D5E 0032 - AA off

This is all great, and Im thankful to whoever got these, but what I want to do is turn VI divot off , and leave AA on. Being that these two addresses have been found, is it just a matter of setting the value of a pre or proceding address (80306D2C, 80306D2F ?), or just change the 0000 and 0032 values? If just that, what to set it to -- Im still unclear of why the dither register addresses use 0000 or 0001 to change value while the AA addresses use 003[0,1,2,3] to change its value, but I at least know thats how you toggle those two functions.

There is a post on one of the last pages of the Assembler games thread that seems to describe what I want to do, but the XXXX codes given in the OOT example dont seem to jive with the ones from Blast Corps, and in my ignorance I dont understand why, so I dont know how to turn DIVOT off using it.
00000003 color source for framebuffer(s)
00000004 gamma divot enabled
00000008 gamma enabled
00000010 divot enabled
00000040 serrate
00000300 antialiasing mode
0: antialias and resample, always fetching extra lines
1: antialias and resample, fetching lines as needed
2: resample
3: replicate pixels without interpolation
The OOT 1.0 code has the following modes:

1) Dithering Filter off
2) 16-bit pixel size
3) Gamma Dither Enabled
4) DIVOT enabled
5) Aliasing off, just Resamp

The OOT 1.1 code has the following modes:

1) Dithering Filter off
2) 16-bit pixel size
3) Gamma dither disabled
4) DIVOT disabled
5) Aliasing off, just resamp

Generally I have seen that only aliasing and dithering are usually altered and nothing else, so I do not really understand the rationale behind the two different codes (they both carry the same original search values and addresses).

However,

Personally I have not tested this enough on my end. You never know, maybe removing Gamma Dither where applicable could have a positive effect. DIVOT not so much because I think it only has an effect when there is aliasing in place.

As I understand, Gamma Dither can add noise to pixels so it may be worth a shot to test with and without.

If you would like to test it yourself, just modify your existing codes as follows (to remove Gamma Dither):

(example address assuming top is 0000 and bottom is 2nd half):
8104535C XXXX
8104535E XAZY

Leave X as is, change Y to 2 as shown (i.e, if you see 6, replace it with 2).

Additionally, If you want to remove DIVOT, wherever you see Z, change it to 0 as shown (otherwise keep it as is).

For A in the example above, I have added this because there is another aliasing mode called No Resampling or Aliasing. Normally this is set to 2 as you've seen in many codes to just make it resampling but according to earlier posts, setting this to 3 (which is no aa/resamp) could have an even greater effect on the visuals.

But from my experience, I have had no luck. Mario 64 and Zelda for me just show 3 vertical viewports that are a quarter wide each. Someone said it works for Conkers, Banjo and Perfect dark so it could just be select games possibly.

Also,

Some codes end with E at the end and they have yet another mode called Gamma which is enabled. If you see this and would like to remove Gamma Dither, do not set Y to 2. Set it to A to keep Gamma on but disable Gamma Dither.

But again, Gamma is also something worth additionally testing on/off as well. Ultimately if you want Resampling with no filters, just using 3202 is fine (or 3203 if a game uses 32-bit pixel size but I don't know which ones do that).
User avatar
Josh128
Posts: 2145
Joined: Thu Jan 16, 2014 9:01 am

Re: Nintendo 64 RGB Blur fixing

Post by Josh128 »

Ahh!!! Ive figured it out, even though I dont really understand it still. The only way I found to do it is to mix 8 bit and 16 bit GS codes, using the info from the second to last page on the Assembler forum.

For Blast Corps US:

8 bit writes:

80306D2D 0000 < disable dither filter (XXX1 to enable)
80306D5D 0000 < disable dither filter (XXX1 to enable)

16 bit writes:

81306D2D 3006 < disable divot filter (XX1X to enable)
81306D5D 3006 < disable divot filter (XX1X to enable)

If you want to disable AA in addition to the above, ( which I personally dont like as much as it gives you sawtooth edges, but is the absolute sharpest you can get), use:

3206 instead of 3006

But in all seriousness, disabling the DIVOT filter makes a huge difference in being able to see small textures when far away-- they remain clear and crisp, while they blur to oblivion if you leave it on. Excellent!!
User avatar
Josh128
Posts: 2145
Joined: Thu Jan 16, 2014 9:01 am

Re: Nintendo 64 RGB Blur fixing

Post by Josh128 »

Happy Easter everyone!

For Shadows of the Empire v 1.2

Turn off dither, divot, keep on AA. FAR superior to default. Keep AA on, its superior to off. This combo clears up textures and even 2D cut graphics and cut scenes significantly, and Im playing on a 36" FD Trinitron. This is the way for most N64 games. Shameful that Nintendo purposely forced devs to use the vaseline filter on most games.

810E85DC 0000 - dither filter off

810E85DE 3006 - divot filter off

810E860C 0000 - dither dither filter off

810E860E 3006 - divot filter off
RebeL9
Posts: 178
Joined: Mon Jan 02, 2012 9:38 am

Re: Nintendo 64 RGB Blur fixing

Post by RebeL9 »

Josh128 wrote: Sun Mar 31, 2024 7:52 pm Happy Easter everyone!

For Shadows of the Empire v 1.2

Turn off dither, divot, keep on AA. FAR superior to default. Keep AA on, its superior to off. This combo clears up textures and even 2D cut graphics and cut scenes significantly, and Im playing on a 36" FD Trinitron. This is the way for most N64 games. Shameful that Nintendo purposely forced devs to use the vaseline filter on most games.

810E85DC 0000 - dither filter off

810E85DE 3006 - divot filter off

810E860C 0000 - dither dither filter off

810E860E 3006 - divot filter off

How do you add these codes? Can it be done on Mister?
User avatar
Josh128
Posts: 2145
Joined: Thu Jan 16, 2014 9:01 am

Re: Nintendo 64 RGB Blur fixing

Post by Josh128 »

Im using them with an N64 Everdrive V1. Just select the game you want, hit Z to bring up the menu, select cheats, then put in the codes you want. Hit B to exit the cheats menu, then start the game you selected.

On MiSTer you dont need them, just turn off dither and divot in the video menu once you have a game loaded. Speaking of MiSTer, the characters in KI Gold look 1000% better when you turn off "Texture Filter". Just as sharp as the RGB arcade. Amazing blunder by the developers, they could have just filtered the background textures (necessary), but turn the filter off for the sprites. Unbelievable. Too bad this is not fixable via codes or MiSTer.
RebeL9
Posts: 178
Joined: Mon Jan 02, 2012 9:38 am

Re: Nintendo 64 RGB Blur fixing

Post by RebeL9 »

Josh128 wrote: Sun Mar 31, 2024 9:03 pm Im using them with an N64 Everdrive V1. Just select the game you want, hit Z to bring up the menu, select cheats, then put in the codes you want. Hit B to exit the cheats menu, then start the game you selected.

On MiSTer you dont need them, just turn off dither and divot in the video menu once you have a game loaded. Speaking of MiSTer, the characters in KI Gold look 1000% better when you turn off "Texture Filter". Just as sharp as the RGB arcade. Amazing blunder by the developers, they could have just filtered the background textures (necessary), but turn the filter off for the sprites. Unbelievable. Too bad this is not fixable via codes or MiSTer.

I dunno. KI gold looked quite blocky pixelated with texture filter off on my CRT?
What other games improves on tweaking the graphic settings would you say?
User avatar
Josh128
Posts: 2145
Joined: Thu Jan 16, 2014 9:01 am

Re: Nintendo 64 RGB Blur fixing

Post by Josh128 »

RebeL9 wrote: Mon Apr 01, 2024 10:27 am
Josh128 wrote: Sun Mar 31, 2024 9:03 pm Im using them with an N64 Everdrive V1. Just select the game you want, hit Z to bring up the menu, select cheats, then put in the codes you want. Hit B to exit the cheats menu, then start the game you selected.

On MiSTer you dont need them, just turn off dither and divot in the video menu once you have a game loaded. Speaking of MiSTer, the characters in KI Gold look 1000% better when you turn off "Texture Filter". Just as sharp as the RGB arcade. Amazing blunder by the developers, they could have just filtered the background textures (necessary), but turn the filter off for the sprites. Unbelievable. Too bad this is not fixable via codes or MiSTer.

I dunno. KI gold looked quite blocky pixelated with texture filter off on my CRT?
What other games improves on tweaking the graphic settings would you say?
Yes, the backgrounds definitely need it. The characters dont, and look much better with it off. Thats why I said the programmers could have applied it only on the polygons and not on the characters.
User avatar
Josh128
Posts: 2145
Joined: Thu Jan 16, 2014 9:01 am

Re: Nintendo 64 RGB Blur fixing

Post by Josh128 »

Below is an awesome example of what turning off the DIVOT filter does. Pay close attention to the windows/shutters and the detail on the fence. Default Divot filter both distorts and blurs detail of the textures. Its easy to see in the pictures and its even more striking in person. Another game Ive seen it make significant difference is in Blast Corps -- fine detail on vehicles (the train is a good example), fences, bit maps / textures like windmills, etc. all look sigificantly improved with the divot filter off. Which is nuts when you consider its less significant than turning the de-dither filter off. Both together clean up the signature vaseline smear quite significantly -- no need to turn AA off.


Image

https://imgur.com/a/LNnW0oR
Last edited by Josh128 on Mon Apr 01, 2024 4:52 pm, edited 1 time in total.
RebeL9
Posts: 178
Joined: Mon Jan 02, 2012 9:38 am

Re: Nintendo 64 RGB Blur fixing

Post by RebeL9 »

Yeah and as you mentioned earlier. It's very obvious on Peache's windows in Mario 64.
User avatar
vol.2
Posts: 2475
Joined: Mon Oct 31, 2016 3:13 pm
Location: bmore

Re: Nintendo 64 RGB Blur fixing

Post by vol.2 »

Josh128 wrote: Mon Apr 01, 2024 1:25 pm Pay close attention to the windows/shutters and the detail on the fence.
Wow. Especially the fence is such a huge difference. The detail is totally lost.
User avatar
Josh128
Posts: 2145
Joined: Thu Jan 16, 2014 9:01 am

Re: Nintendo 64 RGB Blur fixing

Post by Josh128 »

Made a very interesting discovery yesterday in tinkering around with Castlevania: Legacy of Darkness on the real N64. The game is expansion pak enhanced, so it allows you to select high or low res at the start of the game. High res 480i obviously looks quite nice, but the frame rate absolutely tanks. Whereas the vanilla game at low res can push 30 fps in most scenes and areas, with some obvious dips fairly often, the high res mode has trouble reaching 30 fps almost anywhere.

This is obvious from the outset as the scene in the beginning where the camera is behind / chasing character running through the forest runs at pretty much 30 fps in low res mode, but appears to be in the 10 to 12 fps range in high res mode. In playing around in high res mode, it appeared to me that edges are still antialiased, which is strange considering most other high res mode games turn AA off. I confirmed this by patching the ROM using Saturnus U64aap.exe and turning off AA. Booting the game back up, edge AA is clearly no longer happening anymore. In the opening scenes, the frame rate still tanks quite a bit, which, at a quick glance, seems mostly identical to having it on. However, I noticed that once in game, on the ship, that the frame rate was significantly smoother / hit 30fps much more often after turning AA off. I did a few back and forth comparisons, and its UNQUESTIONABLY smoother.

This is odd to me as no other game Ive turned off AA appeared to make even a bit of difference performance-wise, I actually looked for it, and I have a pretty keen eye for these things. The difference here is, this is the only one Ive noticed that still uses AA in high res mode (need to re-check others), and so its the only one Ive turned AA off in high res mode. Extremely cool and free performance boost-- its still not as smooth as low res mode, but it makes a basically non-playable (IMO) high res mode playable again!

In the other blur reduction areas, Ive found turning off dither and divot filters work great for this game, and in at least the first level, dithering is almost unnoticeable-- unlike the first level of CV64, which has quite harsh dithering. In fact, for this game, even in low res mode, I find turning off all filters AND AA to be quite acceptable--and its possible that turning off AA gives a performance boost in low res as well (havent tested it). I think the darker nature of the game makes the harder edges of no AA less noticeable than in bright colorful games like SM64.

Now Im curious to see if I can get a high res perf boost in other titles such as the Turoks, Factor 5 games, and others. Very neat stuff.
Post Reply