Closed westonlast closed 8 years ago
You cannot technically get "square" pixels on Wii, what you want is (inaccurate) integer upscaling of internal rendered screen instead of more precise upscaling adjusted to accurately match original console output.
That's said, you can already modify the scaling manually in emulator video settings, just set aspect ratio option to "manual" then reduce xscale value until you feel it's "crispy" enough for you.
But honestly, original aspect ratio upscaling shouldn't make pixels much less "crispy" since it is implemented so that the filtering being applied by the Wii video hardware is very soft (assuming you have bilinear filter and trap filter options disabled off course).
Pretty please? ;)
The Wii outputs as square-type pixels as anything. I think you're referring to the fact that the Wii outputs 720x480 (or 240p, etc), but the internal framebuffer is limited to 640x480. If the VI width is set to 640, the internal framebuffer will be unaltered in the external framebuffer, so there will be (720 - 640) / 2 = 40 black pixels on the left and right sides. The TV is the thing that un-squares the pixels if the TV is configured to stretch or compress. But the TV is irrelevant; I want Genesis Plus GX to have an option to output square pixels (the unmodified Genesis framebuffer (x 2 for 480p).
The emulator already sets the VI width to 640 when the Wii is in Widescreen mode, right? So as far as I can tell, the only remaining issue is the "yscale." I tried playing around with the Y Scale setting today. By my calculations, to "undo" the default aspect-correction "yscale" of Genesis Plus GX requires a value of -(480 - (224 * 2) / 2) = -16 (assuming the game is using video mode 320x224; unfortunately games can change this dynamically). Unfortunately this doesn't seem to produce an artifact-free image. I tried many values from -5 to -25; nothing looked good except 0.
Will you please explain what you mean by "it is implemented so that the filtering being applied by the Wii video hardware is very soft?" I have a feeling the magic behind Genesis Plus GX's magical (and very good looking, I might add) aspect ratio correction is the answer.
Pretty please? ;)
The Wii outputs as square-type pixels as anything. I think you're referring to the fact that the Wii outputs 720x480 (or 240p, etc), but the internal framebuffer is limited to 640x480.
No, Industry square pixels would require a pixel clock of 12,27 Mhz for 640x480i and those are generally seen on PC monitors only. See this chart listing various pixel clock /pixel aspect ratio if you really are interested: https://pineight.com/mw/index.php?title=Dot_clock_rates
Wii and Gamecube use a 13,5 MHz pixel clock which is NTSC standard for 640x480i but definitively does NOT output 1:1 "square" pixels.
Interestingly, 13,5 Mhz is just a little more than twice Genesis dot clock in 320 px mode (6,71 Mhz), hence why internal rendered screen width is upscaled by a factor 2 then slightly adjusted to accurately match real hardware output aspect ratio
If the VI width is set to 640, the internal framebuffer will be unaltered in the external framebuffer, so there will be (720 - 640) / 2 = 40 black pixels on the left and right sides.
Upscaling VI width (and the size of black borders on left/right sides) is applied directly on the generated video signal by video encoder, external framebuffer(xfb) is always the same width as GPU internal framebuffer (efb).
The TV is the thing that un-squares the pixels if the TV is configured to stretch or compress.
No, that's a common mistake but that's not how analog video works, TV does not stretch or compress anything unless you manually modify its factory settings. The duration of a line being output, and so its width, is fixed (with more or less variation tolerated from standard) so what determines the "width" of pixels is the number of distinct samples (pixels horizontal resolution) being rendered per line by display processor (VDP, PPU, GPU, ...) and the time between each of these samples (dot clock).
But the TV is irrelevant; I want Genesis Plus GX to have an option to output square pixels (the unmodified Genesis framebuffer (x 2 for 480p).
Yes, that's what I understood but like I said, 640x480 does not produce technically square pixels. What you want is reducing filtering artefacts by simply doubling the original screen rendered internally by the emulator (which is usually 320x224 without borders but can also be 256x224 depending on games) to 640x448 or 512x448 instead of 652 (or quite, can't remember exact value) x 448 as it is done actually with original aspect ratio.
And it would be x2 horizontally in either modes (original, interlaced or progressive), x2 vertically in both interlaced and progressive mode and x1 vertically in original (non-interlaced) mode.
The emulator already sets the VI width to 640 when the Wii is in Widescreen mode, right?
No, it downscales it by a 4:3 ratio to keep original aspect ratio by compensating the stretching done by TV in 16:9 mode. This is only if you select original with 16:9 correction for aspect ratio option that said.
So as far as I can tell, the only remaining issue is the "yscale." I tried playing around with the Y Scale setting today. By my calculations, to "undo" the default aspect-correction "yscale" of Genesis Plus GX requires a value of -(480 - (224 * 2) / 2) = -16 (assuming the game is using video mode 320x224; unfortunately games can change this dynamically). Unfortunately this doesn't seem to produce an artifact-free image. I tried many values from -5 to -25; nothing looked good except 0.
I never said to touch yscale value, vertical height is already set by default to either 224 (240 with top/bottom borders emulated) in original non-interlaced mode or 448 (480 with top/bottom borders emulated) in interlaced or progressive modes so altering the default value by setting yscale to anything but 0 will definitively produce scaling artefacts and is incorrect/useless.
What I said was to reduce the XScale value. By adjusting it, you can obtain a VI width of 640 as you want. I will let you find the correct value since apparently you can tell it's crisper when set to 640x448 ;-)
If you don't find any difference, it simply means that like I said, pixels are already as "crisp" as they can be, no matter what VI width is. It's only less crisp if you enabled gx bilinear filter and, to some less extent, gx trap filter, so you should have these disabled.
Will you please explain what you mean by "it is implemented so that the filtering being applied by the Wii video hardware is very soft?" I have a feeling the magic behind Genesis Plus GX's magical (and very good looking, I might add) aspect ratio correction is the answer.
It's simply using GPU (GX) to double the width (320->640 or 256->512) so no filtering needs to be applied by GPU (and pixels remain "crisp" as original, just doubled) then VI width is adjusted to match original aspect ratio so that non-integer upscaling is applied by the video encoder instead, which uses a more efficient and much less destructive filter.
Thanks for the response. I sense some confrontation in your tone. If that's in response to anything I said, I didn't intend my tone to be confrontational. I'm guessing you'll say that you weren't being confrontational, either. :P Genesis Plus GX is awesome, blah blah blah.
I'm sorry for confusing the issue. Here's the key piece of missing information: I'm using the vWii on the Wii U. That changes things, because we're exclusively talking in the digital domain, right?
What you're saying about pixel clocks and analog signals makes sense, but that doesn't apply when using HDMI. Logically, any digital computer outputs square pixels until DAC happens, and then the pixels are physically non-square, but logically still square. Am I correct so far?
Even will a true, analog Wii, I'd still like the unscaled framebuffer. Why? Just another cool "enhancement" option of using an emulator.
Me:
...the unmodified Genesis framebuffer (x 2 for 480p)
You:
Progressive mode makes no difference horizontally by the way, not sure why you would think it does...
I don't think it does; I never said that. :) I meant Genesis resolution x 2 for Wii output. I'm sorry that I said this oddly. I was trying to repeat myself to be clear about my request, but my over-explained-ness backfired.
No, it downscales it by a 4:3 ratio to keep original aspect ratio even. This is if you select original with 16:9 correction for aspect ratio option that's said.
If I keep the Genesis Plus GX setting at "Original: 4:3," The VI width is set to 640, though, right? So I wouldn't need to adjust VI width in this case?
I will let you find the correct value since apparently you can tell when it's crisp and when it's not ;-)
Now that you know I'm using digital video, I don't look as stupid, I hope?
VI width is adjusted to match original aspect ratio so that non-integer upscaling is applied by the video encoder instead
You mean non-integer upscaling in the analog domain for a real Wii?
Thanks for the response. I sense some confrontation in your tone. If that's a in response to anything I said, I didn't intend my tone to be confrontational. I'm guessing you'll say that you weren't being confrontational, either. :P Genesis Plus GX is awesome, blah blah blah.
Don't take it personally, it's just that I have already discussed these things so many times and people keep making wrong assumptions or thinking they know better ;-)
I'm sorry for confusing the issue. Here's the key piece of missing information: I'm using the vWii on the Wii U. That changes things, because we're exclusively talking in the digital domain, right?
What you're saying about pixel clocks and analog signals makes sense, but that doesn't apply when using HDMI. Logically, any computer outputs square pixels until DAC happens, and then the pixels are physically non-square, but logically still square. Am I correct so far?
Shape of pixels only refers to what appears on screen (what you call physically I guess), it makes no sense speaking of pixel aspect ratio inside computer, those are just logical values made of 0's and 1's, they have no shape.
And just because HDMI is a digital video signal does not mean it automatically produces square pixels, it depends of the resolution. SD video resolutions over HDMI will keep their original pixel aspect ratio, the Wii games would look way too much stretched on WiiU compared to original otherwise.
Even will a true, analog Wii, I'd still like the unscaled framebuffer. Why? Just another cool "enhancement" option of using an emulator.
And as I said earlier, it's already possible, just set aspect ratio to "manual" in video settings and find the correct xscale value.
Ok, I will even give you the answer: by default with xscale=0, Framebuffer and VI width are both set to 640 which is exactly what you want to achieve (well, not for games using 256 px mode but you can still reduce xscale to get an output width of 512 pixels for those games if you somehow can stand the inaccurate squished screen it will produce).
Note that this is with left/right border emulation being disabled, orherwise emulator rendered screen width is 284/348 pixels instead of 256/320 so default XFB/VI width is adjusted to keep proper aspect ratio / scaling.
If I keep the Genesis Plus GX setting at "Original: 4:3," The VI width is set to 640, though, right? So I wouldn't need to adjust VI width in this case?
No, VI width in original (4:3) aspect ratio mode is set to a value slightly larger than 640, to accurately match Genesis output aspect ratio, as explained in my previous post.
VI width can only be adjusted when aspect ratio is set to manual and, as explained above, it defaults to 640 with xscale=0
Filtering in the analog domain for a real Wii?
Not 100% sure but I think it is a digital filter with tap coefficients that can be configured through VI registers. I don't know how it is done on vWii since WiiU has a completely different video encoder, it should still be supported though to preserve compatibility with Wii games that would eventually reconfigure VI filter (not sure if any does though).
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Summarizing to make sure I understand:
The only xscale that needs adjusting to maintain the 4:3 aspect ratio is when the game uses 256x224 mode. In this case (with borders disabled), Genesis Plus GX adds 64 to 256 to obtain x-scaled 320x240, a 4:3 Genesis output. To undo the correction, subtract 64 from this combination of no borders and Genesis mode. Correct?
320x224 games don't need un-uncorrection. 256x224 games need un-correction.
(Sounds like a good case for an automated setting, eh?)
Summarizing to make sure I understand:
The only xscale that needs adjusting to maintain the 4:3 aspect ratio is when the game uses 256x224 mode. In this case (with borders disabled), Genesis Plus GX adds 64 to 256 to obtain x-scaled 320x240, a 4:3 Genesis output. To undo the correction, subtract 64 from is for this combination of no borders and Genesis mode. Correct?
yes
320x224 games don't need un-uncorrection.
with aspect ratio option set to manual, yes
256x224 games need un-correction
if you want them to look wrongly squished, yes
(Sounds like a good case for an automated setting, eh?)
Won't happen since what you call un-correction is inaccurate aspect ratio and will look arguably wrong for (the few) 256x224 games. The best thing about emulators on Wii is that you can make the video output looks exactly the same as original hardware: if you want it too look like PC emulators, you are better off using PC emulators, really. Or the Retroarch version that I think let you force 1:1 aspect ratio.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
The best thing about emulators on Wii is that you can make the video output looks exactly the same as original hardware...
Not 100% sure but I think it is a digital filter with tap coefficients that can be configured through VI registers.
This is an interesting concept. If the Wii uses a 720x480 external framebuffer, the fact that these dimensions are specified means that the EFB must be digital, which means the VI scaling is digital, which means the video process is not even analog, which means the Wii's VI is very different from the Genesis hardware.
I'm really curious about how the Wii does its "analog-looking" VI scaling, because, like you say, when I do non-Integer scaling on a PC, for example, the result looks awful. Not so on the Wii. When we throw the vWii from the Wii U into the mix, doesn't the video output stage basically become the equivalent of what a PC's GPU can do?
But the Wii U's HDMI non-integer, scaled output still looks great (if not a tad soft). How does the Wii U produce an analog look using digital processing?
This is an interesting concept. If the Wii uses a 720x480 external framebuffer, the fact that these dimensions are specified means that the EFB must be digital, which means the VI scaling is digital, which means the video process is not even analog,
Your logic that VI scaling must be digital because EFB is digital is flawed, that's two different parts of console hardware which behave very differently and have different purpose. VI is partly analog because it's a video encoding chip that generates an analog video signal.
which means the Wii's VI is very different from the Genesis hardware.
Genesis hardware is using a GPU (VDP) and a video encoding chip that output an analog video signal (either composite or RGB), so the video outputs are actually quite similar.
The only differences are that, for Genesis, raw RGB analog signals are generated by VDP and video encoding chip obviously generates a less quality composite video signal than Wii, but RGB outputs look quite the same (if you configure the Wii to output a non-interlaced video signal like Genesis off course), which is the most important.
I'm really curious about how the Wii does its "analog-looking" VI scaling, because, like you say, when I do non-Integer scaling on a PC, for example, the result looks awful. Not so on the Wii.
It's actually very likely scaling /filtering is done when producing analog signal, just like, because it's "good looking" does not necessarely mean it's not done digitally. They are actually very good quality filters that produce much better result than basic bilinear filtering.
When we throw the vWii from the Wii U into the mix, doesn't the video output stage basically become the equivalent of what a PC's GPU can do?
No idea, all I know is WiiU cannot output non-interlaced analog video signal like original Genesis and Wii can do so this probably look a lot like PC emulators, with no proper "scanlines".
But the Wii U's HDMI non-integer, scaled output still looks great (if not a tad soft). How does the Wii U produce an analog look using digital processing?
Because it's a soft and efficient filter, I guess.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
The pipeline (as I understand) is:
640x480 maximum frambuffer > VI width scaling > 720x480 external framebuffer > VI again to produce analog (real Wii) or unmodified digital signal, I hope (vWii)
So VI width scaling is probably digital and uses a scaling algorithm that most PC emulators don't use, for some unknown reason (Bad scaling artifacts during aspect ratio "correction" in Kega Fusion, Retroarch, Dolphin... On a side note, the reasoning against a PAR boolean in this Dolphin post is very sad and arbitrary: https://forums.dolphin-emu.org/Thread-correct-aspect-ratio-option?pid=396653#pid396653 Dumbing it down for the lowest common denominator user beyond having an "it just works" default setting is stupid. Edit: Dolphin seems to ignore the external framebuffer by default and just outputs the contents of the embedded framebuffer, which is exactly what I want, as long as it's not doing any aspect ratio correction. Somehow Dolphin sniffs the actual subset of the embedded framebuffer that a game uses... magic. I'm thankful that Genesis Plus GX allows PAR, even though obscured). I hope the Wii U doesn't do DAC to ADC at any point during that pipeline...
The pipeline (as I understand) is:
640x480 maximum frambuffer > VI width scaling > 720x480 external framebuffer > VI again to produce analog (real Wii) or unmodified digital signal, I hope (vWii)
Nope, VI scaling happens AFTER external framebuffer is set, when reading pixels to generate the analog video signal. As said earlier, internal (efb) and external (xfb) framebuffer generally have same width. To generate a wider xfb, you need to do multiple passes of efb rendering + copy to xfb adjacent areas but there is no horizontal scaling possible between efb and xfb.
So VI width scaling is probably digital and uses a scaling algorithm that most PC emulators don't use, for some unknown reason (Bad scaling artifacts during aspect ratio "correction" in Kega Fusion, Retroarch, Dolphin...
VI scaling is implemented by specific hardware, it is very likely much more complex and efficient than any upscaling/filtering algorithm implemented by software emulators, so comparing those or wondering why the latter don't use the former implementation really makes no sense, sorry ;-)
On a side note, the reasoning against a PAR boolean in this Dolphin post is very sad and arbitrary: https://forums.dolphin-emu.org/Thread-correct-aspect-ratio-option?pid=396653#pid396653 Dumbing it down for the lowest common denominator user beyond having an "it just works" default setting is stupid. I'm thankful that Genesis Plus GX allows PAR, even though obscured). I hope the Wii U doesn't do DAC to ADC at any point during that pipeline...
I think you are focusing too much on this analog/digital thing, it does not really matter how this is done and there isn't one domain fundamentally better or worst than the other, what matters is how the end result looks. That said, there are zero chances WiiU HDMI hardware is generating digital video out using analog video out.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Can anyone tell me how to actually do this on my wii?? For hours I've been searching for a way to change the external framebuffer from 720 to 640 width on wii games... It's all hacked with usb loader gx and priiloader and such.
In other words, the option to disable aspect ratio "correction." I want to see crispy, square pixels, please. :)