From the course: AR Development Techniques 02: Lighting and Physics
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Ambient light estimation: Part 2
From the course: AR Development Techniques 02: Lighting and Physics
Ambient light estimation: Part 2
- [Instructor] In this video we are going to implement a 'Warning text' and show it to the user when he or she is in a low lighting condition. So first lets create the text component. Go to Canvas, right click, UI, text. Let's make it white, and for the text I'll write, "Warning, Low light. Move to an area with better lighting." The text doesn't show up fully because the text box is small. So let's increase the width to 300 or 500. This is better and let's center it and move it at the top and anchor it. Now that we have our text component, we can enable it or disable it inside the script according to the lighting conditions. So let's open the image light estimation script that we created in the previous video. Inside the script, we want to check the average brightness value. So I'll type in "if led.average brighness.value is less than 0.1 then we are going to show the warning text. Else, we will disable the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.