Search Unity

Is there such a thing as a UV map for the alpha/transparency channel?

Discussion in 'General Graphics' started by WilkinsMicawber, Feb 13, 2016.

  1. WilkinsMicawber

    WilkinsMicawber

    Joined:
    Jan 22, 2016
    Posts:
    27
    I need to make only one side of a primitive cube visible, and for the visible side to have a gradient texture determine which parts are visible. Is there any way to have every side but the visible one have a black alpha texture, with the visible one having a different one?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,350
    Why use a cube at all if only a single quad is visible?
     
  3. WilkinsMicawber

    WilkinsMicawber

    Joined:
    Jan 22, 2016
    Posts:
    27
    I've looked into using planes. My problem is that, with an alpha gradient applied, a sliver of the end of the plane is still visible. I'm trying to make the entire end of the plane invisible. My only recourse appears to be to create a custom object in Blender using different materials, with only the material of one side visible.

    I want to be able to create different sizes of the object using script over time, however, which is going to be impossible using blender objects in Unity. What I want to do appears too complicated to work, but I'm just going to do something more simple.
     
    Last edited: Feb 14, 2016
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,350
    That sliver is due to the gradient texture wrap mode set to repeat (the default) instead of clamp. Just select the texture and change it. Using a cube doesn't change this behavior.
     
  5. WilkinsMicawber

    WilkinsMicawber

    Joined:
    Jan 22, 2016
    Posts:
    27
    The image is being lain across each face once. Clamping it doesn't appear to change anything. I have a gradient that fades the texture along one face fine, but on each edge of the plane, you can see the same texture with the same gradient value. So, instead of the object fading into nothing, it fades into almost nothing with a sliver of the far side of the plane at the end.