Next Generation Emulation banner
1 - 19 of 19 Posts

·
Registered
Joined
·
828 Posts
Discussion Starter · #1 ·
I found this: http://web.archive.org/web/20070624082603/www.hiend3d.com/smartflt.html while searching about HQ2X algorithm.

This is smart texture filtering. Basically, it takes each block of 4 texels and filters it differently depending on its pattern, in order to keep borders sharp and achieve smoothness inside the borders. There are 14 possible patterns:



Pattern 0: linear/bilinear/whatever smoothing on the 4 pixels
Pattern 1: smoothing on the top pixels, smoothing on the bottom pixels
And so on...

Here are the results with different filtering methods:

Nearest filtering:


Bilinear filtering:


Smart filtering:


I thought it may be interesting to implement a filtering method like that, which can work on any image size, on DeSmuME's window, rather than all those filters which only work with fixed sizes (like HQ2X, HQ3X, HQ4X...).
And maybe later on it can get implemented in the Soft rasterizer, who knows...

Your opinions are welcome.
 

·
Registered
Joined
·
74 Posts
looks good! though I could imagine that it doesn't recognize all the places it should so that in the end maybe you have some crisp graphics mixed with some blurry ones if you get my meaning...on the other hand I have no knowledge of these things so I'm just waitin' to see it in action ^^
 

·
desmume coder
Joined
·
488 Posts
More to the point, has anyone ever seen this implemented in C instead of a huge heap of ugly asm
 

·
Registered
Joined
·
828 Posts
Discussion Starter · #5 ·
In the worst case, we can just take the interesting part in the asm code :p

That's the reason why it can't be implemented easily. It will have to be reimplemented. Atleast, we know how it works, which is better than just having the asm and knowing nothing :)
 

·
Banned
Joined
·
23,263 Posts
zeromus, shush your mouth D: lol :p

ASM filters perform far more efficiently then C.
....if you really want C though, i know someone who can pull it off....

though i want this filter in VBA now :p
 

·
Registered
Joined
·
828 Posts
Discussion Starter · #7 ·
Squall-Leonhart said it all, ASM is faster anyway :)
And I don't see a problem in just putting the file into desmume, seeing as some other parts (like the input dialog) are taken from elsewhere too...

Edit: I'm wrong. There's a problem. The thing uses extra texel information to locate the borders better.
 

·
Banned
Joined
·
23,263 Posts
it requires pre processed images, so it'd only be beneficial on 2d games.
 

·
Registered
Joined
·
828 Posts
Discussion Starter · #11 ·
That's why the asm implementation is not good for our usage.

Therefore, if I implement it, I do it from scratch. I'd also make it even smarter by caring about the 4x4 blocks around the block being filtered...
 

·
desmume coder
Joined
·
488 Posts
It does not necessarily require preprocessing. And even if it is implemented with preprocessing, it could easily be done in desmume for textures for 3d due to the texture manager being a very modular system (reused entirely by the ogl and soft rasterizer).
 

·
Banned
Joined
·
23,263 Posts
>.> i'll smack that gigaherz in the mouth for lieing to me.
 

·
desmume coder
Joined
·
488 Posts
I mean, obviously its more efficient to preprocess, but look at that guy. its 2001 and he coded that algorithm in asm instead of making a reference implementation which is comprehensible. Of course he is going to go out of his way to make it is complicated as possible by preprocessing and making a custom pixel format.
 

·
Registered
Joined
·
74 Posts

·
desmume coder
Joined
·
488 Posts
itll probably look like ass, but itll also be trivial to find out once someone has coded it in C
 

·
┐( ̄ー ̄)┌
Joined
·
2,058 Posts

·
Banned
Joined
·
23,263 Posts
ugh, i hate interpolation, SaI makes LCD and non 4:3 images look bad.
 
1 - 19 of 19 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top