Locking mip map level causes major slow down.
by Nathan Tran · in Artist Corner · 01/04/2005 (6:59 pm) · 1 replies
Hi David,
When I lock the mip map level to zero I noticed that the frame rate dropped from 60-70 fps to a lowly 3-4 fps. The effect of having the mip map level locked produced a very nice and crisp textured model. I don't understand why there is such a slow down in frame rate, even at this mip level, since there is only one model in the display. The reason I'm asking is that I'm interested in having nicer looking models in game from a reasonable distance without the degradation of high mip map levels. Since the Show Tool experiences this major show down, will I see the same effect in a Torque made game if the mip map level is locked or at least kept to the lowest level for a reasonable distance away from the model. If mip map locking is possible in game, could you please give me some pointers on where I should looking in the engine code.
Thanks.
Nathan.
EDIT: You can check the difference in the following images.
Ambient Light=33% gray Direct Light=33% gray w/ Lighting Pack enabled. Mip level locked at zero. 3.4 fps.

Ambient Light=33% gray Direct Light=33% gray w/ Lighting Pack enabled. No mip level lock. 67 fps.

The texture quality degradation is most evident in the facial features. The texture map is 512x512. If I use another 512x512 texture for the face alone will it nullify the effects of the mip map level change?
When I lock the mip map level to zero I noticed that the frame rate dropped from 60-70 fps to a lowly 3-4 fps. The effect of having the mip map level locked produced a very nice and crisp textured model. I don't understand why there is such a slow down in frame rate, even at this mip level, since there is only one model in the display. The reason I'm asking is that I'm interested in having nicer looking models in game from a reasonable distance without the degradation of high mip map levels. Since the Show Tool experiences this major show down, will I see the same effect in a Torque made game if the mip map level is locked or at least kept to the lowest level for a reasonable distance away from the model. If mip map locking is possible in game, could you please give me some pointers on where I should looking in the engine code.
Thanks.
Nathan.
EDIT: You can check the difference in the following images.
Ambient Light=33% gray Direct Light=33% gray w/ Lighting Pack enabled. Mip level locked at zero. 3.4 fps.

Ambient Light=33% gray Direct Light=33% gray w/ Lighting Pack enabled. No mip level lock. 67 fps.

The texture quality degradation is most evident in the facial features. The texture map is 512x512. If I use another 512x512 texture for the face alone will it nullify the effects of the mip map level change?
About the author
Associate David Wyand
Gnometech Inc.
I've just tried mip map locking here using the TGE Orc (which has a 512x512 texture) on both my PC and Mac and only noticed a drop of 2-4 frames on average. I'm curious as to what system you're using?
The reason for the slow down is I'm calling a couple of extra OpenGL commands at each material change - which could be at each triangle strip or even each triangle change. Does your shape make use of triangle strips? And these commands are likely not something that you'd want to call that often during a game -- they should be moved up to at least the shape level rather than at the material level. Here they are:
These two commands set the base level and force it to stay there, respectively. If you want to only use the highest mip map level, then baseMipMapLevel would be 0. You'd use them during the shape rendering routines (can't get any more specific in a non-SDK forum).
In OpenGL there are other commands that allow you to setup when the next mip map level kicks in, I believe. You'd have to research this as I haven't looked into it yet.
However, if all you'd like is to have your DTS object not use mip maps, your DTS exporter should have an option called 'No Mip Maps' or something similar that you can set for each material or surface. This way you'd get the top level mip map without having to change any code. You can make sure that you're materials are set for no mip map from the Materials window in TST Pro.
If you'd like any more help, please let me know.
- LightWave Dave