XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

Can't get textures to tile!

Last post 11-01-2008 10:24 PM by colinday. 3 replies.
  • 04-08-2008 7:39 AM

    Can't get textures to tile!

    I'm trying to tile a jpeg texture on a plane/grid and although it appears to display fine, i.e. tiled, in the 3D modeller, when I run it in XNA it only shows one texture stretched over the entire plane.

    I was using Mod Tool and after spending hours trying to get it working I switched over to 3D Studio Max but I'm getting the exact same result.  In Mod Tool, I'm setting the Tile Repeat parameters to 10 each in the Advanced Texturing tab.  In 3DS I'm setting the max UV values to 10 instead of 1 but can't get either one working.

    Any ideas on what I'm doing wrong?
  • 04-08-2008 2:37 PM In reply to

    Re: Can't get textures to tile!

    You're probably using the tiling setting in the Texture parameters. That's not supported in most games, because it affects the sampling, not the UV coordinate values. Instead, apply a UVW Map modifier, and set the tiling in that modifier, which will affect the UV coordinate values.
    Also make sure your texture sampler in the effect is set to WRAP not CLAMP.
    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 04-08-2008 4:24 PM In reply to

    Re: Can't get textures to tile!

    Thanks for the help - finally managed to get it working in Mod Tool (not tried in 3DS yet, but don't really need it now anyway).

    Just incase anyone else has difficulty:
    Changed the UV coordinates to >1 in the Custom Texture tab and it displayed the texture as tiled in Textured Decal mode.  DirectX shader view didn't show anything but it never seems to work on my laptop anyway (Intel chipset).  Anyway, loaded the model and noticed the texture displayed fine on part of the model then stretched across the rest.  Added these two lines in my Draw method:

    GraphicsDevice.SamplerStates[0].AddressU = TextureAddressMode.Wrap;
    GraphicsDevice.SamplerStates[0].AddressV = TextureAddressMode.Wrap;

    And now displays fine :-)

    EDIT: Now if only Mod Tool would stop crashing every few minutes or so, everything would great!
  • 11-01-2008 10:24 PM In reply to

    Re: Can't get textures to tile!

    I am also new to 3D Studio trying to do the exact same thing with the same problem.  The UVW Mapping modifier works wonderful.  Thanks a ton!!!!
Page 1 of 1 (4 items) Previous Next