Search Unity

Unity 5: Lightmapping with Shaderforge's Opacity clip/Cutoff

Discussion in 'Shaders' started by Bruce_GMC, Jun 23, 2015.

  1. Bruce_GMC

    Bruce_GMC

    Joined:
    Oct 23, 2014
    Posts:
    65
    Hey everyone,
    I have been dealing with an issue with Unity and shaderforge for quite a while now and I cant get to the bottom of it. I think that it's Unity's problem.

    The problem is that in deffered rendering mode, Unity will not lightmap any shader with the Opacity Clip/ Cutoff property. This issue is open with the dev of shaderforge but I dont think he can fix it because again I believe it to be a Unity issue. I have tested this with the Unity standard clipping shader as a control and the results can be seen clearly.

    http://shaderforge.userecho.com/top...mapping-with-shaders-containing-opacity-clip/

    At first the objects don't receive any shadow, after deleting the cutoff value from the properties of the shader however I receive shadow but they are incorrect as it is not taking in to account the alpha mask.

    Edit: After starting a new stock project with standard shaders and deferred rendering I have gained some evidence that it is indeed shader forge.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      425.1 KB
      Views:
      1,122
    Last edited: Jun 25, 2015
  2. 8bit4life

    8bit4life

    Joined:
    Sep 30, 2014
    Posts:
    9
    Could this be the same issue?

    An object with a cutout shader that worked on 4.6 vs baked lightmaps has no lights baked on it in Unity 5.1 (latest version, forward rendering).

    The parts the are apparently not affected by lightmapping at all is the parts below the cutout surface.
    I have tubes running below a "metal" grill and the tubes are always black.
    Even if I put highly emissive stripes on the tubes, the stripes are bright, but the rest of the tubes are still back. They don't even receive emissive light from themselves/their neighboring tubes.

    I migrated towards the Standard Shader for cutout / backed, but still no joy.

    All other objects around it receive all lights, including the emission from this cutout object.
     
    Last edited: Jul 28, 2015