View Full Version : nice texture filtering
I just found this at flipcode :
Would this be possible in realtime (using this special sort of textures)?
Hmm, interesting yet simple system. Reminds me of the 3dfx post filter system which also used a threshold to determine what to blend and what not to blend together. I am sure that Simon will have some thoughts on this :wink:
"Current hardware does not support this texture filtering technique, but in future, more advanced versions of programmable pixel shaders could make the hardware implementation possible."
Pixel Shader 1.4? 2.0? (Has anyone heard if MS will introduce yet a new version of Pixel Shaders in DX 9.1?)
Download the executable, it is done in realtime isn't it (software though)? Or else switching between the filtering modes should effect performance right?
It seems that this really only has toon-shading advantages, for which there are quite a few techniques to use in real time. This would be useful for decals and such, and I would think that you could do this with compare functions in the pixel shader.
The problem is that most textures are photo based, so this type of filtering would likely just screw up the image. You probably could only enhance general textures by using bicubic filtering, but it requires a good amount of processing and bandwidth. Furthermore, this doesn't help the texture quality a whole lot. For this reason, its probably better to just use a higher resolution texture.
Not to belittle Maxim Stepins' idea, but I think that with the example texture he used, it's actually possible to do a similar thing in hardware. The special property in the texture is that all hard edges have the same constant color on one side (black).
The PS should do something like this (pseudo-c):
outpix = filter(texalpha)<0.5 ? black : filter(texcolor);
But I don't agree with Mintmaster, this could be useful in other cases than toon shading. Even for photo based textures. It might be difficult to make an fully automatic "compression"-program, but if the program lets you do touch-up on where to mark edges, it would probably be doable, and useful.
But one thing should be added. While this filter removes the blur from over-magnifying an edge, it introduces aliasing on the same edge. This aliasing could be reduced by adding some filtering again. This filter is only to be used for texture magnification, where the rasterizer has given up on finding higher resolution mipmaps. One way to do it is to use Maxims algorithm to produce a "virtual mipmap" at the wanted resolution, and then do normal filtering on it. The virtual mipmap wouldn't be stored anywhere, just be a intermediate value.
So I'd say this definitely would be useful, but I haven't formed an opinion on whether it would be worth the extra transistors. (Haven't thought about how much extra logic it would take.)
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.