Search Unity

are my UV maps just totally being ignored?

Discussion in 'Global Illumination' started by tswalk, May 22, 2015.

  1. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    I've been fussing around the entire day with the new light mapper and... while I'm able to get some nice controls, there just is something really, really off.

    Eventhough I'm creating (out of frustration,and I suppose necessity) 2ndary UV maps for lightmapping... they seem to be just getting completely ignored.

    example here:


    The image in the background is what the baked mapping is for a TD of 10 (object scale in lightmap is 1).

    I have to really crank the TD per object (using scale) to get any kind of resemblance of light casting (while the lightmaps themselves become, well.. out of control).

    The image on the right shows the U1V space of the secondary UV map (named uvSet2)... please note the corner piece... nice and aligned. Note the "default" import (without the generate lightmap UVs selected)... they're completely out of wack. Even the mapping for the wall itself is off.

    In all cases, i'm finding that I the secondary UV map is just being ignored... and I don't understand why.

    Is it suppose to be named specifically? UV2 perhaps instead of whateverUVsetnameiuse2 ?

    I can understand (and appreciate) the ability to adjust the TD by scale, but it would really be nice to be able to do both a U and V scale option instead of both.

    regardless.. any idea on this? Like I said, I've been at this all day long tweaking, rebuilding UV sets.. back and forth. I can't make heads or tails of what it is doing.
     
  2. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    oh.. I also what to add that the objects (wall and corner) are separate pieces. (prefabs)
    and for giggles.. these are what seems to be how it is generating them (UV Charts?)

    I have no idea where my secondary maps are...:confused:

     
    Last edited: May 22, 2015
  3. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
    Same here:



    It's totally ignoring what's on UV0 and UV1.
    I'm new to enlighten too.

    Please let me know if you found a solution for this.
     
  4. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    well... not so far, I'm still a little uncertain.

    It would seem, that the preserve UV doesn't mean what I thought it should where I believed that it would respect the UV space as defined. Such as proportions with let's say U1V1 as I had placed them out.

    I did not have time to test how it handles them if "preserve UV" is not enabled. e.g: Say if I place proportional UVs into U1V1, U1V2, U1V3 (as in Maya's editor) within the secondary UV set (UV1 in your case, or in my example above uvSet2). I would "think" that it would just grab them and layout the spaces as best calculated into both Charting and Baked Direction.

    I'll find this out this week though.

    as it is, I'm just tweaking each models "Scale in Lightmap" to get cleaner results. Unfortunately, I end up with more maps then I think is necessary and there doesn't seem to be any method to organize them.
     
  5. snowandball

    snowandball

    Joined:
    Apr 11, 2019
    Posts:
    25
    I am reviving an old thread but i am having the same problem. A have a level with models that have a secondary UV set for the lightmap. Yet when i bake it, i get a completely different lightmap that ignores my UV layout ... and the result is ... well i have to crank up the lightmap resolution a lot in order to get good result and instead of one, for some reason i get multiple ligthmaps ... (higher res seem to create more maps ) When i bake in something like marmoset toolbag i have no problems and get exactly the result i want. But unity seem to be operating under a different logic. Why does unity ignores my secondary UV set ?
    The reason i want for unity to use my UV set is because i want to modify the unity ligthmap with my Marmoset AO bake and ... generally tweak the ligthmap in external software. But if unity doesn't respect my UV's ... that won't work. So ... what's going on ?
    "Generate lightmap UV's" and "swap UV's" are unchecked.

    Untitled-1.png
     
    Last edited: Jan 31, 2023
    Rowested likes this.
  6. Pema-Malling

    Pema-Malling

    Unity Technologies

    Joined:
    Jul 3, 2020
    Posts:
    328
    The lightmapper respects the manually authored UV layouts of individual renderers (assuming you have made sure to turn off Generate Lightmap UVs in the mesh importer), but will pack these layouts in whichever way it sees fit into a set of final lightmaps. As far as I understand, you have multiple renderers, each with manually authored UVs in the same UV space. This workflow doesn't really work the aforementioned reason.

    As is evident from the screenshot you've posted, our lightmap packing algorithm leaves much to be desired, and the ability to fully control lightmap layout is missing. We have solutions to these issues on our roadmap.

    You might be able to work around this by combining all the meshes you want on one lightmap into one mesh, and authoring UVs for just that mesh. I realize this is very cumbersome and limiting, but I don't currently have anything else to offer. Please let me know if I've misunderstood your use case - if there is an actual bug here, we should get to the bottom of it.
     
  7. snowandball

    snowandball

    Joined:
    Apr 11, 2019
    Posts:
    25
    No, that answers it. Thanks. Saw that Bakery allows me to use my layout, so i guess that's the way to go for now.