Page 1 of 1
Better filtering?
Posted: Mon Mar 26, 2007 12:24 am
by Thirith Dragon
How likely is it that better filtering options are going to be put in Exult? I just saw some of the examples of the HQ3X and HQ4X filters (
http://www.hiend3d.com/hq3x.html), and they look very good to me.
Re: Better filtering?
Posted: Mon Mar 26, 2007 10:44 am
by drcode
This has come up before:
http://exult.info/forum/viewtopic.php?p=16271#p16271
Seems like there's an issue with speed, which might not matter with modern CPU's; plus Exult's scaling system will need to be modified.
Re: Better filtering?
Posted: Mon Mar 26, 2007 10:59 pm
by Thirith Dragon
Thanks for that link. However, since the last sign of life was in 2003, I'm not holding my breath. Does anyone here know whether the Exult team (or what's left of it) is still planning to implement this or other options?
P.S.: Please don't think that I'm ungrateful for what's already there. Exult is a gift to us Ultima fans. Having it improved even more would still be nice.
Re: Better filtering?
Posted: Tue Mar 27, 2007 9:34 am
by drcode
I've started looking at the filtering code. I'd like to implement the 3x filter in Exult, but don't want to promise anything, since it might be too slow.
Also, seems like I have a lot more fun real-life activities to distract me, along with some not-so-fun activities (like filing taxes:-( ).
Re: Better filtering?
Posted: Fri Apr 13, 2007 12:39 pm
by drcode
Thought I'd start with Hq2x. You can try it out in the latest snapshot (might have to wait for tomorrow's). Performance seems fine. I think it looks good, but probably just a little better than the other filters.
Hq3x will be next.
(Developer's note: The trick they did of interpolating colors by adding the 32-bit values is really clever; but I wish they'd mentioned that the reason it works is each color's value (0-255) always has it's 2 low bits cleared.)
Re: Better filtering?
Posted: Fri Apr 13, 2007 2:06 pm
by Gruck
By the way, Hq2x looks really good! I can't wait to see more.
Re: Better filtering?
Posted: Fri Apr 13, 2007 2:21 pm
by Skutarth
I didn't know that Hq2x/Hq2x would look good on anything other than NES games. Very nice.
Re: Better filtering?
Posted: Fri Apr 13, 2007 2:54 pm
by Colourless
I tried Hq2x in Pentagram and the results were very disappointing. For the most part it was good, but it really really broke badly when doing the fine cross faded palette adjustments when you were under the effects of shrooms. There was really bad temporal artefacting. Even when standing still the lines around the screen would change and pixels would change colour depending on how far the palette transition had progressed. Hq2x and friends work using YUV and shroom mode in Ultima8 really screws around with what happens to Y and U the comonents.
Re: Better filtering?
Posted: Fri Apr 13, 2007 3:31 pm
by Skutarth
Er, Hq2x/Hq3x. You know what I meant.
The filter works wonders for reading signs in Exult. Beautiful!
Re: Better filtering?
Posted: Sat Apr 14, 2007 5:26 am
by TdI
I don't see a big difference with the signs, but the usual text fonts and numbers look alot sharper now and are easier to read.
Re: Better filtering?
Posted: Sat Apr 14, 2007 8:19 am
by SB-X
Any screenshots for lazy people?
Re: Better filtering?
Posted: Sat Apr 14, 2007 8:22 am
by Skutarth
Here's a comparison:
Re: Better filtering?
Posted: Sat Apr 14, 2007 10:14 am
by Dominus
hmm, looks both nice and not
On the one hand I like a lot how it looks, but when I look closer white pixels are too white in comparison... Oh well, got to try to actual play it with that filter
Re: Better filtering?
Posted: Sat Apr 14, 2007 1:07 pm
by Colourless
Hmm.. the reason why the white pixels are too visable is because the rest of the roof is too dark. Gamma correct filtering would probably fix that problem.
Re: Better filtering?
Posted: Sat Apr 14, 2007 3:37 pm
by SB-X
Thanks.
Re: Better filtering?
Posted: Mon Apr 16, 2007 10:50 am
by drcode
Hq3x is in there now. Looks nice, but it's definitely stressing my CPU. I may fiddle a bit with optimizing it.
Re: Better filtering?
Posted: Mon Apr 16, 2007 12:24 pm
by Skutarth
Looks great!
It also runs fine for me, but my specs are reasonably high, so I can't give any input on performance.
Re: Better filtering?
Posted: Tue Apr 17, 2007 9:30 am
by TdI
Looks as if someone had ran U7 though a Photoshop filter. I think "oil paint" is the one I'm thinking of.
But that can be misunderstood. I think U7 now looks better than ever.
My system runs on a humble AMD Sempron 2600+ 1.86GHz processor.
Hq2x makes Exult take about 30-50% CPU cycles while just standing around Trinsic right after the intro. Switching to Hq3x hardly makes any noticable difference. Maybe +5%.
Running around Trinsic takes 60-70% CPU. All in all, looks good, runs fine for me.
Nice work DrCode
Re: Better filtering?
Posted: Tue Apr 17, 2007 12:26 pm
by SB-X
SuperEagle looks a little more like an oil painting. Hq2x works fine on my Athlon 3000+ (2.1GHz), but Hq3x slows the game down considerably. (in SI) There is a bug where the mouse stops working when resolution is set to 320x200 scaled with Hq3x in fullscreen mode.
Re: Better filtering?
Posted: Tue Apr 17, 2007 3:24 pm
by marzo
Here are the results in my laptop (Pentium IV 2.2GHz, 1GB Ram, crappy on-board video card):
- Super2xSAI: averages around 7% CPU time when idle, can go up to ~37% when walking quickly in a place with lots of buildings (e.g., Fawn, Britannia).
- Hq2x: in the same situations, the numbers are 14% and 77% (up to 84% with NPCs walking around).
- Hq3x: 20% idle, 90% when walking quickly across Fawn (up to 96% with lots of NPCs).
Given the choice, I think I'll prefer Hq2x any time over Super2zSAI, and I will likely use Hq3x. I will only have to change the Exult menu to not use Hq3x, as it will end up being larger than the screen...
Re: Better filtering?
Posted: Wed Apr 18, 2007 7:13 am
by drcode
I'm getting similar results with a 2.8Ghz Athlon from a few years ago. This is compiled for debugging, so it's possible that turning on higher compiler optimization could improve this a bit.
I can also see one or two ways the algorithm could be improved, but haven't had time to play with it yet.
Re: Better filtering?
Posted: Thu Apr 19, 2007 11:52 am
by drcode
Last night, I recompiled the scalers with -O3 enabled. I took around 5 minutes! But I think it helped, because walking around with hq3x seemed a lot smoother, and CPU usage stayed around 65%.
I'm guessing that the Windows version of Exult is already compiled with decent optimization turned on.
Re: Better filtering?
Posted: Sat Apr 21, 2007 12:56 am
by Andrea B Previtera
Marzo:
> - Hq3x: 20% idle, 90% when walking quickly across Fawn (up to 96%
> wiith lots of NPCs).
Since you specify this... I suppose the filter is applied to each graphic element prior their offscreen drawing? I always thought such filtering algorithms were meant to be applied to the whole screen..
Re: Better filtering?
Posted: Sat Apr 21, 2007 10:00 am
by Skutarth
In this case, it would be a bad idea to use it as a post-processing filter. Since the palette of Ultima 7 is so limited, and since there are a lot of black outlines, you would get unwanted assumed shapes from the filter when shapes overlap.
It's implemented properly as-is. Sure, it would run faster if applied afterward, but it wouldn't look right.
Re: Better filtering?
Posted: Sat Apr 21, 2007 10:39 am
by SB-X
I don't think he was suggesting the way the filter is implemented should be changed.
I thought it was applied to the whole screen too, and had some kind of optimization which caused it to run faster when not much is happening on-screen, but that's because I have no idea how it works. I thought applying a scaler to individual shapes would cause image artifacts when drawn to the screen.
Re: Better filtering?
Posted: Sat Apr 21, 2007 10:54 am
by marzo
SB-X is correct, it *is* applied for the whole screen. I also forgot to mention that this was in windowed mode; the processor usage would probably be a lot lower if I used full screen. My intent in showing the effects of moving in a place with lots of things is that, while Hq2x and Hq3x had an effect on average CPU use, other aspects of Exult tend to use a lot more CPU cycles. I shouls have been more clear about that.
Re: Better filtering?
Posted: Sun Apr 22, 2007 12:43 am
by Andrea B Previtera
Aah, I get it now
Right right right. I haven't fiddled with the sources since version 0.9X or so, so I wonder [just a slight OT diversion] - what parts of the engine are currently running in separate threads? Or is it everything still single-threaded?
Re: Better filtering?
Posted: Mon Apr 23, 2007 2:05 pm
by drcode
As far as I know, it's all in one thread except for the audio, which SDL handles in a separate thread.
Re: Better filtering?
Posted: Thu Apr 26, 2007 4:42 pm
by paulo
Dosbox uses an architecture thats aplies filters only when the screen updates (and various other tricks i belive), and that makes HQ2 tolerable. Just saying.
Re: Better filtering?
Posted: Fri Apr 27, 2007 1:03 pm
by drcode
I believe that's how Exult works too. But U7's palette rotation means that updates are happening all the time.