Universal Deflicker/Blur Disable Code

General Dreamcast discussion applies here. Before posting here please check the other forums in the Dreamcast section to see if your topic would fit better in those categories.

Moderators: pcwzrd13, mazonemayu

Forum rules
Please check the other forums in the Dreamcast section before posting here to see if your topic would fit better in those categories. Example: A new game/homebrew release would go in the New Releases/Homebrew/Emulation section: http://dreamcast-talk.com/forum/viewforum.php?f=5 or if you're having an issue with getting your Dreamcast to work or a game to boot it would go in the Support section: http://dreamcast-talk.com/forum/viewforum.php?f=42
Esppiral
BFG-10K
Posts: 211
Joined: Mon Apr 27, 2015 10:37 am

Re: Universal Deflicker/Blur Disable Code

Post by Esppiral »

Another game that seems to render at 1280x480 and blurs the entire image is the Toyota Doricatch series- Land Cruiser.
I was thiking of games that look blurry even on VGA or that seems to have some sort of AA. turns out this game also renders at higher resolution and the same patch deblurs the image.

Whatch them in full screen to see the difference, again in motion/in person the difference is night and day it looks MUCH clearer.

Original
Image

Deblur
Image

Image

Image

Image

Image

Image

Image
TapamN
letterbomb
Posts: 149
Joined: Sun Jan 10, 2021 10:52 pm

Re: Universal Deflicker/Blur Disable Code

Post by TapamN »

Esppiral wrote:I think I know the answer for this one but, could we force more games to render at 1280*480?

It's definitely possible in some sense, but having it work well would be tricky.

The PVR takes coordinates in pixels before downscaling. So if you just enable antialiasing without any other changes, you just end up with everything squeezed into the left half of the screen, with some extra stuff visible on the right side (like using widescreen on an emulator without patches). You have to manually adjust the coordinates of everything.

You'd need something similar to an aspect ratio changing code. You wouldn't be changing the aspect ratio, but you would need to stretch out the screen horizontally by two times, and move the vanishing point over to the new center of the screen. You'd also have to get the HUD adjusted. With a widescreen patch, it's possible to tolerate a stretched HUD, but with AA on, everything gets compressed and moved closer to the left side of the screen. Anything on the right side of the screen ends up slightly to the left of center.

Performance might be an problem. Ideally the game could handle changes in frame rate without slow motion. Mipmaps would be nice, since it reduces GPU load. I have screenshots lying around that can show the render cost of antialiasing with and without mipmaps. (I'm working on a new PVR driver. Ignore the poor cycles per polygon performance. The clipping code is extremely unoptimized at the moment.) It can also show a bit what happens if the HUD isn't adjusted correctly. "Rnd time" is the amount of time it takes the GPU to finish rendering, "Reg time" is the CPU time spent doing T&L and sending it to the tile accelerator.

aa mip compare.jpg

In the screenshots, I adjusted the 3D view, the width of the text, and the width of the graph on the top, but not the origin point of the text or the X width of the lines. The text gets shifted over to the left, but since it was already close to the left it's not shifted too much. The vertical lines on the graph up top become semitransparent; they are supposed to be one pixel wide, but end up half a pixel with with antialiasing on. The two pixel wide marks even up transparent because each half of the line ends up in different pixels. The green lines around Sonic are supposed to be two pixels wide, but with with AA on, the mostly vertical lines end up one pixel wide, while the mostly horizontal lines remain two pixels tall.

Another issue is that it takes a bit of extra video RAM do to anti-aliasing. It doesn't double frame buffer requirements, like on normal GPUs, but it still takes 50-200 KB extra depending on the game's settings. This might cause problems for some games.

The ideal game for a antialiasing patch would be a game that supports variable frame rates and isn't pushing the GPU hard. Already having a widescreen patch with fixed HUD would help. I guess some Playstation ports, like Soul Reaver, might work. Out of games developed specifically for the DC, I think Floigan Bros could be ok. It runs at 60 FPS (pretty inconsistently), but supports variable frame rate without slow motion, so with AA on, it could pass as a 30 FPS game. The extra video RAM usage could be an issue, though.

Esppiral wrote:Another game that seems to render at 1280x480 and blurs the entire image is the Toyota Doricatch series- Land Cruiser.
I was thiking of games that look blurry even on VGA or that seems to have some sort of AA. turns out this game also renders at higher resolution and the same patch deblurs the image.

I knew about that "game" from Retro Core, and I've tried it on an emulator, but I didn't know it used AA.
User avatar
fafadou
Gold Lion
Posts: 1663
Joined: Mon Nov 14, 2016 10:45 am

Re: Universal Deflicker/Blur Disable Code

Post by fafadou »

Thanks for this :-)
A good to try is trickstyle, the game is terribly blur.
User avatar
SEGA RPG FAN
Developer
Posts: 601
Joined: Mon Jun 16, 2008 11:01 pm
Dreamcast Games you play Online: PSO
Quake III
Starlancer
Alien Front Online
Chu Chu Rocket
Location: Minnesota USA

Re: Universal Deflicker/Blur Disable Code

Post by SEGA RPG FAN »

Does it make any sense to try values between 50 and 99.6%. I was trying out 75 and 80 for maybe a little sharper image, but still some de-flicker. All I got was trippy rainbows. I find turning the filter off helps 480i sharpness immensely, but depending on the game content you get obnoxious flicker (go figure right?).
PSO Dreamcast 100% Legit: Eda FOmarl, Automaton HUcast
TapamN
letterbomb
Posts: 149
Joined: Sun Jan 10, 2021 10:52 pm

Re: Universal Deflicker/Blur Disable Code

Post by TapamN »

SEGA RPG FAN wrote:Does it make any sense to try values between 50 and 99.6%. I was trying out 75 and 80 for maybe a little sharper image, but still some de-flicker. All I got was trippy rainbows. I find turning the filter off helps 480i sharpness immensely, but depending on the game content you get obnoxious flicker (go figure right?).
The way deflicker works it that it takes three rows of the rendered image, multiplies the RGB values by some number (set by the filter weight registers, the value from the last line in the code), adds the three rows together, divides it by 256, then writes the bottom 8 bits of the result to the frame buffer.

The filter weight register value (0000xxyy) specifies two values. The xx part controls the weight of the center row of the three that get combined, and the yy part controls the weight for the top and bottom rows. You want xx + yy*2 to equal 256. If they combine to be greater than 256, you get a brighter display with weird colors (RGB value wrap around) in areas that are already bright. If they add up to less than 256, the screen is dimmed.

Here are some values for lighter deflicker (replace last line of Codebreaker code):

Code: Select all

     Standard: 25.00% + 50.00% + 25.00% -> 00008040
A bit lighter: 18.75% + 62.50% + 18.75% -> 0000A030
        Light: 12.50% + 75.00% + 12.50% -> 0000C020
   Very light:  6.25% + 81.25% +  6.25% -> 0000D010
User avatar
SEGA RPG FAN
Developer
Posts: 601
Joined: Mon Jun 16, 2008 11:01 pm
Dreamcast Games you play Online: PSO
Quake III
Starlancer
Alien Front Online
Chu Chu Rocket
Location: Minnesota USA

Re: Universal Deflicker/Blur Disable Code

Post by SEGA RPG FAN »

I was assuming the whole xxyy was the center line and I was choosing 0-65535. I was
way off, thanks for the explanation!
PSO Dreamcast 100% Legit: Eda FOmarl, Automaton HUcast
Post Reply