Smartfiltering may eventually replace bilinear/trilinear

ISSUE 1:
What would be the perfect algorithm for texture filtering?

By perfect I mean the filter makes the texture appear sharper than it's intended resolution as well as getting rid of all texture aliasing under all circumstances.

How expensive would something like that be under hardware?

ISSUE 2:
Could pixel shaders be used to improve texture quality?
If so, how could it be done? I know smartfiltering can be done through shaders, but I'm refering to better forms of filtering done through shaders.
 
Bob said:
Well, I don't think it's big deal.

Alpha maps are not generated automatically. Usually it's a job of texture designers to make them. But hardware support for alpha-channel exist.
The examples you give don't really apply in this case. Sure, hardware supports an alpha channel, dot3, shaders, etc, and using them often requires support from artists.

However, all of those are generic and have many more uses than "bump mapping technique #454". SmartFlt doesn't have this flexibility and genericity.

What "flexibility and genericity" are you talking about? Elaborate.

MaxSt
 
Great, this is what we always wanted; aliasing inside textures. Wait, let's simply go back to point filtering!
You'd need a very very large point-filtered texture to have the same effect as SmartFlt. SmartFlt provides you the option of having some areas of the texture be sharper than other. Of course, sharpness is accompanied by aliasing, so it's a double-edge sword. You of course don't apply the same pattern everywhere, but select the pattern based on contrast differences between texels.

Parts of the textures that were ment to have sharp edges still retain sharp edges after filtering, instead of being blurred out. Conerversely, parts of the texture that don't have sharp edges are still bilinear filtered. You don't lose anything.

What might actually work ok in a 'scientific' way it to give every texel a weight.
That doesn't always work. You want the filtering equations to be different depending on which area of the subtexel you are in.

What would be the perfect algorithm for texture filtering?
It doesn't exist. All magnification filtering algorithms are based on the idea that they can construct a higher resolution texture from a lower one, and that this higher resolution texture is what was meant to be used, but couldn't be due to memory/speed/misc hardware constraints.

The question is then, how good is this reconstruction?

Let's take the example of a 2x2 black and white checkered texture. The same idea can be generalized to any size texture, but I'll use this small texture for demontrative purposes. If you magnify this texture on screen (by, say, applying to a large triangle), then what do you expect to see? Should it be a larger 2x2 checkered pattern? Or maybe, the checkered pattern was really an aliased version of a smooth grey gradient.

No filtering algorithm would be able to discern those two cases. You'd need two different filters, which need to be selected by a human (programmer or artist).

In the more general case, you can apply this idea to any NxM sub-section of any texture. Should this NxM be point-fitered or linear filtered? Or maybe the filtering is a more complicated function?

If you apply the same filter for the whole texture, then some regions would be more blurry than they're supposed to, or some will be more aliased than they need to.

SmartFlt goes part of the way towards solving this: The filtering equation is partially encoded in the texture itself. That way, the right filtering is selected. SmartFlt is somewhat limited, as it tends to only contain some variations of bilinear and point sampling.

Could pixel shaders be used to improve texture quality?
You can code SmartFlt in a pixel shader. It's just going to be horribly slow. Even worse, SmartFlt really kicks in when you magnify a texture: that is, when a large area of the screen will need to be filtered.


What "flexibility and genericity" are you talking about? Elaborate.
SmartFlt hardware can't really be used for anything but SmartFlt. Dot3 (for example) is much more general: although it can be used for bump-mapping, it can only be used for many other things.
 
Nick said:
Great, this is what we always wanted; aliasing inside textures.

No big deal. It's possible to use the same multi-sampling technique that is used for anti-aliasing of poligon edges. It will just be used on edges inside to texture too. That's all.

MaxSt
 
o big deal. It's possible to use the same multi-sampling technique that is used for anti-aliasing of poligon edges. It will just be used on edges inside to texture too. That's all.
But that's horribly expensive, in either speed or transistors (or both). It would likely be better to tweak SmartFlt so that instead of sharp constrast regions, it would have thin borders between borders where bilinear filtering can be used instead. Even better, those bordering regions can be made as thin as one pixel at very little cost: you just need to render to rasterize 4 pixels at a time. It then becomes trivial to detect when you cross from one region to another on the same 2x2. You can then simply bilinear filter that 2x2.

I'd like to experiment with this idea.

Well, the same is true for AF.
But AF requires neither programmer nor artist intervention. Having either helps speed up the computations (by capping the number of samples), but neither are *required*. SmartFlt on the other hand requires both software and hardware support, *and* isn't generic. The full algorithm also isn't cheap. This makes it a much harder sell.
 
Bob said:
But that's horribly expensive, in either speed or transistors (or both).

I don't think so. The logic is very similar to existing multi-sampling, so existing transistors could be used. And the performance will not take a big hit, because majority of texels are not borders-texels.

Bob said:
It would likely be better to tweak SmartFlt so that instead of sharp constrast regions, it would have thin borders between borders where bilinear filtering can be used instead.

It's probably possible, too.

Bob said:
you just need to render to rasterize 4 pixels at a time.

Oh well, that sounds pretty much like the multi-sampling I was talking about earlier.

Bob said:
Well, the same is true for AF.
But AF requires neither programmer nor artist intervention. Having either helps speed up the computations (by capping the number of samples), but neither are *required*.SmartFlt on the other hand requires both software and hardware support, *and* isn't generic.

Only for now. I'm confident that it's perfectly possible to make it authomatic, it's just will not be as pretty as artist's work.

Bob said:
The full algorithm also isn't cheap. This makes it a much harder sell.

I'm not sure about the cost, maybe some hardware geeks will be able to find a way to make it cheap, who knows? Anyway, the picture is pretty, which is good for sell.

MaxSt
 
Back
Top