MipMap distance

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

Moderators: cheriff, TyRaNiD

Post Reply
AnonymousTipster
Posts: 197
Joined: Fri Jul 01, 2005 2:50 am

MipMap distance

Post by AnonymousTipster »

With mip mapping, is there a way to set the distance away a texel has to be to change to the next mipmap? At the moment the texture is getting too blurry too soon, so I'd like to push the distance back.
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

Try and play with sceGuTexLevelMode(), that could perhaps help with the issue.
GE Dominator
AnonymousTipster
Posts: 197
Joined: Fri Jul 01, 2005 2:50 am

Post by AnonymousTipster »

Thanks chp, I've got it.
av
Posts: 7
Joined: Sun Jan 01, 2006 11:15 am

Post by av »

Hi,

I've been beating my head over the usage of sceGuTexLevelMode(int, float). Does anyone have any tips on what those two arguments are? I'm having a similar problem with the lower mip levels getting too blurry.

My initial guess was that the int was to specify a mip level and the float some mip bias. But then I looked at some of the ge register list at http://wiki.ps2dev.org/psp:ge_register_list and saw that there is only one 16 bit value stored for each of the two arguments. Should they really be int and float? Seems suspect to me.

Since there is only one set of 16-bit values stored, I'm assuming that this isn't set per mip level but instead strored globally.

Any ideas on how to set these values sanely? What is the default?

Thanks!
AnonymousTipster
Posts: 197
Joined: Fri Jul 01, 2005 2:50 am

Post by AnonymousTipster »

I got some sort of mipmapping working for my ODE port : http://forums.ps2dev.org/viewtopic.php?t=3944
but I didn't use sceGuTexLevelMode(), because it would either make it too far away or too near.
I'm pretty sure that the int is for the index to the mipmap, and the float is the weighting that it gives it. What you may want to try is binding the values to buttons, so X and O change the int and [] and ^ change the float value. This way you can test out every value and see which one works best.
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

The correct mipmap level to use is based on the size of the triangle you are rendering and the number of pixels it uses from the texturemap.
Say your triangle covers 30 screen pixels, then ideally it will use 30 texture pixels too.
You can use the 2d cross product to find out these areas.

Alternatively, as many people do, base the mipmap level on the z of the triangle.

Jim
av
Posts: 7
Joined: Sun Jan 01, 2006 11:15 am

Post by av »

Thanks for the replies...but I'm still a bit lost on how those values are used. I played with binding the variables to the joystick before and it really makes no sense.

Another confusing thing is that when you call sceGuTexScale (float, float); with anything other than sceGuTexScale (1.0f, 1.0f); the mip bias is very different and blurrier in the lower mip levels. Very strange.

Thanks.
av
Posts: 7
Joined: Sun Jan 01, 2006 11:15 am

Post by av »

Sorry, just to clarify, my tests show that the float argument to sceGuTexLevelMode(int, float) seems to be a very simple mip bias, but the int argument makes no sense at all.

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

Post by jsgf »

Is it a mode which affects how the bias is interpreted?
Post Reply