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

Projectors: Don't Project On Transparent Areas? (Projecting on Cutouts) *Please help*

Discussion in 'General Graphics' started by Merman, Dec 11, 2014.

  1. Merman

    Merman

    Joined:
    Nov 16, 2014
    Posts:
    51
    Hello, everyone.

    I am trying to get projectors to work with alpha test/cutout shader materials. Setting the Ignore Projectors tag to "false" enables this, but of course the projector then causes the transparent/invisible parts of the rendered object to become visible. Is there a way to make it work properly (not projecting on the transparent parts of the cutout)?

    What little I've been able to find on the subject suggests that it is impossible ... but I'm finding that somewhat difficult to believe.

    I noticed that the standard multiply projector uses "AlphaTest Greater 0". Shouldn't that automatically cause the projector to only project onto areas that have an alpha value greater than 0 (0 being fully transparent)? Based on the fact that I'm having to ask about this, the answer seems to be "no, it shouldn't". But then what exactly is that line's purpose?

    I tried using various blend modes, but none seemed to create the desired effect.

    Thank you in advance for any assistance.
     
  2. Merman

    Merman

    Joined:
    Nov 16, 2014
    Posts:
    51
    I'd really love some help with this.
    Am I failing to explain the issue correctly?
     
  3. Merman

    Merman

    Joined:
    Nov 16, 2014
    Posts:
    51
    Is it that I've posted this in the wrong section?
     
  4. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    576
    No its the right one just nobody knows the answer, im facing same issue, but im too busy right now to look into it, lets keep thread afload until we dig something.
     
  5. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    No, it's a test in the projector's shader, which doesn't know about any other shaders already applied.
    I know what it does but not why it would be in the shader; my guess is that it at least used to provide a performance benefit on some hardware.
     
  6. Merman

    Merman

    Joined:
    Nov 16, 2014
    Posts:
    51
    bparmarphoenix likes this.
  7. Merman

    Merman

    Joined:
    Nov 16, 2014
    Posts:
    51
    The discussion seems to have hit a dead-end.
    I could still really use help with this.
     
  8. Merman

    Merman

    Joined:
    Nov 16, 2014
    Posts:
    51
    I'm surprised that this doesn't seem to be very common.
    Are projectors generally avoided? Are cutouts generally avoided?

    I imagined it was somewhat common to have a situation where, for example, 2D sprites (with transparent borders) would need to be projected upon while still retaining their transparency.
     
    Last edited: Mar 15, 2016