Search Unity

Help with lighting and transparent material

Discussion in 'Global Illumination' started by uzmakappa, Jun 11, 2018.

  1. uzmakappa

    uzmakappa

    Joined:
    Jun 10, 2018
    Posts:
    1
    TLDR: How can I make light shine through an object that has other objects inside it without allowing those "other objects" to be visible when the light shines through the first object? Or, in other words, how can I make a material transparent enough for light to shine through but opaque enough to hide the other objects behind it? (Kind of like how you can see light shining through a lamp shade without seeing the shapes/shadows of the wire framing or the lightbulb inside)


    The full story:
    I'm trying to create a realistic floating lantern, but I'm having difficulties getting it to look right when it's lit up. I've set the material for the "paper" part of the lantern to transparent so that the light from the fire particle system emitting out of the "wick" will shine through the paper. As you can see in the following picture, the lantern looks fine from the bottom; it's when the lantern is viewed from other positions that I start to have problems.
    Screen Shot 2018-06-10 at 6.48.10 PM.png
    When the camera views the lantern from a position where the bottom opening of the latter is hidden from view, you can see the objects at the bottom of the lantern through the paper, but I don't want that. In this picture, you can see the top half of the wick through the paper:
    Screen Shot 2018-06-10 at 7.21.29 PM.png
    At first I thought that maybe the problem was that the wick was blocking the light from reaching the paper lantern, so I tried setting the wick's material to emit light, but that's not a good solution because the lantern isn't static (I'm eventually going to make it float up).
    In this picture, there's a whole empty gray circle at the bottom of the lantern:
    Screen Shot 2018-06-10 at 7.10.19 PM.png
    Because of this image, I thought that maybe the problem was the open bottom, so I edited the lantern object to keep the bottom face of the cylinder, and that did fix the lighting, but it caused other problems.

    Could anyone please help me solve this problem? I'm new to Unity, and I honestly don't even know what to Google for help with this. Thanks so much in advance!
     

    Attached Files:

  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    Are we talking realtime lights? Baked lights? Does turning off Cast Shadows on the parts of the lantern where you want light to go through help?