forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mipmapping

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Recipio



Joined: 14 Aug 2005
Posts: 11
Location: Sweden

PostPosted: Sat Sep 30, 2006 10:14 pm    Post subject: Mipmapping Reply with quote

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
View user's profile Send private message MSN Messenger
siberianstar



Joined: 22 Jun 2006
Posts: 70

PostPosted: Tue Oct 03, 2006 5:44 am    Post subject: Reply with quote

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
View user's profile Send private message
rapso



Joined: 28 Mar 2005
Posts: 147

PostPosted: Tue Oct 03, 2006 9:35 pm    Post subject: Re: Mipmapping Reply with quote

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
View user's profile Send private message
Recipio



Joined: 14 Aug 2005
Posts: 11
Location: Sweden

PostPosted: Sat Oct 07, 2006 9:25 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group