Search Unity

can you Cast transparent cutout shadows but dont render the object ?

Discussion in 'Shaders' started by Darkmonk, Jan 24, 2014.

  1. Darkmonk

    Darkmonk

    Joined:
    Nov 3, 2010
    Posts:
    50
    Hi,

    I have a long fence in my scene and i want to use a transparency shader but only the cutout versions cast shadows, the cutout shader does not look good enough ingame as it goes into the distance so i plan on using a proxy version of the fence to cast the shadow and render the version of the fence that has the full transparency shader on it.

    Is it possible to make a transparent cutout shader that casts a shadow but is not visible to the camera ? if so can somebody point me in the direction of how to do it ? I am an artists so pls keep and code talk simple :D

    I have looked around to see if anyone has asked this before and i have seen some posts where the object casts a shadow but does not render however i need it to be cast through the alpha texture of the object and so far i cant find any examples.

    thanks,
     
  2. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    If you draw the fence using a pure white texture, with shadows, then you can drawn the colored fence on top of it in multiply blend mode?
     
  3. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    I guess the easiest way would be to set the ColorMask to 0 in the standard rendering pass. And then don't forget to fallback to another cutout shader for the shadows.