Home Technical Talk

Tiling Part of a texture?

polycounter lvl 9
Offline / Send Message
AshleyTayles polycounter lvl 9
Hey,

Is there any UV trickery that anyone knows of to tile part of a texture. Say you have 4 tiling textures on one sheet and you want to tile the texture in the top right, how would you do so?

I use 3DS Max 9 if that helps at all.

Replies

  • Firebert
    Options
    Offline / Send Message
    Firebert polycounter lvl 15
    Nevermind... nothing to see here
  • Mark Dygert
    Options
    Offline / Send Message
    Inside the material editor there is a cropping option under, bitmap parameters > Cropping placement. Click apply then view, then drag the outer red boarder to mark the selection you want to use.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    if you have 4 stripes of each texture portion that would work in 1 direction. If you have 4 quads each representing its own to be tiled texture that wont work because in order to tile things you have to scale either width or height of that UV item.
    There is a trick that mirrors the texture outside of the UV (0.0-1.0) ranges which is sometimes used on low spec hardware to mirror a texture. But A.) you need an engine that supports it and B.) its not suited for tiling techniques at least not more than twice and with a mirror seam in it.

    Maybe post a picture to clarify things
  • AshleyTayles
    Options
    Offline / Send Message
    AshleyTayles polycounter lvl 9
    Vig, would that work in an engine though?

    Renderhjs, I cant really give you a picture because I didn't want to UV map my object and then find out it's not possible.
  • Shogun3d
    Options
    Offline / Send Message
    Shogun3d polycounter lvl 12
    I'm curious about this as well.

    I think Kaleb3d used this technique in his castle monument here.

    http://kaleb-3d.com/Cathedral.html
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    UV mapping though is the core thats behind any texture mapping. So even if you use the UV-map types (box, planar, cylindrical,...) they are all a way of arranging the UV's even though you don't get to see the UV layout yourself.
    Tiling a texture (even with parameters in the material editor) is nothing else as scaling/ skewing the UV so that it goes outside the 0.0-1.0 range and therefore loops the texture outside the borders.

    btw. some links I found (though I searched for something else)
    http://www.aaronjclifford.com/images/tutorials/tiling_textures_tutorial.jpg
    http://www.game-artist.net/forums/support-tech-discussion/182-step-step-techniques-tiling-textures-3ds-max.html
    always a good read more in general:
    http://features.cgsociety.org/story_custom.php?story_id=4678&page=1


    what some people seem to refer to here is splitting the mesh at where the tile loop interval happens so that other tile elements can be switched. There is a maxscript that can do that and by that reverse in a certain way.
    http://www.scriptspot.com/3ds-max/texture-atlas-generator
    (btw. written from a guy at my former university)
  • Shogun3d
    Options
    Offline / Send Message
    Shogun3d polycounter lvl 12
    Good stuff, thanks render
  • glib
    Options
    Offline / Send Message
    I would just cut the object that you want to tile say 1/4 of a texture on, and apply the tiling part to each cut section of your geo. I can do a quick example tonight if that isn't clear.
  • Shogun3d
    Options
    Offline / Send Message
    Shogun3d polycounter lvl 12
    glib wrote: »
    I would just cut the object that you want to tile say 1/4 of a texture on, and apply the tiling part to each cut section of your geo. I can do a quick example tonight if that isn't clear.

    Only problem with that is the fact that you'd have to add more geometry. Opposed to if you have separate texture maps you would be able to tile continuously on a single continuous geometry.
  • crazyfingers
    Options
    Offline / Send Message
    crazyfingers polycounter lvl 10
    One thing i'll do, rather than worry about all the uv's just get one section with the correct texture texel density done and then just copy that geometry and peice it together, you can also instance these new bits so any changes to UV's will be reflected on the new pieces. Once everything's in place, attach 'em together, and weld 'em up.
  • glib
    Options
    Offline / Send Message
    kaburan wrote: »
    Only problem with that is the fact that you'd have to add more geometry. Opposed to if you have separate texture maps you would be able to tile continuously on a single continuous geometry.

    Right. Everything has a cost for sure, just as more texture lookups will incur a cost. Cutting up the geo in that way would be a bad way to deal with say, a floor, but a good way to deal with a tiling section in the middle of a prop for example.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Tiling part of a texture fails if you have any type of mip mapping in your render engine as you zoom out seams appear. In theory it should work fine if you clamp texture tiling in the shader. Or you can butterfly uv's but that always looks like crap to me.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    I had this idea in the last few days:
    TexTools_tile_editor_idea.gif
    it would be a maxscript creating some floater in which one could take snapshots of Bounding Box selections of the UVW editor selection with a exact screenshot/ thumbnail of the Texture within that area.
    This would be useful if one works with lots of different Tile Sets in 1 texture sheet (corners, T-crosses, water to sand, rock to grass,... transitions). Kind of like the old school Tiles sheets as I am sure some games even these days are done that way.
    Anyway it would be a convenient way of remembering Tile positions in the UV space and assigning those placements to other faces of the Mesh.
    Of course it would also need some corner or direction swapping scripts because you can not store orientations with it and some other stuff but I thought it was a nice idea,- though quite specific so not sure If I really will be doing this.
  • Eric Chadwick
    Options
    Offline / Send Message
    We've been doing this a lot.
    1. Model the mesh in mostly quads, as evenly distributed as possible.
    2. Put a UVW Map modifier on it, set to Face.
    3. Use UVW Unwrap, and scale the UVs into each quadrant as desired.

    Each quadrant needs a mip border, or you get bleeding. We found 4 pixels was good for 512x512 used on the ground (seen at an angle, so gets lower mipping). I made a Photoshop Action that tiles and scales and mip-bleeds each quadrant, very handy.

    I'll try to post some pics tomorrow.
  • Ryno
    Options
    Offline / Send Message
    Ryno polycounter lvl 18
    Eric nails it. This is pretty much what I do, but if the four quadrants are radically different colors and brightness, and the quadrant will be covering a large/obvious area of the model, I'd recommend even a bit more padding.

    Another option for this is to use 3 quadrants, and leave the other one blank. Tile your texture on the object as Eric describes. Then in areas where you may want something specific, like grafiti on a wall, just cut the geometry in this part, copy the UV channel to a new one, and bake the custom-cut chunk to that empty quadrant. Take it to photoshop, grafiti it up, and copy these UVs back to 1.

    Now you'll have a tiling texture with grafiti on it in one area without having to use decals. This can save on your texture calls, and avoid z draw issues if your engine is sensitive about that.
  • Eric Chadwick
    Options
    Offline / Send Message
    Ah yeah, cool tips Ryan.

    Here are the pics I promised. I forgot we used 8 pixel pads for the 512x512s, any less and we had bleeding. We had this hand-painted cartoon-shaded look, and we wanted the blending between the tiles to also be in the same painted style, instead of the usual vertex-alpha blend. So the Lead Artist and I worked up this approach...
    worldofzoo_atlas.jpg

    Some screenshots from our wiki...

    Using a face-map preview during modeling.
    worldofzoo_material_facemap.png

    Adjusting the UVs after modeling.
    worldofzoo_uv_gutters.png

    More shots of the game here.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    thx for the screens,- that serves in several ways as inspiration - much appreciated
  • Wheel
    Options
    Offline / Send Message
    Just saw this the other day really nice advice thanks. i was wondering about the 8 pixel padding you gave the tiles. Did you pseudo clamp the edges and blur them in PS ? It looks a bit like this in places but not in others. If so how do you do a pseudo clamp effect in PS ie extend an edge pixel to repeat outwards to the edge. Thanks for your time.
  • Peris
    Options
    Offline / Send Message
    Peris polycounter lvl 17
    Ah yeah, cool tips Ryan.

    Here are the pics I promised. I forgot we used 8 pixel pads for the 512x512s, any less and we had bleeding. We had this hand-painted cartoon-shaded look, and we wanted the blending between the tiles to also be in the same painted style, instead of the usual vertex-alpha blend. So the Lead Artist and I worked up this approach...
    worldofzoo_atlas.jpg

    Some screenshots from our wiki...

    Using a face-map preview during modeling.
    worldofzoo_material_facemap.png

    Adjusting the UVs after modeling.
    worldofzoo_uv_gutters.png

    More shots of the game here.

    Yeah that's an awesome technique, I use that a lot too =). Even more efficient would be laying it out like this (if your engine supports non-square textures):
    tiling.jpg

    Then at least you can tile horizontally, and do stuff like move the strips around easily.

    or even like this:

    tiling2.jpg
  • commander_keen
    Options
    Offline / Send Message
    commander_keen polycounter lvl 18
    Peris wrote: »
    Yeah that's an awesome technique, I use that a lot too =). Even more efficient would be laying it out like this (if your engine supports non-square textures):
    tiling.jpg

    Then at least you can tile horizontally, and do stuff like move the strips around easily.

    or even like this:

    tiling2.jpg

    Yeah you can often get away with only horizontal tiling for many things. Its a nice way to keep draw calls down while getting lots of texture variation.
  • Eric Chadwick
    Options
    Offline / Send Message
    Hey cool layout Peris! Will have to try this out.

    @Wheel, here's a Photoshop Action I uploaded awhile back. Xnormal's Photoshop filter is hella faster, but it requires a layer with aliased transparency, and I don't like the streaks.

    Keen, are you saying a vertical-only tile uses less draw calls than a vertical+horizontal tile? That would be cool if so.
  • Wheel
    Options
    Offline / Send Message
    Guys, cheers for the inputs. Really helping me understand this.

    Eric- Dude thanks for that PS action. I'd have never sussed that out.
  • commander_keen
    Options
    Offline / Send Message
    commander_keen polycounter lvl 18
    Eric: no, im just saying with that layout you get free horizontal tiling so if you really need to tile it in one direction you can do that with less trianges and a single material. Its more useful on a building or something rather than something organic like terrain though.
Sign In or Register to comment.