- Home /
Making Camera adjust to indoor/outdoor lighting
Hey all,
I'm pretty new to scripting and I have a question. I've searched some for the answer but really am not even sure what terminology I should use to search for the answer. :) Anyway, my question is: is there a script I can use that will allow my camera (first person) adapt to lighting when moving from outdoors to indoors and vice versa - much like a video camera set to automatic does in real life. So, to be more specific, when I'm outside there'd be a normal level of exposure and inside would be darker but when I move inside the camera would adjust automatically making indoors a normal light exposure and outdoors much brighter (since sun light is brighter than indoor lighting naturally.)
Forgive me if this is confusing - I know how to explain it in film terminology but not so well in computer coding language :) Thanks in advance for any help.
Answer by AnthonyHJ-SAH · Sep 13, 2016 at 07:42 AM
It's called Tone Mapping.
Add the script by clicking the 'Add component' button in the inspector window for the camera or selecting the camera and using 'Component' in the menu bar: you want 'Image Effects -> Color Adjustments -> Tone Mapping' and this will try to change your colour balance to make darker areas darker and lighter areas darker by changing the overall light level of the screen. You also need to tick the "HDR" checkbox at the bottom.
After this, you can make you sunlight brighter and your indoor lighting darker and the script will adjust. Just be warned that you can end up with a washed out look if you are not careful.
See: High Dynamic Range Rendering in the Unity manual for more information.
Your answer
Follow this Question
Related Questions
Lighting on only 1 camera 1 Answer
Directional Lighting Bug 0 Answers
Improving the look of Unique/User Planned Scenes 0 Answers
Camera Scaled Up Breaks/Bugs Shadows 0 Answers
Rendering objects with sounds 0 Answers