- Home /
Emissive material not working despite setting objects to "Static"
I've searched for solutions all over the internet for this one but couldn't find anything useful.
In my scene I have a sphere and a room (made of "Cube" game objects). I've applied a material to the sphere which I called "emissive_red". I've set the color of the material to red and the color of the Emission to red as well. Under Emission, I've set Global Illumination to "Realtime". I've set the sphere to "Static" and I've also set the walls (i.e. the cubes) to "Static".
In the "Lighting" window, both "Realtime GI" and "Baked GI" are checked.
Unfortunately, the only change I've noticed is that the sphere just looks brighter red. But it's not emitting any light onto the wall. I've set the emission all the way up to 99. It still doesn't work.
What am I missing?
By the way, I'm using Unity version 5.6.1 (personal).
Facing this problem before. $$anonymous$$y case is simply close the Realtime Global Illu$$anonymous$$ation first, and then wait for the baking. Actually the baking takes some time, wait a while for calculation. There will be a loading bar on the lower right corner.
When you say that I should close the Realtime Global Illu$$anonymous$$ation, do you mean I should uncheck it in the "Lighting" window?
Yup, may be you should try this first. Usually the emission illu$$anonymous$$ation is handled by the "Baked GI". Realtime will sometimes do$$anonymous$$ates the rendering of this type of illu$$anonymous$$ation, dun know why, may be bug. But, once uncheck the Realtime box first, then wait for the baking, eth goes well. $$anonymous$$y experience only.
Unfortunately, this didn't work either. It bakes for a while, but once it's done, it just stays the same. There's no change.
Completely wrong, emission doesn't "Usually handled by the Baked GI". I believe you mixed up Realtime lighting with Realtime GI. Let me try to explain it:
Realtime Lighting is lighting mode when there is no Indirect Lighting. To use it Realtime Global Illu$$anonymous$$ation and Backed Global Illu$$anonymous$$ation should be unchecked.
Realtime GI use some precomputation to use indirect lighting, to use it just check corresponding checkbox.
Backed GI prebake some data (which exactly depend on Lighting mode) but in all 4 modes indirect lighting baked into lightmap (and lightprobes) despite Realtime GI, where realtime lightmap and realtime lightprobes are used.
Emission is indirect light thus it doesn't work in "Realtime Lighting" (not Realtime GI) which have no indirect at all. But all other Lighting modes can interact with emission in it's own ways.
About using Realtime GI and Backed GI together - documentation states that technically they can be used together but it have no sense to do this, because you will have computation and memory overhead for both systems, besides the fact that it is way harder to maintain such scenes.
It seems to be working now, although I'm getting a whole bunch of errors like "Failed executing external process for 'Visibility' job" and "Cancelling DisplayDialog because it was run from a thread that is not the main thread". Technically, it's the same error over and over again. But the emission still works though. I guess maybe I should just ignore the errors?
I think I also figured out why the emission wasn't working last time. I noticed that when I change the color of the walls' material to something lighter (like white), I can see the emission of the sphere's light on the wall. But when I make the color of the wall darker (like blue or black), I can no longer see the emission. So it seems that, for some reason, the emission will only bounce off other objects if their material(s) have a light color. Is it supposed to be this way?
Sure. If you think about color of the surface in physics terms it will explain such behavior. For instance Blue surface is the surface which absorb Red light waves. And if you illu$$anonymous$$ate such surface only with Red light waves - surface will absorb them and you will see no lighting at all. You can see indirect light contribution by switching Scene Shading mode to Realtime GI -> Indirect if you are using Realtime GI or Baked GI -> Baked Lightmap in case you are using $$anonymous$$ixed or Backed lighting modes. ![alt text][1] [1]: /storage/temp/96399-screenshot-1.pngIs it supposed to be this way?
Those errors are some old bugs, if you dun do anything wrong. I heard someone figure out it by rena$$anonymous$$g the scene, I dun know, I never face those bugs. Besides, there will be baked light no matter which color you are using. Although that may be not obvious with dark color. You can alter the emission strength in shader setting UI, it will be more obvious. I disable one block from baking, so you can notice the difference.
@$$anonymous$$atrixTai Hi. Apologies for the late reply. I set the emission strength all the way up to 99. The wall color was entirely black. It still didn't work. It only seems to be working if the wall color is lighter. I also noticed that the emission doesn't bounce of the walls if the metallic-ness of the walls' material is set high. This is not a good thing because I'm currently working on a game where an object should be emitting light over a fully metallic surface.
Hello. Could you please make screenshot of your Lighting window? Several guesses without screens are:
check if Indirect Intensity in Lightmapping Settings is more than 0
"Auto Generate" checkbox should be checked otherwise you should manually press Generate Lighting button after changes have been made
try to clean GI Cache in Edit->Preferences->GI Cache -> Clean Cache button
Edit: Sorry, for some reason comment's didn't load and only now I see all conversation. Will add some comments in a few $$anonymous$$utes.
Hi, @Garrettec I see, thx for correcting my misunderstanding. So, is that mean for indirect light, actually both realtime GI or baked GI can handle it? Also, is that only realtime GI material can receive the emission light from realtime GI material and vice versa? Thx.
@$$anonymous$$atrixTai Good day, Sir! :)
Exactly, that is the main purpose of both lighting modes to deal with indirect lighting. If you want to learn more technical details I suggest you to read this https://docs.unity3d.com/$$anonymous$$anual/GIIntro.html manual page for GI and this https://docs.unity3d.com/$$anonymous$$anual/Light$$anonymous$$odes.html for Lighting modes differences.is that mean for indirect light, actually both realtime GI or baked GI can handle it?
If in inspector for emissive material Global Illu$$anonymous$$ation mode set to Realtime - it work for Realtime and for $$anonymous$$ixed GI. If Global Illu$$anonymous$$ation mode set to Baked - it work only for mixed GI. The key feature here is that for realtime emission you can change material parameters (color, intensity etc.) in runtime. To do this you must call some functions from code, presumably DynamicGI.SetEmissive, but documentation is very vague about realtime emission. Here is my question about it, you can add your vote for it if you want to have clear instruction as I do ;) http://answers.unity3d.com/questions/1367559/how-to-use-emissive-materials-with-global-illu$$anonymous$$a.htmlonly realtime GI material can receive the emission light from realtime GI material
Answer by jeango · Jun 22, 2017 at 08:04 AM
In your lighting, are there any ongoing jobs? If not, is AuTo Generate checked? if not, have you clicked on "Generate Lighting"?
On a side note, it's generally not a good idea to check "Baked GI" when you're working on setting up your scene. The baking process can be very long, and whenever you move a static object around it's re-calculated. It's always better to check the baked GI once you're satisfied with your scene setup
Thanks $$anonymous$$go! I noticed the little grey text at the bottom of screen saying Auto generate light disabled (or something like that), didn't look like a clickable option but lo and behold it was, now generating light. Such a simple solution- but I kind of understand why it's off by default because it is quite a bit of processing power.
Answer by LukeNukem44 · Sep 04, 2017 at 09:36 AM
Hello, @TheSaviour,
I'm sorry that I don't have the answer either. I just want to back you up as there are so many outdated tutorials about it and so many people who keep suggesting useless things when it's (was) as easy as plug and play. I know from a personal friend who is a Unity expert that he doesn't use it, and it's reasonable to think most people giving answers don't use emission.
Frustratingly, I have the exact same problem as you! The very first time I was using material emissions earlier this year, it was working perfectly fine. There were no issues. Now, doing the exact same thing, it doesn't work!
I was using 5.6.0f3 when it did work. I learned about the feature earlier this year after watching this life video: [ https://youtu.be/sbAn811mSuA?t=1h35m00s ] Particularly the red quad emission got me interested. It worked for me without a hitch. If you can get something from this video to add that might help, please share. Although they are using old Unity.
I am now using 2017.1.0f3 and a month ago I noticed there was no way to get it to work.
If I ever figure it out, I will let you know.
Answer by Alex-Slavski · Jan 14, 2018 at 08:24 PM
@TheSaviour Had the same issue as you. Fixed it. It turns out that although my wall prefabs have been set to static, their instances in the scene have not. After checking them to static as well the issue was fixed.
What do you mean with "their instances in the scene have not"? How do you make sure it is?
Answer by calighula · Sep 30, 2017 at 12:03 PM
Hi @TheSaviour and @LukeNukem44 ,
I setup my scene as you did, and I had the same problem. It looks like the problem was not in the emissive material, but on the black material. Black means an absence of light, and so it will not show any of the effects of the sorrounding lights.
Replace the black colour with a dark gray and you will start to notice the emissive material.
I hope this was your problem, otherwise I have no idea where your problem is.