- Home /
Static+Real Time lighting in Angry Bots Demo
Hello Everyone. I'm trying to understand how works the lighting in AngryBots demo 4.0.
Taking about the illumination from the scene mentioned above, there are no light probes, the light settings are on default values just like when you create them and the mesh player and everything that isn't static is clearly illuminated in realtime by the lights that makes also the lightmaps. I tried to make something similar into a new project, but when I bake the scene, dynamic objects can receive the light but it's applied twice!! ('cause there's already the lightmap on static objects) and I don't want this. If I change settings to avoid this issue, dynamic objects don't receive illumination. Then I tried to bake the angrybots demo as it is, but everything is ok. No lights are applied twice and dynamic objects are perfectly illuminated from static lights.
If you make something like this in "Stealth Demo", there is the same issue. But it's different because there are light probes in the scene.
So my question is, why this is not happening in "AngryBots"? There are some sort of options in the project/program settings that allow a light to be static and dynamic on the same time? Some sort of script in the scene? Or maybe the shaders?
Thank you in advance
"If I change settings to avoid this issue, dynamic objects don't receive illu$$anonymous$$ation." - - I dont know much about lightmaps but in your scenario/new project where objects didn't receive illu$$anonymous$$ation, do those objects use a material and shader other than diffuse?
Answer by Mattia-Furlan · Jan 16, 2014 at 01:33 AM
Hello 411. Thanks for the reply. I looked to the shaders on how they reacting to the lights into the demo scene. Dynamic meshes like "Player" and "Enemies", have a standard shader with some edits at the script, that can receive the illumination with no problems leaving the light settings to the default values, but I noticed that they can be affected by one light at time and within a certain distance range, while for the ambient (everything that is static) another shader has been applied. This makes the trick for NOT RECEIVING any direct illumination (in fact, if you turn off lightmaps it's flat) but makes possible to have a lightmap embedded when the bake process is complete. So that's why the light is not doubled.
I understand it because was the only thing that actually I didn't checked. In fact in my scene all the meshes have a standard diffuse material. That's why baked lights are applied twice.
Your answer
Follow this Question
Related Questions
How to create light like in minecraft? 1 Answer
cast shadow - export lightmap from 3ds max to unity 2 Answers
Which Is The Better Lighting, Progressive CPU Or Enlighten? 1 Answer
Custom Sprite Shader Ignore Light 1 Answer
bake error 1 Answer