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?
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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.
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.
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...
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.
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...
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):
Then at least you can tile horizontally, and do stuff like move the strips around easily.
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):
Then at least you can tile horizontally, and do stuff like move the strips around easily.
or even like this:
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.
@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.
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.
Replies
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
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.
I think Kaleb3d used this technique in his castle monument here.
http://kaleb-3d.com/Cathedral.html
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)
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.
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.
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.
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.
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...
Some screenshots from our wiki...
Using a face-map preview during modeling.
Adjusting the UVs after modeling.
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):
Then at least you can tile horizontally, and do stuff like move the strips around easily.
or even like this:
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.
@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.
Eric- Dude thanks for that PS action. I'd have never sussed that out.