Strange Mipmap selection

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Strange Mipmap selection

Post by jsgf »

The PSP hardware seems to make very strange mipmap selections; in fact, it seems to depend on the orientation of the texture. Has anyone else seen this?

I have a simple demo which draws a ground plane which spins around. From some viewpoints, the mipmap selection is as you'd expect (using levels 2-6), but as it turns it ends up using levels 0-2 for the whole plane. Not only does this mean that the appearance changes as the camera turns, but there's a large, obvious framerate slowdown.

I'm not swizzling my textures, which will be the next thing to try; maybe the PSP's mipmap selection depends on the stride through texture memory.

But I'm really wondering if this has to do with the other mipmap LOD-looking registers, like bits 8-15 in TexMode (#194) or the texture slope register. Has anyone experimented with these?

I've put my test program up at http://www.goop.org/psp/gl/mipmap-test.zip so you can see what I'm talking about (don't worry about the stripes in the sky; I think that's just an incorrect max-mipmap level for that texture). Circle pauses, triangle turns of mipmaps, X exits.
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

Weird, I'll have to try this later.
Swizzling shouldn't affect mipmap selection, but WILL give you a big speedup.
http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come.
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Post by jsgf »

Yeah, swizzling makes no difference to mipmap selection, though it does remove the variable speed.

I tried playing with the texmode bits 8-15, and the texture slope, but I didn't see any obvious effect - certainly no improvement.

I just noticed the texture level bias setting; I'll give it a tweak, though I don't think it should have any effect.

The range of angles which cause the problem seem quite narrow (~10 deg?). I wonder if its just a hardware bug?
dankydoo
Posts: 11
Joined: Tue Mar 29, 2005 2:39 am

Post by dankydoo »

The game burnout does this too when you are doing 'crash' mode. The camera will zoom in on your car, and it continuously swaps mip-maps for the ground back and forth. It's very strange, I always wondered why the wouldn't have fixed such an obvious bug, maybe it is hardware....


dankydoo
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Post by jsgf »

Huh, sounds like it. Could you download my test program (linked to above) and tell me if it looks similar?
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

Yep, looks like a hardware bug, and similar to what can happen in burnout.
http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come.
Blackrider
Posts: 8
Joined: Wed Mar 29, 2006 1:22 pm

Post by Blackrider »

I'm having the exact same problem, I can't get rid of it. I don't buy the theory that it's a hardware bug, as it seems to work in some games but not for others.

As some time has passed, since this was first written, has anyone found any solution or if it is a bug how should I work around it?
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Post by jsgf »

I think it is a hardware bug, simply because I can't think of any good reason for it to behave in the way it does. If it hits some games and not others, take that to mean that it happens with some combinations of state and not others. I haven't managed to find a way to avoid the problem.

It's possible that developers are working around it by using manual texture LOD rather than automatic. I haven't tried that yet.
Post Reply