Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Best approach at creating platforms such that their materials are scaled correctly (example)

Discussion in 'World Building' started by purplecomet1, Sep 9, 2020.

  1. purplecomet1

    purplecomet1

    Joined:
    Jan 11, 2018
    Posts:
    5




    As you can see above, I have two platforms, A and B (A is in front, B is behind).

    'A' was created using ProBuilder, and extending the face. 'B' was created by copy/pasting the bottom portion of the platform, and then rotating 45 degrees and lining up the edges.

    The advantage to 'A' is that the platform looks consistent (no gap). The disadvantage is that the texture becomes offset, because of the curved nature of the extension. Offsetting the UV's won't work here - the scale is off.

    The reverse if true of 'B' - the texture is aligned with the original platform, but there's a gap.

    What I'd like is a way to extend faces such that they would have the same number of light/dark squares as the face of what I was extending, and that they line up (this would mean that the extended face would be forced to be scalar in relation to the face I'm extending - but I don't mind this).

    In other words, I don't mind doing approach 'A', and opening up the UV editor and manually adjusting the UV offset factor such that they line up - but that isn't enough. In order for the tiles to line up, the face that I'm extending must be somehow scalar to what is being extended, and I'm not sure how to do this. If I manually change the UV tiling factor, I'll end up with a different amount of light/dark squares per row, for example.

    Eg., Here's what happens if I adjust the tiling scale and offset such that they now line up:



    As you can see, the top portion of 'A' now has 6 squares per row, instead of 4. This isn't desirable.

    I strongly doubt I'm the first to think of this - so what would be a good way to resolve this?

    Thanks
     
    Last edited: Sep 9, 2020
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I would use a triplanar shader in a case like this, and not have to muck about with UVs at all.
     
  3. purplecomet1

    purplecomet1

    Joined:
    Jan 11, 2018
    Posts:
    5
    I don't think I need anything that complicated. The textures you see on screen resemble pretty much what I want

    I doubt I'm the first to think of this problem, so I figured there already was a solution that existed
     
  4. RubenVanOostveen

    RubenVanOostveen

    Joined:
    Jul 31, 2020
    Posts:
    91
    Make a second material. use Parralex Diffuse I always use that one. @shadr