Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Tiling a Polygon Node

Discussion in 'Shaders' started by miqvp22, Dec 6, 2019.

  1. miqvp22

    miqvp22

    Joined:
    Jan 17, 2019
    Posts:
    9
    (this should be posted in ShaderGraph I guess, sorry I cannot change it)

    Hi, I'm trying to use Tiling and Offset in a Polygon Node, but it does not seems to tile it 5 times, instead it scales the polygon. How should I duplicate it?
    upload_2019-12-6_12-29-57.png
     
    GuyNumber9 and Mantikator like this.
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,256
    The tiling property of the Tiling and Offset node is really just a scale. It multiplies the UVs (as you can see the green of the UVs goes solid in the preview, but really it's going >1). If you pipe that UV into a sample texture node using a texture with its wrap mode set to repeat, it'll be a tiling UV. It the texture doesn't use repeat and instead clamp, it'll just be the colors of the edge of that texture stretched out forever.

    The polygon node is similar to a texture with the wrap mode set to clamp, it doesn't repeat. It works assuming 0.5, 0.5 in the UVs is the center, and the width and height set how big it is within the uv range supplied..

    If you want it to repeat, add a Fraction node between the output of the Tiling and Offset node and the input of the Polygon node.
     
  3. techhardware250

    techhardware250

    Joined:
    Jul 9, 2018
    Posts:
    1
    try to add fraction node from tiling node then add polygon node to fraction