Search Unity

Procedural planet generation exercise: UV issues.

Discussion in 'Scripting' started by Hiondeux, May 7, 2011.

  1. Hiondeux

    Hiondeux

    Joined:
    May 5, 2011
    Posts:
    2
    Greetings! I have been working on a procedural planet generator and i've encountered a common UVing problem, illustrated well by the following pictures:




    The classic UV seam, which i am unable to fix.

    Here's the lower detail vertex pattern i experimented with the last time:



    (the dark blue lines are debug lines that follow vertices from 0 to 29 in sequence)

    As you can see, i tried to duplicate the vertices that should be close to X=0 so they overlap with those with X=1, but the slice is still there between the values of X=0 and X=0.14... so it seems i am failing to understand how it works!

    I triangulated between 6-1, 13-8, etc, because triangulating between 6-7 and 13-14 caused the lighting to not be rendered correctly.

    Could anyone please point me in the right direction? I read that i should duplicate the vertices close to the X=0 value, but it's what i'm trying to do, (evidently in a wrong manner), and it's not working.

    For the record, the previous vertex method i used was:


    It also had the same issue with the UVs.
     
  2. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    Appearently you have finished the roam and streaming of vertices part. If so, you can find some good articles for texturing in the following link
    http://www.vterrain.org/Textures/spherical.html

    Hope you finish this thing and share with the community :)
     
  3. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
  4. Hiondeux

    Hiondeux

    Joined:
    May 5, 2011
    Posts:
    2
    Thanks for the links, Aubergine, they're quite interesting and i will certainly use them as part of the reference material for my next, more advanced version of the planet generator, but for now solving the UV defect on this simple model takes priority, since it's mostly a learning exercise.

    EDIT: after much fiddling i fixed it myself. The solution was indeed fairly simple. I just had to make triangles between the overlapping vertices, as i thought. (ex: 1-7-14; 1-14-8)
    I just had overlooked that all the triangles surrounding the seam must connect to their logical vertices (ex. 6-7-13 and NOT 6-1-13)
     
    Last edited: May 9, 2011
  5. Headingwest

    Headingwest

    Joined:
    May 3, 2011
    Posts:
    153
    Id be really interested in seeing a ROAM planet implementation in Unity any chance of a gander ?