Game Development Community

How to control the texture mimap ?

by Frank Bignone · in Torque Game Engine · 04/28/2002 (11:02 am) · 6 replies

I have a problem on some my maps when putting dts object. Texture appears only when very close. Now the thing is the first screenshot is taken from closer to the signpost than the building, and the building is okay ???

From close, but not enough (yet the building is okay)
mapage.noos.fr/tut/Jaws1.jpgFrom where you can, at last, read the signpost (but this would only be 2% of the time to be that close :( )
mapage.noos.fr/tut/jaws2.jpg
It seems like texture are mip-mapped and that the model is loading the low-res texture too fast. If you have any idea how can I control it or where I should look like, please give me a sign ;)

About the author

Real programmers don't waste time recompiling; they patch the binary files... ... Real programmers don't waste time patching binary files; they patch memory.


#1
04/28/2002 (11:08 am)
You can do at least 2 things.

1) Make the base texture bigger.
If its 64x64 now, you could redo it at 128x128 which means the 32x32 mipmap will be used 1 level later.

2) You can export the dts with mipmaps control.
IF you do this it will not use mipmaps.

www.garagegames.com/docs/torque/tools/max2dts/section4.html#mip

Its in the exporter doc.

Hope this helps you a bit.

// Clocks out
#2
04/28/2002 (11:51 am)
Thks for the tips.
Is it possible to set the different level of detail of a texture instead than having the engine sub-sampling it from the high-res image, in the current engine ? (if no, I will maybe add it in the engine)
#3
04/28/2002 (11:56 am)
You could use the LOD's and apply different textures to them. Thats probably not what you meant.

You want to control the distance at which the mipping kick in?

That could be be useful to have as a parameter in the options settings.

That way high-end players could set the mip distance to 200 meters and low-end could set it to 20 meters.
Just like you can control teh fog distance in many new games.

// Clocks out
#4
04/28/2002 (12:24 pm)
Frank,

Just a quick check but do you have trilinear filtering switched on?

Look in the preference files for
$pref::OpenGL::textureTrilinear
The following should tell you:
echo($pref::OpenGL::textureTrilinear);
If it's off you're getting bilinear.

- Melv.
#5
04/28/2002 (12:43 pm)
Also ...

There are some extra tokens defined in OpenGL 1.2+ that allow you to control the LOD on mipmaps. I've implemented these in the headers and will be submitting them to the codebase soon.

Melv.

For your information...

Quote:
GL_TEXTURE_MIN_LOD
Specifies the minimum level-of-detail (LOD) that is allowed. The minimum LOD is set to the value specified by params. Unlike the GL_TEXTURE_MAX_LEVEL, the minimum LOD can be varied continuously over the full range of the mipmap levels. Setting the minimum LOD allows the application to smoothly manage the transition to a higher- or lower-resolution texture. The default values is -1000.

GL_TEXTURE_MAX_LOD
Specifies the maximum level-of-detail (LOD) that is allowed. The maximum LOD is set to the value specified by params. Unlike the GL_TEXTURE_MAX_LEVEL, the maximum LOD can be varied continuously over the full range of the mipmap levels. Setting the maximum LOD allows the application to smoothly manage the transition to a higher- or lower-resolution texture. The default values is 1000.

GL_TEXTURE_BASE_LEVEL
Specifies the base level of the set of mipmap image arrays. The base level is set to the integer value specified by params. Setting the base level to a value other than 0 permits a subset of mipmaps to be loaded and initially used at a low resolution. Only the levels between base level and max level (inclusive) must be loaded. (Other levels may be loaded, but only the levels from base through max will be used). The default value is 0.

GL_TEXTURE_MAX_LEVEL
Specifies the maximum level for the set of mipmap image arrays. The maximum level is set to the integer value specified by params. Only the levels between base level and max level (inclusive) must be loaded. (Other levels may be loaded, but only the levels from base through max will be used). The default value is 1000.
#6
04/29/2002 (5:19 am)
Thx for the tips