Search Unity

Question Using Camera distance to strech texture ?

Discussion in 'Shader Graph' started by glardon, Sep 22, 2021.

  1. glardon

    glardon

    Joined:
    Apr 8, 2015
    Posts:
    14
    Hi,

    I'm newbee on ShaderGraph, but not totally :)
    I'm working on a lineRenderer shader, i need a nice dashed line.
    This is what i have now :
    upload_2021-9-22_10-54-24.png .
    upload_2021-9-22_10-49-55.png

    That's cool but not enough for my needs.
    I would like to obtain a line with the same dash length, whatever the distance of the camera. I mean like if the line was in 2D. I want the same dash size at the start and at the end of the line.

    I searched a long time, trying to use camera distance to modify the TIling, but that never work like i want...

    Can someone help me, showing me the right way ?
     

    Attached Files: