Search Unity

Transparent Object Edges

Discussion in 'High Definition Render Pipeline' started by yusefkerr, Feb 20, 2020.

  1. yusefkerr

    yusefkerr

    Joined:
    Apr 5, 2011
    Posts:
    179
    Hello, I'm trying to create some plant meshes and I'm having an issue with strange borders around individual leaves. The attached image shows a mesh comprised of several polygonal leaves (just strips of polygons).

    The transparency texture is loaded into the alpha channel of the base map, and is black and white. It fits exactly the colored part of the leaf. I left a few pixels of room between the polygon edges and the visible part of the leaf, and it's that difference is visible in the border.

    Arrow 1 points to a strange, ghost-like border that appears. when the leaf is close-up. I don't understand why this is visible, because like I say, the alpha channel is plain black and white and pretty much exact.

    Arrow 2 points to a related issue that nevertheless seems like it might be different. I think this has something to do with Unity reading the alpha data in the leaf in front, and then using that as a mask for the whole object. But is there a way to prevent that happening?
     

    Attached Files:

  2. yusefkerr

    yusefkerr

    Joined:
    Apr 5, 2011
    Posts:
    179
    I've just discovered the "alpha clipping" threshold settings by accident, and that seems to clean things up a bit, but I'm still not sure exactly what that's doing, and I'm curious whether that's the best answer to the 2 issues above.

    I also noticed the following: I have a transparent water plane, and my plant leaves are also set to be a transparent material. Any parts of the plant beneath the water plane aren't rendered. This feels a bit like point 2 in the first post, but is there a way to over-ride this and render two translucent materials in sequence?

    Plant Water.jpg
     

    Attached Files: