Search Unity

LineRenderer : make LineRenderer no repeat and no stretch

Discussion in 'General Graphics' started by MMJasonLi, Jun 20, 2017.

  1. MMJasonLi

    MMJasonLi

    Joined:
    Jun 16, 2017
    Posts:
    2
    Hi, first things first this is my first post plz point out if I make any mistake.

    I am facing a very hard problem. I am trying to place a image on LineRenderer without stretching. I am kind of success {Check the Screenshoot} but the border of the texture automatically stretch and I want to remove the stretch. I tried to change the setting of the material and texture randomly but it doesn't help.

    Is anyone know how to disable the stretching border?
     

    Attached Files:

  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    You could add a 1 pixel transparent border around your source texture. But this won't work if your texture needs mipmaps.

    But then I'm not sure what the point of using the LineRenderer is, if most of it is transparent.

    Maybe you want the texture to repeat? In which case, open the Texture Settings for the texture, and choose "Repeat" for the Wrap Mode.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    I believe this is what the "border mipmaps" option is for, though kind of moot since I agree with the rest of that post about using a line renderer being pointless.
     
    richardkettlewell likes this.
  4. MMJasonLi

    MMJasonLi

    Joined:
    Jun 16, 2017
    Posts:
    2
    Yes, it work.