Game Development Community

Help With Bad Dif Mipmapping

by Bryce Kaminsky · in Torque Game Engine · 09/06/2005 (11:13 pm) · 15 replies

I decided to make a .dif of a dumpster so you could get in and it would have proper collsion boxes and it worked fine that way but i walked back about 10 feet from this bin and BAM. The texture took a dive for the worst. No longer was i able to read the writing on the side it was a giant blur box.

Question:
Is there a fix for the mipmapping issue with DIF files?

#1
09/07/2005 (1:05 am)
It's not a mipmapping issue; it's actually more subtle (specifically, the engine swaps out the bottom part of the mipchain when it thinks models are out of range). Out of curiosity, did you scale it when you placed it in game?
#2
09/08/2005 (12:07 pm)
I did i fit it to the side. Its really the only way to do it in quark. The texture tool is otherwise impossible to use so i just fit it.
#3
09/08/2005 (12:40 pm)
I'm interested in this issue as well... is there any way to _tell_ the engine when the models are out of range? Is it based on the LOD pixel size at all?
#4
09/08/2005 (2:25 pm)
I went into the code to take out the mipmapping section and still not affect.
Before
img61.imageshack.us/img61/6320/before1al.jpgAfter
img136.imageshack.us/img136/3387/after4ts.jpg
#5
09/08/2005 (3:40 pm)
Usually changing the texture size will help fix this. I can never remember if you should make it larger or smaller but a few simple tests should determine it.
#6
09/08/2005 (6:15 pm)
Bryce, did you remove mipmapping or the small texture check? It's the latter you need to poke at.
#7
09/08/2005 (6:18 pm)
I went in a removed the useSmalltextures( cont bool t) { return };

still having a problem with the texture.

I will however test the size to see if a les detailed or more detailed works.
Testing.... please standby....
0%.....
#8
09/08/2005 (6:26 pm)
You wannt to blase the lines that say:

TextureManager::setSmallTexturesActive(true);

There's one, on line 927 of interiorInstance.cc.
#9
09/08/2005 (6:32 pm)
// We need to decide if we're going to use the low-res textures
Point3F camPoint = state->getCameraPosition();
Point3F closestPoint = getRenderWorldBox().getClosestPoint(camPoint);
F32 dist = (camPoint - closestPoint).len();
if (dist != 0.0)
{
F32 length = dglProjectRadius(dist, 1.0f / pInterior->mAveTexGenLength);
if (length < (1.0 / 64.0)) <----------------------------------------------------------------- Increased
{
TextureManager::setSmallTexturesActive(true);
}
}
#10
09/08/2005 (6:33 pm)
Still testing....
12%....
#11
09/08/2005 (6:41 pm)
Changing that number may do nothing for you. Best way to be sure is to comment out the call.
#12
09/08/2005 (6:43 pm)
I went in a removed the useSmalltextures( cont bool t) { return };

still having a problem with the texture.

I will however test the size to see if a les detailed or more detailed works.
Testing.... please standby....
0%.....
#13
09/08/2005 (6:47 pm)
img376.imageshack.us/img376/3249/done0ze.jpg
Once i increased that number to 64 from 16 it was good as gold.

For others the line i modified is listed above.
#14
05/26/2006 (2:15 am)
I had the same problem but it works now..

thanks.
#15
11/10/2009 (3:50 pm)
Excelente post, me ayudó a resolver el mismo problema que tenía. Thanks!!!