Home Technical Talk

Repeat only a portion of a texture map?

polycounter lvl 7
Offline / Send Message
ajv3d polycounter lvl 7
Good Evening,

Does anyone have any good workflows or recommendations for creating a repeating/tiled texture that repeats only a portion of the texture map? So instead of using an entire 512*512 to repeat a texture, you can be able to tile just a portion of it, leaving the rest of the map open for texture sharing?

Replies

  • gsokol
    Options
    Offline / Send Message
    I usually do that by cutting up the geo that would use the tiling texture and overlap the uvs. For simple shapes it works well enough, but it can be a pain.

    I don't really see there being another way.
  • ajv3d
    Options
    Offline / Send Message
    ajv3d polycounter lvl 7
    I see what you mean, to do that I usually unitize my uvs and overlap them too. I thought here might be a way to offset the texture in Photoshop to allow tiling of only a portion of the map.
    gsokol wrote: »
    I usually do that by cutting up the geo that would use the tiling texture and overlap the uvs. For simple shapes it works well enough, but it can be a pain.

    I don't really see there being another way.
  • gsokol
    Options
    Offline / Send Message
    Dont know if anything like that exists....but if so I'd be interested in knowing as well.
  • mortalhuman
    Options
    Offline / Send Message
    What like, something like this? (this is by no means a work, literally nothing was done here but it shows some parts that tile, and some parts that do not)

    shaderling.png

    here you would tile left and right just by laying the uvs over it, doesn't matter if they hang over the side.

    you could do this with long or wide textures, tiling in either direction depending on the layout (if you set it up tall then, you can tile left and right, for example - it would be like this, but taller)
  • gsokol
    Options
    Offline / Send Message
    mortalhuman - Thats true that you can do that. If tiling only needs to happen in one direction that will fit the bill.

    I was assuming he meant tiling along both x and y...like this:

    pcouttiledtexturingexample.jpg

    Instead of using one tiled texture for brick, and a different one (or ones) for uniquely uved portions, you would cut up your geo in a grid to fit it on the brick section.
  • Silix
    Options
    Offline / Send Message
    if your using max you can use your original map normally then duplicate it and use the bitmap map's crop then just tile that as needed
  • mortalhuman
    Options
    Offline / Send Message
    @gsokol, indeed - any tips to add about that method to stop mip map bleeding? I find that I can never stop the bleeding and either just give it another material with the tiler alone or break it up with other geometry (place stuff over the seams) - but imagine it on the side of a wall tiling a concrete or brick like you have - it's hard to cover all those seams and not use a huge portion of texture space. How can you stop the seams from showing up as soon as it mips out to lower levels? Thanks!

    Not to hijack the thread, it's related, and surely this will help a lot of folks.
  • gsokol
    Options
    Offline / Send Message
    The problem is, when the texture mips, is uses less pixels, and the uv coords can sometimes hop over off of the desired texture and into a different area.

    I usually just make a couple pixels in all directions similar color, or repeat a tiny section of the texture on the outside of the uv coords, so when it mips, your still getting the right color overall.
  • mortalhuman
    Options
    Offline / Send Message
    I thought that might be a solution, to over-tile a little and just lose a little bit of unique space, worthy tradeoff. Thanks for adding this. It wouldnt take a lot, using the like-colors in conjunction by the time it is a few levels down, it is so low res that it'll look fine anyhow.
  • Eric Chadwick
    Options
    Offline / Send Message
    One trick I've used in Photoshop to tile a small section, was to use the freebie HalfWrap/etc. filters, which do an Offset centered on the current selection (instead of the whole canvas). Really handy.
    http://wiki.polycount.com/PhotoshopTools?highlight=%28halfwrap%29#Filters_and_Actions
  • ajv3d
    Options
    Offline / Send Message
    ajv3d polycounter lvl 7
    Tiling in both directions is exactly what I was talking about, but you both hit the bullseye on what I was trying to convey. How would I go about painting out the seams on the partially tiled texture? Just offset and paint out?

    gsokol wrote: »
    mortalhuman - Thats true that you can do that. If tiling only needs to happen in one direction that will fit the bill.

    I was assuming he meant tiling along both x and y...like this:

    pcouttiledtexturingexample.jpg

    Instead of using one tiled texture for brick, and a different one (or ones) for uniquely uved portions, you would cut up your geo in a grid to fit it on the brick section.
  • ajv3d
    Options
    Offline / Send Message
    ajv3d polycounter lvl 7
    Yup, this is what I was getting at...
    What like, something like this? (this is by no means a work, literally nothing was done here but it shows some parts that tile, and some parts that do not)

    shaderling.png

    here you would tile left and right just by laying the uvs over it, doesn't matter if they hang over the side.

    you could do this with long or wide textures, tiling in either direction depending on the layout (if you set it up tall then, you can tile left and right, for example - it would be like this, but taller)
  • ajv3d
    Options
    Offline / Send Message
    ajv3d polycounter lvl 7
    This does look handy, just a shame it doesn't support 64bit :(
    One trick I've used in Photoshop to tile a small section, was to use the freebie HalfWrap/etc. filters, which do an Offset centered on the current selection (instead of the whole canvas). Really handy.
    http://wiki.polycount.com/PhotoshopTools?highlight=%28halfwrap%29#Filters_and_Actions
  • Eric Chadwick
    Options
    Offline / Send Message
    Worth running the 32bit version though. You don't really need 64bit PS for most game texturing tasks (just for the really big files).

    You might find this tool interesting.
    http://www.scriptspot.com/3ds-max/scripts/texture-atlas-generator
  • ajv3d
    Options
    Offline / Send Message
    ajv3d polycounter lvl 7
    I can seem to figure out how to tile a texture on x and y on one map... I'm using 512*512 and if a tile takes up 1/4 at 256*256 it doesn't tile. I'd need to take up half in order to offset and have it tile correctly, but if I need to take up 1/2 of the texture map, tiling in both axis is impossible, no?

    QUOTE=gsokol;1328690]mortalhuman - Thats true that you can do that. If tiling only needs to happen in one direction that will fit the bill.

    I was assuming he meant tiling along both x and y...like this:

    pcouttiledtexturingexample.jpg

    Instead of using one tiled texture for brick, and a different one (or ones) for uniquely uved portions, you would cut up your geo in a grid to fit it on the brick section.[/QUOTE]
  • Mik2121
    Options
    Offline / Send Message
    Mik2121 polycounter lvl 9
    ajv3d wrote: »
    I can seem to figure out how to tile a texture on x and y on one map... I'm using 512*512 and if a tile takes up 1/4 at 256*256 it doesn't tile. I'd need to take up half in order to offset and have it tile correctly, but if I need to take up 1/2 of the texture map, tiling in both axis is impossible, no?

    QUOTE=gsokol;1328690]mortalhuman - Thats true that you can do that. If tiling only needs to happen in one direction that will fit the bill.

    I was assuming he meant tiling along both x and y...like this:

    pcouttiledtexturingexample.jpg

    Instead of using one tiled texture for brick, and a different one (or ones) for uniquely uved portions, you would cut up your geo in a grid to fit it on the brick section.
    [/QUOTE]
    There's no way to tile just a portion of a texture in the way you are trying to do it. Tiling means you are placing the exact same texture next to itself, you can't just do a portion of it unless you actually put an edge there, but then it's not tiling, it's simply copying the same model with the same UV next to a another copy of said model.
  • ajv3d
    Options
    Offline / Send Message
    ajv3d polycounter lvl 7
    Ok, that makes sense, I thought I was missing something.


    There's no way to tile just a portion of a texture in the way you are trying to do it. Tiling means you are placing the exact same texture next to itself, you can't just do a portion of it unless you actually put an edge there, but then it's not tiling, it's simply copying the same model with the same UV next to a another copy of said model.[/QUOTE]
  • Synthesizer
    Options
    Offline / Send Message
    Synthesizer polycounter lvl 11
    You could do it in a shader, telling the UV value to wrap back if it's outside than the area you want to tile. Although in most cases this would probably be more expensive than cutting up the model, you'd need a new shader for each tiling section.
Sign In or Register to comment.