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. Dismiss Notice

Raw Image / Render Texture tree leaves issue

Discussion in 'General Graphics' started by FamerJoe, May 20, 2015.

  1. FamerJoe

    FamerJoe

    Joined:
    Dec 21, 2013
    Posts:
    193
    So I have a minimap that uses a camera projected on a Raw Image using a Render Texture. Everything worked fine until I added this new tree - as you can see, the tree's leaves don't seem to render, and they show up as transparent, so the map has "holes" in it. This is only at the start though, and I can then move around, and the map moves fine and the trees look fine, but these cutouts stay in the same position and never go away. Anyone ever seen anything like this, and have any idea what could be causing this? I'm pretty sure it's something to do with the texture itself.



    The leaves use these two textures:

     
  2. Zicandar

    Zicandar

    Joined:
    Feb 10, 2014
    Posts:
    388
    My guess is that those tree's are outputting alpha, and that alpha is then copied over. My suggestion is to set the blend mode for the tree's shader to not output any alpha, (but still do normal blending)
    Code (CSharp):
    1. Blend Something Something, Zero One
    Note the
    Code (CSharp):
    1. , Zero One
    (the , is important here)
    It tells the shader that the alpha channel is blended differently from the rgb's. In this case don't touch it :)
     
  3. FamerJoe

    FamerJoe

    Joined:
    Dec 21, 2013
    Posts:
    193
    Thanks for the response; but I'm not sure how to go about doing this with a Tree Creator created tree that uses "Hidden/Nature/Tree Creator Leaves Fast Optimized" shader that is also greyed out.
     
  4. Zicandar

    Zicandar

    Joined:
    Feb 10, 2014
    Posts:
    388
    Perhaps do a blit pass to your render texture after your done rendering and fill it with 1 in the alpha channel?
     
  5. Charles-Van-Norman

    Charles-Van-Norman

    Joined:
    Aug 10, 2010
    Posts:
    86
    Zicander can you elaborate on how to do a blit pass with a render texture in Unity?