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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Cutout material won't let baked emission through itself

Discussion in 'Global Illumination' started by 8bit4life, Jul 30, 2015.

  1. 8bit4life

    8bit4life

    Joined:
    Sep 30, 2014
    Posts:
    9
    Hi All,

    When using a standard cutout shader/material, it won't let emission through the "holes" so that anything behind the cutout surface remains unlit when baked.
    This has worked with 4.6 and I'm struggling to get it working again after upgrading to Unity 5.

    Please see the examples and the attached scene archive below.

    Using an emissive surface, the sphere receives no light/shadow, while its cutout "cage" is pretty hardly lit:

    emission_cutout_bake.png

    Same setup, with a spotlight instead of the emissive surface (light is being let through the grill as expected):

    spotlight_cutout_bake.png

    Does anybody know how to get this working?
    My real (complex) scene works with emission almost exclusively and I'd like to keep it that way.

    Thank you.
     

    Attached Files:

  2. SpiriTx

    SpiriTx

    Graphics QA Unity Technologies

    Joined:
    Apr 12, 2012
    Posts:
    252
    Objects can should be marked as transparent for GI. In some cases it works fine without it, but in some, as this one, it doesn't.
    So just follow these simple steps to make it work:
    1. Create new Lightmap parameter using Create in project browser
    2. Mark it as transparent
    3. Assign to cube (cage) object
    4. Rebake
    Screen Shot 2015-07-31 at 17.53.43.png
     
  3. 8bit4life

    8bit4life

    Joined:
    Sep 30, 2014
    Posts:
    9
    Dear QA Overlord,

    Thank you for taking the time to help me!
    Well, I know about the method you're using, but doesn't that mean that I loose the shadows of the cage on the sphere?
    Your screenshot also suggests you do lose the grill shadows.

    Is there a way to get it working complete with shadows?

    Thank you.
     
  4. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hi! Emission will not work well in this case, as it is designed to emit low resolution indirect lighting. Unless you model the cage as geometry and use extremely high resolution, I don't think you can make this work. Emission is not suited for this case, you should use a bunch of realtime lights to approximate an area light and use realtime shadows or a cookie to add the cage markings
     
  5. 8bit4life

    8bit4life

    Joined:
    Sep 30, 2014
    Posts:
    9
    Hi KEngelstoft,

    Thanks for your reply!
    Well, that's exactly what I'm doing. Faking it with baked lights (doesn't look very nice).
    I didn't do this in Unity 4.6 and it had very nice shadows. In fact, in my real scene, it's not two objects, but one. A segment of a road and the same mesh has this grill and also tubes running under the grill. Looked really nice with the grill shadows on the tubes in 4.6. Unless I mix things up, but I don't think I do.

    Thank you.