Home Technical Talk

Can You Tile A PORTION Of A Texture?

Hey all. Wondering if you guys could help answer a question about UV mapping / Texture tiling in maya.

Is it possible to tile a portion of a texture onto a UV map? Say I use an image that is 64x64, but that mage is comprised of 4 32x32 tiling textures (all together in the one 64x64 image)

Could I tell maya to only use one 32x32 section of the whole 64x64 image and TILE that section across an entire face?

tilingQuestion.jpg

Any help is much appreciated.

Thanks!
~aaron

Replies

  • Peris
    Offline / Send Message
    Peris polycounter lvl 17
    you're probably going to have to cut up your texture in tiles, I've never heard of this being possible as you want it (would be nice tho).
  • Neox
    Offline / Send Message
    Neox godlike master sticky
    it's possible in shader UDN describes it like this:

    tiling uvs (how often you want to tile that your texture onto the surface) > frac > multiply * 0,5/0,5 > add 0,5/0,5 (to start tiling at 0,5/0,5 > UVs of your Texture
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    The only way you can do that without a shader is if you make your geometry tile, and map each quad to that UV area. Your geometry polygon count will increase dramatically.
    Probably better to either do it as a strip (make the texture tile fully in one axis), then you don't have to tile the geometry.
    The best way would be to have it as a separate texture. But then that's an extra batch/draw call. So it really depends on whether your engine can happily push lots of polys or whether it doesn't mind lots of individual textures.
    There may also be hacky methods of using various hyperShade nodes to recreate what Neox described, but I've never tried so can't say for sure.
  • Wheel
    Is there a quick way to gather and stack multiple similar shells in Maya ?
  • Rob Galanakis
    Yes you can do this, but it would be a headache unless it were very standardized.

    Basically you'd have to scale the uv coordinates in the shader and bias them to determine which 'quadrant' of the texture to use.

    Not very difficult if you've done it (modulo to get the U bias and integer division to get the V bias), but better to rethink what you are doing because something like this is unnecessary unless done on a very large scale.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    amcclay if I'm not mistaking I kind of described how to this this your other thread. At least he non-shader way of doing it by cutting up your geometry and overlap the UVs.

    http://boards.polycount.net/showthread.php?t=60555

    Good luck.
  • amcclay
    Thanks all, great info (as usual)

    Yeah, again, this question is in regards to implementing a 3D environment in the game engine "Unity" (which is now available for the PC btw!)

    Specifically, the way it works on an iphone is such that game performance decreases dramatically when you use too many "draw calls". Essentially, to get the best performance, you will want as much of the geometry to technically be one huge object with one single texture.

    I'm still not exactly sure why this is, but this is what is recommended. So, with the art style I am using, I could probably fit every single texture on a single 512x512 map - but only if I could tile portions of it.

    There may be a way to do this on the Unity side of things, and that's what I'll look into next.

    Thanks!

    PS - kodde: Your recommendation would definitely work, but unfortunately polycount is a huge concern on the iphone, so tiling geometry isn't an option in this case.
  • EarthQuake
    If you only need to tile on one axis it gets a lot easier, you can have a nice big column texture, say 1024x256 instead of 512x512.
  • Ryno
    Offline / Send Message
    Ryno polycounter lvl 18
    Cut geometry and overlay UVs. But leave a good amount of padding, or it'll mip to all hell if it's in an obvious area where a seam can be seen.
  • amcclay
    Ryno wrote: »
    Cut geometry and overlay UVs. But leave a good amount of padding, or it'll mip to all hell if it's in an obvious area where a seam can be seen.

    I can't add geometry unfortunately, as its for an iphone game.
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    With that particular texture layout, you *can* tile it in 3dsmax via the clamp functionality in the mat editor. In real time though, it's a bit more involved. You can use texture atlasing, which groups the textures together for load time, but the engine still sees as separate (some engines do, anyways).
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    you can tile it in maya too.
    Open hypershade and get to your place2dTexture node. (click the little arrowinabox where you assign a map to the channel, if it takes you to the texture map tab click the arrowinabox under the uv coordinates rollout)

    Then you can simply alter the "repeat UV" fields to whatever percentage of the texture you need repeated.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    amcclay wrote: »
    I can't add geometry unfortunately, as its for an iphone game.

    then how you expect partial tiling to work at all?
    From what I saw iphones'gpu currently exposes OpenGL ES 1.x. ie no programmable shaders, so no advanced control for that sort of operation...

    or do you do software rendering?
Sign In or Register to comment.