- Home /
GameObject with DirectionalLight component not being iluminated
I'm doing an augmented reality application using Vuforia. For each gameObject in my augmented reality scene I add a Light component to it and define it as a DirectionalLight. In this scene the gameObjects are iluminated, but when I change to another scene (not destroying the gameObjects) they are not. I already checked and they still have the Light component, but are not iluminated for some reason. Do you guys have any clue of what might be the problem?
P.S.: The second scene is a normal scene with no interaction with the phone's camera. And the projection on the camera is orthographic.
Answer by cupsster · Aug 02, 2012 at 09:23 AM
Yao are doing ia all wrong. You should need only one directional light if you mean that by "component" word. Instead of adding a lot of lights, set us light culling masks. And to preserve object to next scene you need to attach your "dont destroy on load" also to lights in scene or make hierarchy and atach that script to hierarchy root. This way all childrens should be preserved and it is more easy to manage that.
I tried to just put one directional light having my main camera as parent, but my gameObjects get poorly lighted. $$anonymous$$y culling mask is set to "Everything" so all the objects in scene get affected by the light...
I woud not parent light to camera, only if you need to move light along with it. If objects are poorly lit, adjust light intensity, play with shaders or go to project settings and change ambient light color.
At least in my augmented reality scene the light have to be child of the camera. In my normal scene I tried to put my light with no parent as it is fixed, but my model's are still not lighted. I got 2 layers, but i should not make a difference in my lighting.
Here is apropriate screenshot of curent situation and waht you want to archive.
I didn't understand...do you want me to do a screenshot of the current situation?