View Issue Details

IDProjectCategoryView StatusLast Update
0001026FSSCPOpenGLpublic2006-08-11 21:17
ReporterTolwyn Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionopen 
Product Version3.6.9 
Summary0001026: DDS maps are blured in OpenGL (work fine in D3D)
DescriptionPictures speak more than thousand words, so here we go:

Thunderbolt in D3D

http://www.wcsaga.com/~team/Starman/pics/thund1.jpg

Thunderbolt in OGL (On Catalyst, Radeon 9800 Pro/X700 Mobile) (Looks so bad like it is using the LOD3-Texture :( It looks washed out and the details are lost, and it's greyish)

http://www.wcsaga.com/~team/Starman/pics/thund2.jpg

Thunderbolt in OGL, backwards, the structures of the textures are now shimmering through the shinemap

http://www.wcsaga.com/~team/Starman/pics/thund3.jpg

I am not sure about Nvidia cards, I think that it is less of a problem there. My eyes could deceive me though
Steps To ReproducePlay the game with dds maps :)
Additional InformationI am not sure if this issue was introduced in newer builds or was always present. We recently switched

a) from d3d to OpenGL
and
b) from pcx to dds
TagsNo tags attached.

Activities

taylor

2006-08-08 17:54

administrator   ~0006399

What is "3D Hardware Textures" set to in the detail settings screen? That determines the highest mipmap level to use so if it's not maxed out then you wouldn't be seeing the highest detail level of the texture. Also, do you have anisotropic filtering enabled? What is it set to?

Backslash

2006-08-08 18:14

developer   ~0006401

Hmm, the anisotropic filtering may be it. It was at 1x (is this the same as off?). I just tried setting mine to 4x and it looks a lot better. I'm confused though; why does D3D not need this and yet OGL does?

taylor

2006-08-08 19:03

administrator   ~0006404

OGL is a lot more optimized so it's actually making proper use of all settings to not only give good performance, but allow you some real control over how it performs compared to how it looks. And, yes, 1x is the same as off.

D3D is broken, so what it does is actually the bug. D3D still doesn't use mipmaps properly anyway as far as I know. Since anisotropic filtering only affects mipmaps, if D3D isn't doing it right then the setting would be ignored anyway.

OGL is doing the right thing here. Except maybe for the shimmering thing, but I don't see anything wrong in that screenshot so I'm not really sure what the issue is there, or if there really is one. Mixing textures with mipmaps and textures without mipmaps on the same object can produce a strange shimmering effect for instance, but that's not a code issue, it's a data issue.

Tolwyn

2006-08-08 19:11

reporter   ~0006406

unfortunately we do not have original files, so our texture maps do not have mipmap data. Spec maps on the other hand were redone in TGA, so they might have mipmap information.

Tolwyn

2006-08-08 19:13

reporter   ~0006408

So, actually we have no choice but to roll back to pcx, right?

taylor

2006-08-08 19:41

administrator   ~0006409

Only DDS images can have mipmaps. Mipmaps are just smaller versions on the same image stored in the one image file. You don't actually create them yourself, when you convert/save an image as DDS then it creates the mipmaps automatically. If any map on an object is using mipmaps then ALL maps on the object needs mipmaps. If the normal texture is DDS with a full mipmap chain, and your specmap is TGA, then your data is broken and you are going to get graphics glitches.

DON'T use PCX, DON'T use TGA, DON'T use JPG, for ANYTHING. Use DDS for all texture maps and effects, with full mipmaps chains, and your will data will need less memory, perform much better, and look better.

Just see the creating efficient models thread since it explains all of this. If you follow those instructions then it not only makes things easier for you but much better for the people who play your mod.
(http://www.hard-light.net/forums/index.php/topic,37158.0.html)

Tolwyn

2006-08-08 19:44

reporter   ~0006410

well, those guidelines should match our models. Still pcx looks better. I have no idea why.

Backslash

2006-08-09 00:53

developer   ~0006413

In the case of the Thunderbolt, there are 3 textures, each with a shinemap and 2 additional smaller LOD textures. And it's all been converted to DXT1c by me. I've doublechecked the texture itself and it's not a problem of compression artifacts, and the mipmaps all look fine.

While normally I would agree with you, taylor, and assume Direct3D is the one messing up, I'm finally noticing that there is a problem. (I don't see the problem as much in Thund3, but the difference between Thund1 and Thund2 is obvious, or at least it should be. Look at the purple bits in particular.) It's even more noticable in motion. For a good example, watch the Confed logo as you rotate the ship; as the logo approaches an angle, it gets more blurry than it should.

(taylor, have you been given access to our stuff?)

Ok, just for fun, let's do a blind test. Of the three uploaded test files, which is Direct3D and which is OpenGL? :-) You might be surprised.

2006-08-09 00:53

 

TestA.tga (92,239 bytes)   
TestA.tga (92,239 bytes)   

2006-08-09 00:54

 

TestB.tga (94,811 bytes)   
TestB.tga (94,811 bytes)   

2006-08-09 00:54

 

TestC.tga (94,439 bytes)   
TestC.tga (94,439 bytes)   

taylor

2006-08-09 03:14

administrator   ~0006414

It's doing exactly what it's supposed to do, or as least it is from what you describe. As you rotate the ship, the view angle changes and it's using different mipmaps levels at the same time. With trilinear filtering enabled, and the anisotropic filter set at a decent level, the difference between mipmap levels shouldn't be all that obvious.

As far as your images are concerned, TestA is obviously OGL since it's using mipmaps properly, but the filtering is set wrong. TestB also looks OGL, but with a more appropriate anisotropic filter setting to sharpen the mipmap changes. My first guess would be to call TestC D3D, but as I don't use D3D I don't really have anything to compare against for any of these images.

I don't have access to the data, but I need at least this POF and it's textures to see for myself what the problem is. Right now it just looks like bad settings on your side and this is the same thing that I have been shown before. Previously is was largely user issue (game and video card settings) and partially data issue.

The code isn't perfect, to be sure, but it's impossible to tell what the issue is here just from these screenshots. So far I've seen nothing to indicate a code issue though, just bad settings.

Backslash

2006-08-09 04:28

developer   ~0006415

OH! I hadn't realized it was supposed to be showing multiple mipmap levels at the SAME time. Now a bit more of what you were saying makes sense. You're spot on for the guesses; my confusion made me think you weren't seeing the problem.

What could 'the filtering is set wrong' be? That picture was with 1x anisotropic filtering, which is default, so is that 'wrong'? I figured such filtering was icing on the cake, much like anti-alias. So what level should be considered standard? Does this depend on the machine? Obviously I'm not understanding it all yet. I have made sure all the FS2 detail settings are maxed, and the graphics card control panel-specific settings are on the defaults so that there's no AA or other such things interfering...

I'll send you the Thunderbolt files.

taylor

2006-08-09 05:19

administrator   ~0006418

It will use whatever mipmap level best fits the geometry, which means that it can use any number of different levels for the same texture on the model at one time. This can not only provide a more accurate visual presentation, but also help with performance.

There are two filters that come into play with mipmaps though. The first being the minification filter: bilinear or trilinear. Trilinear is now the default and it will blend different mipmap levels in a 3 step process (hence 'tri'), to help hide the hard edge where one mipmap level ends and another begins. The second filter, the one that can make a big visual difference, is the anisotropic filter. You can basically think of that filter as a sharpening filter, to help prevent the mipmap level changes from looking so blurry, which is a much bigger problem when the texture is at an angle from the viewer (as you have noticed).

That's what the first test image showed, mipmap changes with no anisotropic filter in effect. At a setting of 1x the filter is disabled, it has to be at least 2x to do anything. 4x will generally provide a great boost in visual quality, but with practically zero hit to performance. The better your hardware the higher you can raise the setting. I wouldn't consider a setting of 1x actually 'wrong', but that is what is causing the problem you are describing, and that's just how the mipmap thing works, so it's not a bug.

There is also the issue of video card settings of course. You can set your video card to override both AA and AS (anisotropic filter) settings by the game. In order to have the AS setting work as expected the video card drivers need to NOT override application settings (should be something in the graphics control panel about it). I don't think that any driver defaults to that behavior, but it's always something I like to point out just in case.

Does that make a little more sense?

taylor

2006-08-11 21:17

administrator   ~0006446

Not-A-Bug

Issue History

Date Modified Username Field Change
2006-08-08 15:57 Tolwyn New Issue
2006-08-08 17:54 taylor Note Added: 0006399
2006-08-08 18:14 Backslash Note Added: 0006401
2006-08-08 19:03 taylor Note Added: 0006404
2006-08-08 19:11 Tolwyn Note Added: 0006406
2006-08-08 19:13 Tolwyn Note Added: 0006408
2006-08-08 19:41 taylor Note Added: 0006409
2006-08-08 19:44 Tolwyn Note Added: 0006410
2006-08-09 00:53 Backslash Note Added: 0006413
2006-08-09 00:53 Backslash File Added: TestA.tga
2006-08-09 00:54 Backslash File Added: TestB.tga
2006-08-09 00:54 Backslash File Added: TestC.tga
2006-08-09 03:14 taylor Note Added: 0006414
2006-08-09 04:28 Backslash Note Added: 0006415
2006-08-09 05:19 taylor Note Added: 0006418
2006-08-11 21:17 taylor Status new => closed
2006-08-11 21:17 taylor Note Added: 0006446