• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by 120matt · Sep 13, 2016 at 06:02 AM · cameralightingadjustexposure

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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Is there a camera light? 0 Answers

Shadows problem with big and small objects 0 Answers

Improving the look of Unique/User Planned Scenes 0 Answers

Camera Scaled Up Breaks/Bugs Shadows 0 Answers

Camera Overexposed 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges