Home Technical Talk

Tiling with Unwrapped UVW's?

Greetings,


For the last 3-4 days, this issue alone has kept me up for several hours at night trying to wrap (no pun intended) my brain around this concept and how to go about doing it. So as with any visual problem, pictures go a long way in describing my issue. First off, let's setup a simple scene.

Here we have a 6 sided box, with the normals facing inside. A basic room, with a floor, ceiling and 4 walls.

tileuvws1.png


Let's assume I want the look of each surface to match the color coding uniquely. Ie - the floor does not share any common appearance to the walls nor ceiling, as do the rest of the surfaces.

In these types of situations where I'd be making a unique structure for a videogame all as one solid, I would use multi-sub-object materials to handle the distribution of unique textures with unique channels for each specific materialed surface. This is fine for 3DS Max rendering, but I don't like it for video games. It works so far for Cryengine 3, but I find it very sloppy and wasteful on draw calls. I would much rather Unwrap the UVWs and use a single sheet to texture the whole room.

Now of course, I could do this using a single say 1024x1024 or higher texture, but here is where my brain explodes trying to figure out how to do this. Let's say, I want the floor to tile it's texture 4 times, the walls half, and the ceiling 2 times, for the sake of understanding not for practicality.

tileuvws2.png

This image was done using a 3 leveled multi-material, with each material channel having it's own unique 512x512 texture, and then I went into Edit Poly - Faces mode and selected each channel, and performed a UVW Mapping modifer, planar/box, and tiled it accordingly. This method works, but like I said having upwards or 4 or 5 or more materials in a multi-material for games is not too nice. I'm trying to avoid that as best as possible.


So what I'm hoping someone can show me is a way to perform exactly what I did in the above picture, using a single unwrapped uvw texture, with proper tiling. I try to imagine how to do it, if it's at all possible, and my brain just starts to hurt :(


Is this really the only way to tile out a faces texture like that? I really hope it isn't.


Looking forward to hearing (preferably good news) from you guys.

Thanks for looking.

Replies

  • EarthQuake
    Options
    Offline / Send Message
    There are basically two ways to tile textures:
    1. Use one unique tiling texture for each material. You can use less geometry, but it costs on draw calls. Texture reuse is easier as well.
    2. You use one quad(minimum) per tile, you map your(3 in this case) quads to unique sections of your uv map(make sure there is lots of padding between) and duplicate your quads to tile. This uses more geometry but it is better on draw calls. Its harder to re-use materials and its wasteful if you're ever partially re-using the materials. You need to be very careful to line everything up exactly.

    You can break it down into more complex situations(ie multiple trims tiling in only one axis on the same texture) but these are the two basic concepts.
  • DaRkL3AD3R
    Options
    Offline / Send Message
    Hmm I didn't really think of that, making a quad for each tile on the surface. That's an interesting idea.

    So in your opinion, modeling game architecture based on the Cryengine 3, which would be the lesser of 2 evils? The way I've been doing it with multi-materials and UVW Mapping tiling, or the quad-tiles?


    From what I gather on current gen hardware, geometry isn't a problem so much as draw calls. However I am no expert and my feet are pretty dry in this area, and just want to get an idea of how other people go about handling this type of situation.
  • EarthQuake
    Options
    Offline / Send Message
    DaRkL3AD3R wrote: »
    Hmm I didn't really think of that, making a quad for each tile on the surface. That's an interesting idea.

    So in your opinion, modeling game architecture based on the Cryengine 3, which would be the lesser of 2 evils? The way I've been doing it with multi-materials and UVW Mapping tiling, or the quad-tiles?


    From what I gather on current gen hardware, geometry isn't a problem so much as draw calls. However I am no expert and my feet are pretty dry in this area, and just want to get an idea of how other people go about handling this type of situation.

    Its an extremely specific question and depends on way too many variables to answer with any sort of authority. Hell, you may end up using both methods on a single large asset.

    Generally, you would consult with your graphics programmers/technical artist for a specific project and come up with some sort of guideline for it.

    Both are very common and unless you're doing something really excessive, like needing thousands of quad-tiles just to get your tiling, or using 30+ materials just to do basic per-material tiling it shouldn't be a big deal.

    1. Is how most levels in games have been built for the past 15 or so years.
    2. Is often how "modular" type building sets are constructed, where you have a number of unique(or just unique mapped) bits that you throw together in different combinations.
  • Eric Chadwick
    Options
    Offline / Send Message
    We have some articles and tutorials about this on our wiki.
    http://wiki.polycount.com/CategoryEnvironmentModularity
Sign In or Register to comment.