Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 21-May-2004, 17:03   #1
Scott C
Junior Member
 
Join Date: Jun 2002
Posts: 43
Send a message via AIM to Scott C
Default Trilinear single mip level Optimization not always cheating

I didn't have time to wade through several hundred posts, (I despise this forum format for any sort of catch-up on discussions) but my point is simple.

If ATI is "disabling" the bilinear anisotropic or trilinear modes when color mip maps are used, this may not be cheating.

It is PERFECTLY ACCEPTABLE to sample from only one mip-map (the larger one) rather than linearly interpolate between two if trilinear is on, provided enough samples are taken on the larger mipmap, provided the smaller mipmaps are linear downsamples of the larger one, and provided the algorithm is correct.


---------
Scott's Trilinear optimization correctness theorem:

If a lower level mipmap is simply a straight linear down-filter of the higher level map, then all the data required to render a scene can be found in the high detail map, and using multiple mipmaps IS NOT NECESSARY provided the algorithm samples enough texels in the high detail mipmap to retrieve and integrate the information lost by neglecting the lower level mipmap. Additionally, to be correct, such an optimizing filtering algorithm must mimic filtering methods that interpolate between mipmaps and have no discontinuity at mip level boundaries.
---------

If their drivers simply detect when lower level mipmaps are close enough to simple downfiltered maps and enable this optimization, it is not cheating at all. Your visual quality will not be impacted by using only one mip level at a time since all the information in the lower level map is contained in the larger one.

That said, I'm not sure that ATI's specific optimization passes my correctness test or not. But I've always thought that blending between two mipmaps was a pointless excercize if you already HAVE the data from one mipmap contained in another and the texels are cached and ready to be read.

This is in no way some sort of fanboyism, I've been an advocate for this since the S3 Savage3D did it.

The ONLY reason trilinear existed in the first place was to save bandwidth and to save processing power, and sample and filter only 8 texels (4 from each level) instead of 16 from the top level. (Assuming isotropic). If processing power is free or near it (hardware interpolation) and caching means that bandwidth is also almost free for cached data, then such optimizations can make sense.
Scott C is offline   Reply With Quote
Old 21-May-2004, 17:08   #2
Malfunction
Member
 
Join Date: Apr 2003
Posts: 113
Default

It's not cheating as long as it is not being called, "Full Tri-Linear Filtering." 8)
Malfunction is offline   Reply With Quote
Old 21-May-2004, 17:15   #3
Killer-Kris
Member
 
Join Date: May 2003
Posts: 540
Default

Quote:
Originally Posted by Malfunction
It's not cheating as long as it is not being called, "Full Tri-Linear Filtering." 8)
Except from what I understand Scott's example was indeed FULL trilinear just a different way of implementing it. Though sadly it does not seem that this is the technique that ATI is using, which doesn't mean that their method can not be just as good. And as some people have pointed out, the purpose of trilinear is to merely make the mipmap transitions not visible. So if ATI's method does this, is it not also "full" trilinear?
Killer-Kris is offline   Reply With Quote
Old 21-May-2004, 17:29   #4
Malfunction
Member
 
Join Date: Apr 2003
Posts: 113
Default

Quote:
Originally Posted by Killer-Kris
Quote:
Originally Posted by Malfunction
It's not cheating as long as it is not being called, "Full Tri-Linear Filtering." 8)
Except from what I understand Scott's example was indeed FULL trilinear just a different way of implementing it. Though sadly it does not seem that this is the technique that ATI is using, which doesn't mean that their method can not be just as good. And as some people have pointed out, the purpose of trilinear is to merely make the mipmap transitions not visible. So if ATI's method does this, is it not also "full" trilinear?
Well, this can go into so many directions... let's try a few shall we?

*Going to be using the NV17 example here since Dave had supplied the shots here already and so forth.

1) Going by the shots of the NV17's "Tri-linear Filtering" method, do we assume that anything less than that example is not to be considered "Tri-Linear Filtering?"

2) Are we suggesting that ATi has now "redefined" what is considered "Tri-Linear Filtering" as not many can actually see the difference from the "Legacy" method (NV17 in this example)?

3) Is there even a need for the terms (Bi-Linear Filtering) or (Tri-Linear Filtering) any longer? Should they just be called, "Filtering Methods," or something to that effect?

4) Who draws the line between "subtle" IQ degradation and illegal "Optimizations?"

5) As a result of this, what is the definition of a *illegal "Optimization?" Some see the difference, some don't. If some can't tell the difference between mix mode FP16/FP32, are we now suggesting this is a valid optimization?

Inquiring minds would like to know.... 8)
Malfunction is offline   Reply With Quote
Old 21-May-2004, 18:24   #5
Demirug
Senior Member
 
Join Date: Dec 2002
Posts: 1,326
Send a message via MSN to Demirug
Default

Take a look:

http://v3.espacenet.com/textdoc?DB=E...;IDX=US6452603

http://v3.espacenet.com/textdoc?DB=E...;IDX=US6304268
__________________
GPU blog
Demirug is offline   Reply With Quote
Old 21-May-2004, 18:33   #6
davepermen
Member
 
Join Date: Aug 2003
Location: Switzerland
Posts: 422
Send a message via ICQ to davepermen Send a message via MSN to davepermen
Default

a simple example:

if you know the higher levels are simply downsampled from the lower levels, then the higher level is just the bilinear equally weighted combination of the lower 4 texels.

if you now know by measure or settings, that this is true, then you can only sample the 4 texels at the lower level, and bilinear filter them twice. once, with the texcoords, and once with 0.5,0.5 to equally weight them. and _then_ you can linear weight between those, to do the full trilinear filtering.

now this is a linear combination of only 4 values. that means, if you adjust the texcoord, with a weighted shift towards the center in the 4-sample-quad, you get EXACTLY the same as with the other samples else.

except for one fact: the higher level sample is just a point-sample. non-the-less, it is near-to-trilinear with only 4 samples instead of 8. and about enough in a lot of cases, depending on the input data.


this _could_ be one way they do it.
davepermen is offline   Reply With Quote
Old 21-May-2004, 18:35   #7
Rolf N
Recurring Membmare
 
Join Date: Aug 2003
Location: yes
Posts: 2,494
Default

Quote:
Originally Posted by Killer-Kris
And as some people have pointed out, the purpose of trilinear is to merely make the mipmap transitions not visible.
ATI may say so, but that doesn't suffice to make it true.
The whole purpose of texture filtering is to maximize material frequency within the constraints given by the Nyquist theorem. AFAIK there's exactly nothing wrong with "legacy" (?!) trilinear filtering in this respect.
Rolf N is offline   Reply With Quote
Old 21-May-2004, 18:50   #8
coredump
Junior Member
 
Join Date: Jan 2004
Location: Here
Posts: 35
Default

Quote:
Originally Posted by zeckensack
The whole purpose of texture filtering is to maximize material frequency within the constraints given by the Nyquist theorem. AFAIK there's exactly nothing wrong with "legacy" (?!) trilinear filtering in this respect.
Solving the Nyquist problem is very, very hard (I was going to say impossible). That's because the frequency domain for sythetic textures is unbounded.

Consider a checkboard pattern. A white to black transistion for adjacent pixels is a step discontinuity. In the frequncy domain, it has infinite harmonics, therefore no amount of samples will be sufficent
coredump is offline   Reply With Quote
Old 21-May-2004, 18:57   #9
vb
 
Join Date: Jun 2003
Posts: 367
Default

Quote:
Originally Posted by davepermen
a simple example:

if you know the higher levels are simply downsampled from the lower levels, then the higher level is just the bilinear equally weighted combination of the lower 4 texels.

if you now know by measure or settings, that this is true, then you can only sample the 4 texels at the lower level, and bilinear filter them twice. once, with the texcoords, and once with 0.5,0.5 to equally weight them. and _then_ you can linear weight between those, to do the full trilinear filtering.

now this is a linear combination of only 4 values. that means, if you adjust the texcoord, with a weighted shift towards the center in the 4-sample-quad, you get EXACTLY the same as with the other samples else.

except for one fact: the higher level sample is just a point-sample. non-the-less, it is near-to-trilinear with only 4 samples instead of 8. and about enough in a lot of cases, depending on the input data.


this _could_ be one way they do it.
And considering they only use it on driver generated mip-maps. those (mip-maps), along with LOD bias, could be tweaked at loading time to minimize most drawbacks. plus using bilinear on the second (smaller) mip-map has pro and cons. the only reason it was used by default was that a bilinear sample is the only thing "free" on current hardware.

I think ATI should be praised for including extra hardware on chip for free trilinear. it is a first for 5 Years (?) that any IHV includes hardware for trilinear.

Nv3x doesn't count because it included specialized hardware for not doing trilinear. (that was for Chalnoth)
vb is offline   Reply With Quote
Old 21-May-2004, 19:08   #10
UPO
Junior Member
 
Join Date: Dec 2003
Location: private apartment near ring0
Posts: 58
Default

Quote:
Originally Posted by zeckensack
The whole purpose of texture filtering is to maximize material frequency within the constraints given by the Nyquist theorem. AFAIK there's exactly nothing wrong with "legacy" (?!) trilinear filtering in this respect.
I'm not sure but it seems to me that bilinear filtering either undersamples or oversamples information. And trilinear tries to average error.
__________________
"Violence is the last refuge of the incompetent" - Salvor Hardin
UPO is offline   Reply With Quote
Old 21-May-2004, 19:18   #11
vb
 
Join Date: Jun 2003
Posts: 367
Default

Quote:
Originally Posted by UPO
I'm not sure but it seems to me that bilinear filtering either undersamples or oversamples information. And trilinear tries to average error.
Liked that
vb is offline   Reply With Quote
Old 21-May-2004, 19:20   #12
nAo
Nutella Nutellae
 
Join Date: Feb 2002
Location: San Francisco
Posts: 4,308
Default

Quote:
Originally Posted by coredump
Consider a checkboard pattern. A white to black transistion for adjacent pixels is a step discontinuity. In the frequncy domain, it has infinite harmonics, therefore no amount of samples will be sufficent
that's why it's useful to prefilter (lowpass..) textures.
nAo is offline   Reply With Quote
Old 21-May-2004, 19:44   #13
Rolf N
Recurring Membmare
 
Join Date: Aug 2003
Location: yes
Posts: 2,494
Default

Quote:
Originally Posted by coredump
Quote:
Originally Posted by zeckensack
The whole purpose of texture filtering is to maximize material frequency within the constraints given by the Nyquist theorem. AFAIK there's exactly nothing wrong with "legacy" (?!) trilinear filtering in this respect.
Solving the Nyquist problem is very, very hard (I was going to say impossible). That's because the frequency domain for sythetic textures is unbounded.

Consider a checkboard pattern. A white to black transistion for adjacent pixels is a step discontinuity. In the frequncy domain, it has infinite harmonics, therefore no amount of samples will be sufficent
That's a question of perspective, I guess. A texture map is an array of discrete samples, with step discontinuities between every pair of samples, if you insist that each texel is a rectangular region and there's no distance between neighbors.
However, you can fit a frequency bounded curve over that array that will exactly touch each texel center. This represents another view on the map: a texel is a single point on the surface of the map, and there's non-zero distance between texels.

This model has no discontinuity concerns, and IMO this is the right way to look at it (not from an implementation's POV, but from a signal theory POV). After all, if the flush rectangle theory were correct, point sampling would be the preferred technique for texture magnification. It isn't.

Quote:
Originally Posted by UPO
I'm not sure but it seems to me that bilinear filtering either undersamples or oversamples information. And trilinear tries to average error.
Bilinear tends to underuse frequency headroom because, by the simplicity of its design, it can't introduce higher frequency information without running the risk of introducing artifacts (shimmering). Trilinear does a better job at using the frequency headroom, but has issues with inclined surfaces, as should be well known. This is the reason why we need anisotropic filtering.
Rolf N is offline   Reply With Quote
Old 21-May-2004, 19:46   #14
coredump
Junior Member
 
Join Date: Jan 2004
Location: Here
Posts: 35
Default

Quote:
Originally Posted by nAo
Quote:
Originally Posted by coredump
Consider a checkboard pattern. A white to black transistion for adjacent pixels is a step discontinuity. In the frequncy domain, it has infinite harmonics, therefore no amount of samples will be sufficent
that's why it's useful to prefilter (lowpass..) textures.
For rendering, that's best. However, since we can see very high frequency information, it becomes a tradeoff as to how much you blur the scene to compensate for the aliasing problem.

adding noise to the final image might be a good way of adding fake high freqency data.

Filter texture -> Sample texture -> Add noise to sample
coredump is offline   Reply With Quote
Old 21-May-2004, 20:01   #15
Colourless
Monochrome wench
 
Join Date: Feb 2002
Location: Somewhere in outback South Australia
Posts: 1,257
Send a message via ICQ to Colourless Send a message via MSN to Colourless
Default

That would effectively be similar to using a procedually generated detail texture.
__________________
-Colourless

D3D FSAA Viewer 5.4
Words by Cat - Truely Intelligent Viewing
Colourless is offline   Reply With Quote
Old 21-May-2004, 20:38   #16
coredump
Junior Member
 
Join Date: Jan 2004
Location: Here
Posts: 35
Default

Pretty much. That kind of technique has been used for image processing before.

Someone could implement it as a smart shader, and try it out

One more thing. You probably need to know if the source texture had a high freqency component to begin with....it would look really silly to add noise to a sky texture (for example)
coredump is offline   Reply With Quote
Old 21-May-2004, 22:03   #17
Hyp-X
Irregular
 
Join Date: Feb 2002
Posts: 1,170
Default Re: Trilinear single mip level Optimization not always chea

Quote:
Originally Posted by Scott C
If their drivers simply detect when lower level mipmaps are close enough to simple downfiltered maps and enable this optimization, it is not cheating at all. Your visual quality will not be impacted by using only one mip level at a time since all the information in the lower level map is contained in the larger one.
No, the visual quality will be impacted when the texture has lossy compression.

Reproducing the lower level mipmap from the lossy compressed higher level mipmap will have higher quality than the lossy compressed lowel level mipmap.

That means the "fast-trilinear" filtering can actually improve IQ.
Hyp-X is offline   Reply With Quote
Old 21-May-2004, 22:14   #18
Hyp-X
Irregular
 
Join Date: Feb 2002
Posts: 1,170
Default

Quote:
Originally Posted by vb
And considering they only use it on driver generated mip-maps.
That's unlikely.
D3D doesn't support driver generated mip-maps.
Therefore there isn't many game that would be affected by it.

Btw, ATI said their method works as long the application used a box filter for generate the miplevels. The driver analyses the texture to detect such situations. It doesn't generate the mipmaps.
Hyp-X is offline   Reply With Quote
Old 21-May-2004, 22:31   #19
Geo
Mostly Harmless
 
Join Date: Apr 2002
Location: Uffda-land
Posts: 9,156
Send a message via MSN to Geo
Default

One of the things I love about B3d is that when someone throws out "Nyquist theorem", it doesn't put the whole room to sleep, or cause a chorus of abusive "wtf!". Here eyes squint, hands start inching slowly toward belts, and a Sergio Leone soundtrack starts up. . .
__________________
"We'll thrash them --absolutely thrash them."--Richard Huddy on Larrabee
"Our multi-decade old 3D graphics rendering architecture that's based on a rasterization approach is no longer scalable and suitable for the demands of the future." --Pat Gelsinger, Intel
". . .its taking us longer than we would have liked to get a [Crossfire game] profiling system out there" --Terry Makedon, ATI, July 2006
"Christ, this is Beyond3D; just get rid of any f**ker talking about patterned chihuahuas! Can the dog write GLSL? No. Then it can f**k off." --Da Boss
Geo is offline   Reply With Quote
Old 21-May-2004, 22:33   #20
coredump
Junior Member
 
Join Date: Jan 2004
Location: Here
Posts: 35
Default

Quote:
Originally Posted by zeckensack
That's a question of perspective, I guess. A texture map is an array of discrete samples, with step discontinuities between every pair of samples, if you insist that each texel is a rectangular region and there's no distance between neighbors.
However, you can fit a frequency bounded curve over that array that will exactly touch each texel center. This represents another view on the map: a texel is a single point on the surface of the map, and there's non-zero distance between texels.

This model has no discontinuity concerns, and IMO this is the right way to look at it (not from an implementation's POV, but from a signal theory POV). After all, if the flush rectangle theory were correct, point sampling would be the preferred technique for texture magnification. It isn't.
Good point. Then what is the best assumption for how the source texels are filtered to generate the source texture map? That should dictate how the texture should be reconstructed by the implemenation.

Plus you need to add in the tool that generated the scaled texture and mip maps.

Bring on the procedural textures!
coredump is offline   Reply With Quote
Old 21-May-2004, 23:24   #21
Randell
Senior Daddy
 
Join Date: Feb 2002
Location: London
Posts: 1,869
Default

Quote:
Originally Posted by geo
One of the things I love about B3d is that when someone throws out "Nyquist theorem", it doesn't put the whole room to sleep, or cause a chorus of abusive "wtf!". Here eyes squint, hands start inching slowly toward belts, and a Sergio Leone soundtrack starts up. . .
thats is good. However some use that knowledge to bolster their bias into a form of intellectual bullying (not that I'm accusing anyone in this thread).
__________________
Savage 4 > Voodoo 3 3000 > Voodoo 5 5500 > Radeon 8500LE > Radeon 9700 Pro > GeForce 6800 GT > Radeon X1950Pro > Radeon HD 3870 > Radeon HD 3870X2 > 3870X2 + 3870>3870X2>HD4850>Crossfire HD4850>HD 5850
Randell is offline   Reply With Quote
Old 21-May-2004, 23:32   #22
Ailuros
Epsilon plus three
 
Join Date: Feb 2002
Location: Chania
Posts: 7,818
Default

Quote:
Originally Posted by geo
One of the things I love about B3d is that when someone throws out "Nyquist theorem", it doesn't put the whole room to sleep, or cause a chorus of abusive "wtf!". Here eyes squint, hands start inching slowly toward belts, and a Sergio Leone soundtrack starts up. . .
ROFL

Ironically I've developed a "not again-allergy" every time I read the term optimisation lately.
Ailuros is offline   Reply With Quote
Old 22-May-2004, 03:24   #23
Chalnoth
 
Join Date: May 2002
Location: New York, NY
Posts: 12,679
Default

Quote:
Originally Posted by vb
I think ATI should be praised for including extra hardware on chip for free trilinear. it is a first for 5 Years (?) that any IHV includes hardware for trilinear.
A. We still don't know if ATI's using this technique. I highly doubt it, personally, as you wouldn't have any sort of "levels" of accuracy, and, according to the interviews, ATI's aniso/trilinear "optimization" can be adjusted.
B. It's not free.

Quote:
Nv3x doesn't count because it included specialized hardware for not doing trilinear. (that was for Chalnoth)
This means absolutely nothing to me. It's a pretty stupid statement, whichever way you look at it (whether judging what I would say: I've never defended nVidia's "brilinear," and it is, in fact, one of the reasons why I never purchased an NV3x, or even just looking at the actual statement: anybody who believed that the NV3x had "free" trilinear would be, well, wrong, for more than one reason).
Chalnoth is offline   Reply With Quote
Old 22-May-2004, 03:39   #24
bloodbob
Trollipop
 
Join Date: May 2003
Location: Australia
Posts: 1,630
Default Re: Trilinear single mip level Optimization not always chea

Quote:
Originally Posted by Scott C
I didn't have time to wade through several hundred posts, (I despise this forum format for any sort of catch-up on discussions) but my point is simple.

If ATI is "disabling" the bilinear anisotropic or trilinear modes when color mip maps are used, this may not be cheating.

It is PERFECTLY ACCEPTABLE to sample from only one mip-map (the larger one) rather than linearly interpolate between two if trilinear is on, provided enough samples are taken on the larger mipmap, provided the smaller mipmaps are linear downsamples of the larger one, and provided the algorithm is correct.
Ehh exactly how many samples should be taken? cause atm they are taking one Bilinear sample ( 4 texels ).

Lets do some math with the 1 bilinear sample

Lets say A is the LOD of the Higher Mipmap and B is the lod of the lower mip map.

Now let X be the actual lod.

As X tends towards B from A the bilinear sample will remain constant. Because you are taking the same exact sample from the higher mipmap every time.

So when X is infinitaly close to B it is still fine by your therom. So unless their is some major jump between "infinitaly close to B" then sample at B should be the same as a sample at A.

So now we can subsitute B for A and we can now use the Next lower MipMap C.
Repeat and we find out as long as we are doing linear downsampling we don't need mipmaps at all.

Your theory isn't correct when using 1 blinear sample it probably is correct when using 16 or 20 tap sample ( 4/5 wieghted bilinear samples ) but at that point it is far far far worse preformance wise.
__________________
Trolls find me soo tastey :P
bloodbob is offline   Reply With Quote
Old 22-May-2004, 12:04   #25
davepermen
Member
 
Join Date: Aug 2003
Location: Switzerland
Posts: 422
Send a message via ICQ to davepermen Send a message via MSN to davepermen
Default

depends, because if there is chance that you only need to load in one mip-layer into cache you can sample much quicker around on it.

ah, there are just too much factors. we need, quickly, another solution. api wise:

two ways to specify the filtering. eighter exact: i want pointsample, i want bilinear, i want trilinear, i want what ever.
or quality based: this texture needs good quality, this one nobody bothers, etc.

and then, for the exact ones, cards have to provide it. for the quality based ones, cards/drivers are free to do what ever they want. depending on the quality slider in the driver, and what the application requested, they can deliver. then, we can make fair comparisons to find out, at a certain visual quality, how good wich card performs.

that would be nice, not?
davepermen is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
3dfx Rampage ;) Ante P 3D Architectures & Chips 219 26-Feb-2012 19:48
New 3DMark03 Patch 330 Nick[FM] 3D Architectures & Chips 429 05-Jun-2003 00:28
Kyoto FLAMEWAR! RussSchultz General Discussion 91 14-May-2003 00:57
How does the NV30 really store PS programs? Arun 3D Architectures & Chips 19 20-Feb-2003 13:54
New version of RivaTuner released Babel-17 3D Hardware, Software & Output Devices 1 13-Jan-2003 13:14


All times are GMT +1. The time now is 23:32.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.