Bad texture mapping with Ogre, good with 3DSmax ?

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
Yupa
Halfling
Posts: 44
Joined: Wed Aug 24, 2005 10:28 am

Bad texture mapping with Ogre, good with 3DSmax ?

Post 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 ?
User avatar
celic
Gnome
Posts: 363
Joined: Wed Mar 23, 2005 11:05 am
Location: Chisinau/Moldova
Contact:

Post by celic »

try to remove tex_coord_set 0 from your material script.
Yupa
Halfling
Posts: 44
Joined: Wed Aug 24, 2005 10:28 am

Post 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.
vinhk
Kobold
Posts: 25
Joined: Fri Oct 21, 2005 9:01 am
Location: Far East

Post 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 )
Yupa
Halfling
Posts: 44
Joined: Wed Aug 24, 2005 10:28 am

Post 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 !
User avatar
bantza
Gnoblar
Posts: 16
Joined: Sun Nov 20, 2005 12:50 pm
Location: Pohjola
Contact:

Post 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.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post 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.
Yupa
Halfling
Posts: 44
Joined: Wed Aug 24, 2005 10:28 am

Post 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 :)
Post Reply