Home Unity

Texturing question

Riptyde
polycounter lvl 5
Offline / Send Message
Riptyde polycounter lvl 5
I have a large object that I have generated Normal maps and AO maps. I made the diffuse map and when I brought it into unity I found that the object was big enough that the detail of the diffuse map became extremely pixilated/distorted.

I then thought I would just make the diffuse map larger and tile it but then realized that the AO and Normal maps would no longer work since they are using the same UV set.

Looked online and found that Unity will support up to two UV sets and thought cool this will work - then realized the second UV set if for lightmaps which I will also need.

Any ideas on how to have keep the generated AO and Normal maps but get a higher rez diffuse so the detail is clean?

Thanks

Replies

  • Lamont
    Options
    Offline / Send Message
    Lamont polycounter lvl 15
    Unity can support more UV maps if you code for it in your shader. Just that all the default Unity shaders support only two.
  • Farfarer
    Options
    Offline / Send Message
    No, Unity doesn't support more than 2 UV maps.

    If you aren't using light maps, though, then you can safely use UV2 (and as you're using AO maps it looks like you aren't using it for light mapping anyway).
  • Codexus
    Options
    Offline / Send Message
    Codexus polycounter lvl 11
    You should be able to do what you want to do with only 2 uv sets:

    - Your first set you're free to use as you wish (tileable details for example).
    - Your second uv set has to be "lightmap compatible". That means no overlapping polygons and all within the 0..1 range.

    Then remember to uncheck "Generate Lightmap UVs" when importing your mesh so that Unity won't overwrite your own secondary uvs and you will be able to use those uvs both for your own purposes and for lightmapping (unity takes care of the lightmap atlasing automatically)

    EDIT: One more thing I didn't notice until after I posted: if you use this technique, you'll need to deactivate "static batching" for objects that use the 2 uv sets. If you don't, it will look fine in the editor but as soon as you hit play Unity will do some optimizations that mess with your second uv set and it won't work anymore.
  • Lamont
    Options
    Offline / Send Message
    Lamont polycounter lvl 15
    Sorry, I should have been clear. My mesh had 2 UV channels, I took one, duplicated it and manipulated it in code for my scrolling/effects.
  • Riptyde
    Options
    Offline / Send Message
    Riptyde polycounter lvl 5
    Hey guys, thanks for the input. From reading online, it sounds like I need to set up my two uv sets prior to exporting to .fbx and export the materials with it. Is that correct?
  • Codexus
    Options
    Offline / Send Message
    Codexus polycounter lvl 11
    Yes but the materials won't work automatically in unity, you will need to make a custom shader for that.
Sign In or Register to comment.