Home Technical Talk

Tiling and AO

polycounter lvl 9
Offline / Send Message
Reverenddevil polycounter lvl 9
Hey I was wondering what the best workflow would be for tiling textures and AO. Say I have a large tiling texture for a building or something that will be covering a building or something that needs shadowing etc. What would be the best way to get an AO for something like that? Would it be best to just use vert paint? What do most of you do? Thanks..

Replies

  • EarthQuake
    What you want to do is create a 2nd uv channel for your AO. Most modern engines support this(UE3) etc. And bake your LM to that.
  • Reverenddevil
    Offline / Send Message
    Reverenddevil polycounter lvl 9
    What would need to be done if you have a tiling texture and your uvs are all over the place and outside the 0:1 uv space? How will AO work then? How would you do it?
  • Ryno
    Offline / Send Message
    Ryno polycounter lvl 18
    You need a non-tiling zero to one layout in your second UV set.
  • Reverenddevil
    Offline / Send Message
    Reverenddevil polycounter lvl 9
    Do you have a comprehensive tutorial and second UV sets. i have never tried using them before. Thanks.
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    Could you not bake the AO into the mesh itself?
  • Eric Chadwick
  • EarthQuake
    Could you not bake the AO into the mesh itself?

    I assume you mean storing AO in vertex colors. Really this is a pretty poor solution, and i've used it pretty extensively, it has far too many cons. Its really big pain to have to split up your mesh to prepare it for vert-ao, chopping in extra segments near things that intersect, etc. Really big pain to do that stuff, and the quality is just never going to be as good as using an image in the first place. So you're doing a lot more work, for a lot less quality, and maybe marginal texture memory savings at best. Not worth it in my book.
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    Agreed. Make a second UV set with optimized 1:1 layout for the geometry and bake it out into it's own map.
  • Mark Dygert
    Mini Tutorial:

    • Apply a Unwrap UVW modifier. (Make sure the channel is set to 1), save your layout as UV1
    • Apply a second Unwrap UVW modifier on top (technically you could do it all in one modifier but I've hit too much bugginess switching channels.)
    • Change the channel to 2, click Edit
    GradientSample01.jpg
    • In the Editor window go to Face mode > Select all > Mapping > Flatten Mapping. Check on Normalize, Rotate and Fill holes, click ok.
    • Make sure each piece has enough padding because light maps are often shrunken to very small sizes and bleeding is pretty common. Obviously you can take a lot more time with the second UV layout if you want to.
    • Save it as UV2. (Saving is just a precaution it comes in handy if you want to start working in one modifier and it fudges up)
    • Open Render to Texture and under Mapping Coordinates check on Use Existing Channel and set it to 2. Render your AO and you're done.

    You can use a composite map if you want to see your AO on the model with the diffuse. Just be sure you set your AO Map to use UV channel 2.
    GradientSample02.jpg
  • Peris
    Offline / Send Message
    Peris polycounter lvl 17
    i find painting vertexcolors for this kind of stuff usually the fastest way and you get pretty good result if you do it right. If you have enough tesselation in you scene ofcourse. But AO doesnt need to be perfectly accurate to get a realistic effect. Working with a second uv set and lightmaps is just counterproductive imo, but it also works.
  • EarthQuake
    Yeah if you've got the extra tesselation there already it can make sense. If you dont, its a huge amount of work, much more so than creating a 2nd uv channel, and doing an auto-unwrap.
  • Mark Dygert
    I agree with EQ, it can be a nightmare to prep a low poly object for vertex paint, if the extra polys are there already then it won't be much of a problem and your only concern would be trying to get the paint to look right.

    The mini tut I posted takes about 30sec-2min, looks long and convoluted but its quick and easy.

    Eric might be able to fill in the holes on this one but I think doing a second UV channel doubles your vert count? I'm not sure if vertex paint does the same thing? So there could be a resource trade off also?
  • EarthQuake
    Well if you think about it, prepping a model to use vert based AO can easily double, or tripple or whatever your vert count too. And saving vert color data isnt free either, i mean its not much of a memory hit at all, but its not free, going to be less than a texture tho.
  • Saidin311
    Offline / Send Message
    Saidin311 polycounter lvl 11
    Vig wrote: »
    Mini Tutorial:
    Edit: NvM, I didn't obviously read your mini tut right! Cheers!
  • Ryno
    Offline / Send Message
    Ryno polycounter lvl 18
    Vertex Colors will help, but it is very difficult to get good gradiated (is that a word?) shading in small crevices without doing tons of little cuts to get your vertex coloration to fall off correctly. A map will let you get this detail a hell of a lot more easily. This all gets acerbated if your model is composed of unconnected elements within the model.

    With that being said, for some objects it might not really matter too much visually. I've done a bunch of trees using vertex paint, and it was much easier to do than it was to use a AO texture map and they looked much better than they would have with an AO texture map.

    But for buildings with a lot of ornamentation, I would stick with a proper AO texture map on a second UV set.

    Also note that after baking an AO map, adding extra grime to this map can be a very nice way to break up any tiling that may be showing up from textures in the first UV set.
  • JacqueChoi
    Offline / Send Message
    JacqueChoi polycounter
    I'm talking out of my element here, but would a Precomputed Radiance Transfer do the trick?

    http://graphics.cs.umass.edu/pubs/srt/


    Not sure if theres an available Max plugin for this, but I'd imagine Unreal or Hammer would have it.
  • Reverenddevil
    Offline / Send Message
    Reverenddevil polycounter lvl 9
    I want to say thank you to everyone for your replies and help. You guys are awesome.!!
  • Ryno
    Offline / Send Message
    Ryno polycounter lvl 18
    jox wrote: »
    I'm talking out of my element here, but would a Precomputed Radiance Transfer do the trick?

    http://graphics.cs.umass.edu/pubs/srt/


    Not sure if theres an available Max plugin for this, but I'd imagine Unreal or Hammer would have it.


    This looks like a realtime solution for radiosity/AO, and no mainstream engines can do this well that I know of. Even in the examples, they are only getting 15 fps for a single static object in a very simple environment. Throw in 24 characters running around calling dozens of animations, add in several dozen weapons each calling unique particle effects, and add take into account a much larger environment calling dozens of diffuse/spec/normal/opacity/reflection texture maps, and that 15 fps will be more like 1.5 fps.

    Sure, it's a pretty good algorithm, but I doubt it's ready for games right at the moment. If this could be used in Max or Maya, it might be a faster lighting baker, but all of the big packages have very nice lighting options of comparible quality already. Most aren't too terrible lengthy for rendering to texture either.

    If we could get real-time lighting that looked this good, we'd all be happy campers due to the time saved in baking out and touching up AO/lightmaps. But as it stands now, no engine can do this and everything else. We can still get similar good looking baked results, but the question is how do we store this data. Vertex colors are tedious to setup. Lightmaps on a second UV set look great, but greatly increase the UV vert count, and the textures themselves have to load and take up space on disc.

    It's pick your poison at this point, and play to the strengths of the engine that you are using. There will absolutely be some kind of compromises made, and we've got to dance that line between efficiency and aesthetics.
Sign In or Register to comment.