Page 1 of 1

Bad texture mapping with Ogre, good with 3DSmax ?

Posted: Mon Mar 27, 2006 3:41 pm
by Yupa
Time for me to ask for help ... again :(
I read all morning about it, but found nothing that could help me. Here's the problem :

I have my mesh and UVmap in 3DSmax, and they render as I want.

Image
Image

But imported in the engine, it looks like this :
Image
Image

There's a gap at the symetry axis, on the head, and at the jointure of arms and legs, that is not in the 3DS render or window.

Here's the material file :
material Examples/heros
{
technique
{
pass
{

scene_blend alpha_blend colour_blend
alpha_rejection greater 128
depth_write on


texture_unit
{
texture heros.tga
tex_coord_set 0
}


}



}

Is there something I forgot ?

Posted: Mon Mar 27, 2006 4:15 pm
by celic
try to remove tex_coord_set 0 from your material script.

Posted: Mon Mar 27, 2006 4:19 pm
by Yupa
This gives me the same effect :(
I put this line because I was afraid a bad coordinate set was used, but it's not the case.

Posted: Mon Mar 27, 2006 4:30 pm
by vinhk
is it also happens if the camera is close to the character in game ?? (same distance as 3DSMax, from camera position to character position)

if not, i think it's about the texture mip-map, somekind of UV offset problem. ( just a guess )

Posted: Mon Mar 27, 2006 5:06 pm
by Yupa
OK I tested with a closer camera, and it seems that this is it ! I'm gonna search around the forum and wiki to understand mipmapping, and I'll post the results.

Thanks alot vinhk & celic :)

edit : I played with the filtering modes (finding topics that match my issue is quite easy now :p), and the result is better, even if is not perfect. I'll continue to try !

Posted: Mon Mar 27, 2006 5:22 pm
by bantza
My guess is that you have made the texture with pixel accuracy. And your background is white. Automatic mip-map generation then smoothes the white with the color and hence the seams. You could try to "overcolor" your texturemaps or create mip-maps manually.

Posted: Mon Mar 27, 2006 5:34 pm
by sinbad
Also if your texture map runs up to the edges of the texture, use 'tex_address_mode clamp' to avoid wrap-around filtering to the other side of the texture.

Posted: Mon Mar 27, 2006 7:21 pm
by Yupa
After some tries, here's the result :


Image
(The edges are ok on the new model, not on this test model ;))
Image

there's still a tiny white line at the symetry, but the other jointures are ok.

I used anistropic filtering :
MaterialManager::getSingleton().setDefaultTextureFiltering((Ogre::TextureFilterOptions)TFO_ANISOTROPIC);
MaterialManager::getSingleton().setDefaultAnisotropy(8);
And added the clamp adressing mode in the material script.

Really not perfect, but I'll keep it if I don't manage to have better tonight.
I guess I'm doing something else wrong, but what ? :)

Thanks for your help :)