New mipmap LOD calculation in D3D10 Refrast

Demirug

Veteran
I am just started to write a new Direct3D texture filter tester to test my managed Direct3D 10 layer. As I have no D3D10 hardware yet I was forced to use the Refrast. I was surprised that it used a new algorithm to calculate the mipmap lod.



Disclaimer: The refrast I used for this image is still in Beta and subjected to change.
 
The refrast is slow anyway, so why not turn it into a real quality reference?
But I wonder, where do those four red pixels come from?
 
Okay, so at the risk of sounding like a complete "n00b"... :oops:

What exactly am I looking at? I'm familiar with Mip-Maps and so on, but I've never had much need to dig into their finer implementation details.

I just had a dig around in some of my resources and I couldn't find any obvious mention of a new LOD algorithm/method. Could've missed it, or it might just be a by-product of the better defined precision of such operations..?

Cheers,
Jack
 
Jack, from the programmer’s point of view you don’t need to care about LOD calculation because you have not much influence anyway. But if you are in GPU review business it has become very important during the Direct3D 9 timeframe. The reason is that you normally need high levels of AF and AA to drive the newest high end solution to their limit. The IHVs learned their lessons very fast and “improvedâ€￾ the mipmap LOD calculation in a way that their texture units will use less texel than before. This improves the AF-performance but it could cause a reduced visual quality. The classical IHV excuse for such a “improvedâ€￾ =(less accurate) LOD calculation is that the need to save transistors.

One way to show the LOD calculation is the usage of colored mipmaps. There are stand alone programs (an OpenGL version from Xmas and one for D3D9 from me). Or such a test is integrated in a larger test suite (like 3DMark) and even some games have an option for this (UT).

As for D3D9 my new D3D10 version let you look inside a pipe. It use one texture were every mipmap is filled with a different color. The sampler is set to 16xAF. This shows you for every pixel which mipmaps are used. The circles you see on the D3D10 shots apply generally as the optimum quality. You can find compare shots from different chips in some GPU reviews.

Some people in the community hope that Direct3D 10 force the IHVs to use one general way to calculate LOD to make results more comparable.
 
Demirug said:
Jack, from the programmer’s point of view you don’t need to care about LOD calculation because you have not much influence anyway.
Ah, okay... I've read various discussions about messing with the D3D9 LOD bias, but never had any need to use it myself. Thanks for the explanation :D


The IHVs learned their lessons very fast and “improved” the mipmap LOD calculation in a way that their texture units will use less texel than before. This improves the AF-performance but it could cause a reduced visual quality. The classical IHV excuse for such a “improved” =(less accurate) LOD calculation is that the need to save transistors.
Some people in the community hope that Direct3D 10 force the IHVs to use one general way to calculate LOD to make results more comparable.
Okay, well the information I have does dictate minimum resolution/accuracy for all sampling calculations - mip mapping included. I dont know how this compares with the D3D9 spec (dont have that to hand), but maybe it is a simple by-product of improved accuracy? Across the board D3D10 is much stricter about (minimum) precision and so on...

Cheers,
Jack
 
Demirug said:
I am just started to write a new Direct3D texture filter tester to test my managed Direct3D 10 layer. As I have no D3D10 hardware yet I was forced to use the Refrast. I was surprised that it used a new algorithm to calculate the mipmap lod.



Disclaimer: The refrast I used for this image is still in Beta and subjected to change.
The full blue ring and the full red ring appear to be rather thick. Not sure about the green one.
In other words, it looks somewhat like brilinear to me.
 
Any explanation for the red pixels?
Btw, how many sides does the tunnel have, and is antialiasing enabled?
 
Xmas said:
Any explanation for the red pixels?

Not so far. I am currently not under Vista to run some more tests.

Xmas said:
Btw, how many sides does the tunnel have, and is antialiasing enabled?

200 (but I can change this as in the D3D9 version) and it's even slow like hell without AA.
 
Demirug said:
I am just started to write a new Direct3D texture filter tester to test my managed Direct3D 10 layer. As I have no D3D10 hardware yet I was forced to use the Refrast. I was surprised that it used a new algorithm to calculate the mipmap lod.



Disclaimer: The refrast I used for this image is still in Beta and subjected to change.
Finally.

May be NV40's isotropic (and 2x AF) pattern is a sort of a forecast to D3D10?



zeckensack said:
The full blue ring and the full red ring appear to be rather thick. Not sure about the green one.
In other words, it looks somewhat like brilinear to me.
With a tool of a friend of mine I got a line analysis (for the mouse to be placed in the middle of the inner circle)

Bild4.png





If I adjust the image with gamma around 0,7, the curved rgb intensity is nearly linear.
 
Last edited by a moderator:
A few more words Aths on what we're looking at, and why we should care, for us technically-challenged types?
 
I think some of the problem is in the choice of colours used for the mip levels. It's making the red level look much bigger as it's blends very well into the magenta and then orange then yellow levels then bright green, while blue->green->red don't blend well
 
Fwiw, I got some more information on this matter from RedBeard over at gamedev.net (and also #graphicsdev on irc.afternet.org). He's one of the testers for D3D10 over at MS, and iirc he's reponsible for testing texturing in '10.

[10:25] <Cypher> http://img11.picsplace.to/img.php?file=img10/6/AFTest10.PNG D3D10 refrast has some badass texture filtering. I wonder if AF accuracy like that is a part of the '10 spec *looks at Redbeard*
[16:12] <RedBeard> unforunately not. i would like it to be, but we can't hold the hardware people to such accuracy
[16:13] <RedBeard> i'm working on the anisotropic test app, so i'm quite familiar with what i can and cant expect from hardware

So, that's just the refrast that's going crazy. Guess ATi and NV don't have to follow that
 
Cypher said:
Aths, could you provide a wireframe shot of the image so that we can see the geometry?
I analyzed a 2D shot and therefore cannot show a wireframe. What you see is a tunnel out of 200 rectangles arranged to made a big cylinder. You look right into one apertue. The colors represent the mipmap level used for any visible quad. No color (white) means, the basemap is used.

Due to the greater distortion (and minification) near the center (the second aperture) the filter algorithm uses higher mip map levels (with lower resolution).

geo said:
A few more words Aths on what we're looking at, and why we should care, for us technically-challenged types?
The line analyses gives an idea of how linear the blending of the mip map level is.

- Interestingly, the blending looks not linear at all, becaue you can see a curved gradient. This can be explained by to the non-linear distortion (and minifacion) level when you move to the center. But I assume that the actual blending on a linear gradient is (of couse) linear.

- The thick red area is confusing. This looks quite "brilinear". On the other hand, all the other mips do not look "brilinear", so this could be an effect of the particular mip map coloration.
 
Last edited by a moderator:
Thanks. :)

Are the colours arbitrarily chosen and how do you know what is supposed to be there or not (referring to talk about "red")? (I'm interested in the bottom two graphs in that large picture, but my...German? is a little fuzzy. :p)
 
Alstrong said:
Thanks. :)

Are the colours arbitrarily chosen and how do you know what is supposed to be there or not (referring to talk about "red")? (I'm interested in the bottom two graphs in that large picture, but my...German? is a little fuzzy. :p)
The colors of the MIP-map-coloring are chosen by the programmer of the tool. It is common to use red - green - blue, and then mixed colors. In Demirug's tool, which is mostly a D3D-version of Xmas' original tool for OpenGL, the next colors are pink (red+blue), cyan (green+blue), yellow (red+green) followed by red - green again. (With LOD-biasing you can shift the pattern to get the following blue.)

This colors are, as stated, defined by the programmer of the filter testing tool.

The big screenshot is made with the mouse cursor placed in the middle of the circle. The left-hand diagram shows a line analyzis, the right-hand one the column analyzis of the RGB, Hue and Value values. (This program was written by a friend for "eye detection" from of a photograph. You can use certain characteristics of these line and column analyzises to detect the eye's pupil.)
 
Back
Top