Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

CutOut transparent mesh shadow has gap between shadow and mesh.

Discussion in 'Shaders' started by dreamerflyer, Sep 18, 2017.

  1. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    Anybody meet this bug? Solid box has no problem,only the cutoff transparent mesh appear the gap. sbug.png
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Try setting the texture wrap mode to "Clamp" for that grass texture.

    With "Wrap" mode, sometimes those edge pixels blend with pixels from the opposite side of the image. The top row pixels of your grass sprite are all transparent, so the texture wrap will "cut out" the transparent pixels at the edge of your texture.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,366
    Try a solid quad. You'll see the same thing as you see with your grass.