R300 Mip-mapping LOD problem. (Warning, big screen shot)

Jamm0r

Newcomer
Hello. We have come across an odd problem in a D3D Simulation title we're working on, with R300 hardware. See:

problem.jpg


There are very distinct LOD lines on the landscape mips, which are dithered, or detail textured. This is with tri-linear filtering enabled. No other video cards display this issue.. any ideas?
 
The Radeon series performs an adaptive ansiotropic filtering algorithm which reduces the filtering with respect to the angle.

45º is the lowest on R200, and 22.5º on R300

There's some articles around somewhere...
 
Make sure the filtering is set to Quality in the ATI control panel, performance mode forces bilinear filtering with ansio IIRC.

Looks like trilinear isn't on, as the transitions are too distinct.
 
Even if it's lack of trilinear, there's way to much difference between the miplevels.

Does it look the same on other cards with trilinear and aniso disabled?
 
euank said:
The Radeon series performs an adaptive ansiotropic filtering algorithm which reduces the filtering with respect to the angle.

That's not the reason it's called adaptive.

45º is the lowest on R200, and 22.5º on R300

There's some articles around somewhere...

Yes and since this ground is around 0º this is not really relevant here...
 
Hyp-X said:
Even if it's lack of trilinear, there's way to much difference between the miplevels.

Does it look the same on other cards with trilinear and aniso disabled?

Nope. It looks fine on other cards with or without Aniso.
 
Well, our beta testers and end-users have tested on a myriad of video cards, including the entire GeForce and Radeon lines. I personally have only been able to test it on my Radeon 9700 Pro, but it's not just a problem on my end: Every single Radeon 9xxx user has reported the issue. I've been looking through the guts of the D3D code, from render block setup and texture stage assignments, to mip-map creation and multi-texturing code, but have found nothing that might explain it.
 
Hyp-X said:
euank said:
The Radeon series performs an adaptive ansiotropic filtering algorithm which reduces the filtering with respect to the angle.

That's not the reason it's called adaptive.

45º is the lowest on R200, and 22.5º on R300

There's some articles around somewhere...

Yes and since this ground is around 0º this is not really relevant here...

Well, would you care to clarify?

AF filtering level is reduced with respect to angle of the surface from the view point. If that's not adaptive what is?

The ground is not 0º with respect to the camera position is it? Looks like were looking dowm at an angle to me?

Please don't arrogantly shoot people down without backing up your reasons thanks.
 
Now now, no flame wars, ok? Just looking for some answers, which IMHO will probably point to the game code, not the r300 hardware. I have dozens of other sims / games that don't exhibit this problem, in almost identical circumstances.

To get back on subject here, I forgot to point out that the engine uses D3D7, but we do plan on upgrading it to D3D8. Are there some known incompatabilities / snafu's with D3D7 and r300 products that anyone knows of?
 
BEcause ATI's "adaptive AF" as you describe it, changes based not on the angle relative to the horizon, or the angle relative to a verticle, but rather on a rotational anglular basis.
Now, could we stop polluting jamm0rs thread?
 
euank said:
Hyp-X said:
euank said:
The Radeon series performs an adaptive ansiotropic filtering algorithm which reduces the filtering with respect to the angle.

That's not the reason it's called adaptive.

45º is the lowest on R200, and 22.5º on R300

There's some articles around somewhere...

Yes and since this ground is around 0º this is not really relevant here...

Well, would you care to clarify?

AF filtering level is reduced with respect to angle of the surface from the view point. If that's not adaptive what is?

The ground is not 0º with respect to the camera position is it? Looks like were looking dowm at an angle to me?

Please don't arrogantly shoot people down without backing up your reasons thanks.

There are different angles to describe the orientation of a polygon. ATI's problem with 22.5º and 67.5º in each quadrant refer to the roll axis. ATI's algorithm is spot on when it comes to the pitch axis, at least with the R300 series.

I'm sure Jamm0r understands. In that screen shot, the land has 0º rotation wrt the roll axis. The question is whether Jamm0r has any degree of anisotropic filtering on, and if performance mode is selected. Well, Jammor? If so, try using Quality mode, or even disabling AF altogether.
 
euank said:
Well, would you care to clarify?

Sure.
I've got the impression with you referring to those articles that you know what you talking about, so that's why I wasn't too specific.

AF filtering level is reduced with respect to angle of the surface from the view point. If that's not adaptive what is?

The ground is not 0º with respect to the camera position is it? Looks like were looking dowm at an angle to me?

First a little 3D.
There's no such thing like an angle between a point and a plane.

You can (in this case) calculate the angle between a line section and a surface. The line section is between the view point and a point of the surface.
The first thing you should notice is that because perpective projection this angle changes from point-to-point.

Not viewing a (part of a) surface perpendicularly means that the texture suffers a distorsion. (This is a generally applied oversimplification assuming the texture is mapped without distorsion in the first place - this is probably true in a terrain like this.)
By distorsion I mean that the texture is scaled differently in different directions.

This is actually not a problem until the texture is magnified, but causes trouble when minification is required.
Texture minification can cause undersampling which has aliasing effects (moire and the like.)
The usual solution is to select a mipmap that isn't have to be minified.
Unfortunately non-isotropic scaling poses a problem, because to avoid aliasing too much detail is dropped.

One solution would be to store "mipmaps" scaled non-isotropicly in different directions, and use the best one. This method is usually referred as rip-mapping. It has serious shortcomings (requires too much memory, yet it can provide perfect solution only in special cases.)

The solution that is more generic, but in the same time more computationally expensive is to take multiple samples in the direction the texture is more squished. This oversamples the texture in that direction and therefore it allows the selection of a more detailed mipmap without aliasing.

The minimum number of samples needed is at least as much as the "squish ratio" of the texture or in other words the quotient of the largest scaling and the smallest scaling.

If the surface is perpendicular there's no anisotropic filtering required.
If the angle between the surface and the viewing line section is larger than 30° than 2x anisotropy is sufficient.
If the angle between the surface and the viewing line section is larger than 19.47° than 3x anisotropy is sufficient.
If the angle between the surface and the viewing line section is larger than 14.48° than 4x anisotropy is sufficient.
And so on.
So an implementation doesn't have to apply more than said levels of anisotropy, and an implementation that has fine grain detection of the required level is called adaptive.
Don't worry nVidia's implementation is adaptive too!

As for the problems of R200 and R300.

First of all R200 has a problem that it turns on the required level of anisotropy too late which cases aliasing similar to LOD bias.
This has been fixed in R300, and so the performance mode of R300 has much higher quality than the R200 mode.

The other problem is however in ATI card is the way it detects the need for anisotropy, or in other words "how the texture is squised".
There are always two distinct directions with such a texture, the direction it is scaled the most and the direction that it scaled the least. (I'm talking about screen space directions now - so in 2D.)
These two important directions are always perpendicular and one of them is the directions the texture is needed to be sampled multiply times during anisotropic filtering.

The problem is with R200 that it can detect the correct level of anisotropy when these directions are vertical and horizontal. Between them the detected level of anisotropy drops until at 45° there is no anisotropy applied anymore.
With the R300 the detection is extended to include +/- 45° cases, so it's worst cases are at 22.5° and 67.5°.

But don't confuse these angles which are in 2D in the screen space and are measured relative to the X or Y axes of the screen, and the 3D angles between the viewing line section and the surface that is the source of anisotropy.

The easiest way of shifting those 2D angles is to rotate the screen around the center, which means rotating the camera around the Z axis. To determine this angle of a surface, project the surface normal to the screen and measure the angle beetween that and (say) the X axis of the screen.

Again, this angle is independent of the other angle that is the source of anisotropy.

Hope it explains the issue, feel free to ask questions, if it wasn't clear.
 
Interesting. I turned off AF, and the hard mip lines were gone, smoothed by tri-linear filtering. Turned it back on, and the lines were back, in both performance and quality mode. What does this mean?
 
Jamm0r said:
Interesting. I turned off AF, and the hard mip lines were gone, smoothed by tri-linear filtering. Turned it back on, and the lines were back, in both performance and quality mode. What does this mean?
this means that quality mode isnt working :)
 
Try rebooting or changing resolution after altering D3D settings in the ATI control panel. Some people at rage3d report problems of changes not taking effect after clicking apply.

Is there anywhere to download a demo of the sim?

ps if this were ExpertsExchange points go to Mintmaster ;)
 
Althornin said:
Jamm0r said:
Interesting. I turned off AF, and the hard mip lines were gone, smoothed by tri-linear filtering. Turned it back on, and the lines were back, in both performance and quality mode. What does this mean?
this means that quality mode isnt working :)

Yeah, bug time, and is it just me or does it look like AF isn't really working on the 'third' mipmap level (errr, after the second arrow)? It looks too blurry.
 
I taking this straight out of thin air, but is it possible that the r300 uses a fast trilinear filtering where the lower one of the two mipmaps being filtered is generated from the higher one, instead of being read out of memory?

That would create mipmap bands when the mipmaps look different from each other.
 
Jamm0r said:
Hello. We have come across an odd problem in a D3D Simulation title we're working on, with R300 hardware. See:


There are very distinct LOD lines on the landscape mips, which are dithered, or detail textured. This is with tri-linear filtering enabled. No other video cards display this issue.. any ideas?

Didn't I read a post by you guys a few months ago on this exact same issue? As I recall it concerned R300 hardware then, as well. Maybe not, but these screen shots, and the complaint, seem pretty darn familiar...

I would assume you've contacted ATi about this by now--what do they have to say?
 
Althornin said:
this means that quality mode isnt working :)

Or it could mean that the engine behaves a bit differently than we expect it to with ATI's aniso implementation.

Jamm0r,

Try this: With Quality mode on and aniso turned on, do some slow barrel rolls (assuming camera stays fixed relative to the plane: so the plane always appears in the same position, and the scenery "rotates around" the plane.) Does the mip-map boundary "fade in" and "fade out" depending on the bank of the plane?

If not, then what Althornin is suggesting is probably correct: that you aren't able to get Quality mode forced on for some reason.
 
Back
Top