I can't get the mipmapping to work the way it should. I tried loading three different images (the same image of different sizes) but it seems to choose the wrong mipmap level at the wrong places. It seems it's depending on the angle in which I'm looking at the polygons rather than the z-value. I'm using draw arrays to render the polygons. I've seen this problem discussed in other threads but I haven't found a solution to it anywhere.
To debug it I tried using a red image for the largest mipmap level, a green for the middle and a blue for the lowest. The ground closest to the camera is somewhere between red and green and a bit forward it fades out to blue. That seems quite like I want it, but further away I have walls facing the camera and they are entirely red.
Has anyone got the built in mipmapping to work the way it should? If not, what's the best way to do the mipmapping manually?
Mipmapping
-
- Posts: 70
- Joined: Thu Jun 22, 2006 9:24 pm
www.goop.org/psp/glThe PSP hardware seems to have a bug where a texture viewed from a particular angle will use larger mipmaps than necessary, which means the appearance will change on screen as view angle changes, and there may be a performance impact.
Re: Mipmapping
it sounds correct. the mipmap level is selected depending on the ratio between the pixels and texels. a triangle that is facing toward u, usually has less pixels per texel than a triangle on the ground.Recipio wrote: To debug it I tried using a red image for the largest mipmap level, a green for the middle and a blue for the lowest. The ground closest to the camera is somewhere between red and green and a bit forward it fades out to blue. That seems quite like I want it, but further away I have walls facing the camera and they are entirely red.
Sorry, almost forgot to write back here. I got a pm from shazz saying I should do the following:
And that worked. :)
Code: Select all
float slope = 0.4f;
sceGuTexLevelMode(2, 0.f); // manual slope setting
sceGuTexSlope(slope); // the near from 0 slope is the lower (=best detailed) mipmap it uses