| View previous topic :: View next topic |
| Author |
Message |
Recipio
Joined: 14 Aug 2005 Posts: 11 Location: Sweden
|
Posted: Sat Sep 30, 2006 10:14 pm Post subject: Mipmapping |
|
|
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? |
|
| Back to top |
|
 |
siberianstar
Joined: 22 Jun 2006 Posts: 70
|
Posted: Tue Oct 03, 2006 5:44 am Post subject: |
|
|
| Quote: | | The 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. |
www.goop.org/psp/gl |
|
| Back to top |
|
 |
rapso
Joined: 28 Mar 2005 Posts: 147
|
Posted: Tue Oct 03, 2006 9:35 pm Post subject: Re: Mipmapping |
|
|
| 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. |
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. |
|
| Back to top |
|
 |
Recipio
Joined: 14 Aug 2005 Posts: 11 Location: Sweden
|
Posted: Sat Oct 07, 2006 9:25 pm Post subject: |
|
|
Sorry, almost forgot to write back here. I got a pm from shazz saying I should do the following:
| Code: | 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 |
And that worked. :) |
|
| Back to top |
|
 |
|