Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 SirSmileX · Jul 10, 2017 at 08:58 AM · cameralightingmobilephone

Adjusting ingame light by what the smartphone camera sees (maybe greyscale?)

Hey guys, I'd like to create an AR game using my smartphone and I wondered if it is possible to adjust the lighting of the game depending on the real lighting (light source). So like the game fits into the real world a bit more. I don't know much about these things but I thought that it may be possible, to access the camera, grayscale the picture and looking for the area with area with the highest amount of white and therefore positioning a point light like this. And maybe it is possible to get the average color of the image to adjust the light intensity... does someone have an idea? Would it be possible without so much complex code?

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

Answer by AtGfx · Jul 10, 2017 at 09:22 AM

Hi !

I don't know how you can retrieve the output of the camera, but i'm sure that you can find it easilly on the web.

For the lighting, one solution can be to compute the average luminance (also check on web for formula) of the pixels of the camera and modulate your ambient light (global directionnal) according to that average.

Computing points light according to regions of the camera output which are brighter seams to be much more difficult. You must detect these zone, then compute a position in 3D of your point light to place them. I think that it won't be precise and your lights will flick a lot (due to change of position).

Finally you would probably have to make some timing measure to see how much time does it take to get the output of the camera to see the frequency where you can evaluate your lighting (maybe doing it each frame will be expansive).

If something is not clear, or you want to discuss about anything with more details, feel free to ask !

Hope it helps ;)

Comment
Add comment · Show 2 · 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
avatar image SirSmileX · Jul 10, 2017 at 09:34 AM 0
Share

Thank you for this answer. Helped me alot to view this feature from another perspective. I might just try to add the average lu$$anonymous$$ance first. Also I thought that if I do the 3D position computing I might just let it compute it at the start of the game (since the camera shouldn't change position that much). But that would be optional :)

avatar image AtGfx SirSmileX · Jul 10, 2017 at 09:36 AM 0
Share

You're weclcome ;). It's a good start with the average lu$$anonymous$$ance. Let me know if it works well !

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.

Follow this Question

Answers Answers and Comments

115 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Light Settings - Fog to a non-main camera? 0 Answers

Camera appearance black & white 1 Answer

Lighting Disabled. Black screen in Game view not in Camera preview 0 Answers

Skybox in HDRP 1 Answer

Change in lighting at a specific camera angle? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges