Search Unity

[Solved (No lightmaps involved) ] (Unity 2017.3) Prefabs with lightmap

Discussion in 'Global Illumination' started by Gunging, Apr 15, 2018.

  1. Gunging

    Gunging

    Joined:
    Sep 6, 2016
    Posts:
    139
    Hello, I have this "Neon" furniture, it glows and everything, however, it requires about 6 lights per piece to look good, which I believe could be reduced to 2 lights and a lightmap, but I have no idea how to (Im new to lightmaps) and all I can find related to this is in Unity 5.

    Here is an image of the simplest furniture piece: the glow pole.
    upload_2018-4-14_22-30-44.png
    As you can see, there are 6 lights, of which only 5 and 6 illuminate the world, ignoring the glow-pole itself, while the lights 1-4 serve as self-illumination and their culling mask is only the glow-pole.

    If I remove the four self-illumination lights and include the glow pole in the culling mask of the lights 5 and 6, it looks like this:
    upload_2018-4-14_22-34-40.png
    Because lights 5 and 6 are inside the pole, they fail to illuminate it completely.​

    And if I make the purple glass material emissive, it looks like this:
    upload_2018-4-14_22-37-56.png
    (The texture is obscured completely by the emission)​

    Though "6 lights per piece" might not sound a lot for some people, when you have enough furniture it destroys your computer, here is a small room of the scene:
    upload_2018-4-14_22-21-3.png

    And, if I show you the same view, but selecting the lights...
    upload_2018-4-14_22-21-46.png

    So, as you can see, there is a ton of lights, and this is not even with the "6 lights per piece" rule, as some of the lights were deleted because a light from another nearby furniture piece already covered its job.

    So, I am thinking I might be able to lightmap the self-luminiscence lights and reduce by two-thirds the amount of lights running real-time. Light mapping the whole scene is not an option.

    Any help? Thanks in advance.

    EDIT: I was thinking perhaps the material itself not receiving shadows, but if you do that it still needs light to not appear black, I've never worked with shaders so I don't know if that is what causes it.
     
    Last edited: Apr 15, 2018
  2. Gunging

    Gunging

    Joined:
    Sep 6, 2016
    Posts:
    139
    Well, for now I found a "solution" that is good enough for me: Replace all the self-illumination lights for two directional lights pointing in opposite directions at angles that are not perpendicular nor parallel to any axis...
    upload_2018-4-15_12-47-17.png
    upload_2018-4-15_12-48-9.png
     
  3. StefDevs

    StefDevs

    Joined:
    Jan 20, 2014
    Posts:
    23
    You probably want to use emission with a texture. You might even be able to just use your current albedo as your emission instead. That or use use an unlit transparent shader/material (probably a better option now that I think of it, unless you want specular as well).
     
  4. Gunging

    Gunging

    Joined:
    Sep 6, 2016
    Posts:
    139
    Yeah, both work very well. I don't know how I have been using unity for like a year and didn't know Emission could have a texture, and well, that there was something else to the standard shader - I also can't believe I did not find out about this when I searched "Make gameObjects be always illuminated" on google. Thanks

    Why is Unlit better than Emissive transparent? Is it performance-wise or....