Comments (2)
This is based on ARKit's UnityARAmbient and works for me:
using UnityEngine;
using UnityEngine.XR.ARFoundation;
[RequireComponent(typeof(Light))]
public class ARLightAmbient : MonoBehaviour
{
private Light l;
void Start ()
{
l = GetComponent<Light>();
ARSubsystemManager.cameraFrameReceived += OnCameraFrameReceived;
}
void OnCameraFrameReceived (ARCameraFrameEventArgs eventArgs)
{
l.intensity = eventArgs.lightEstimation.averageBrightness.Value;
l.colorTemperature = eventArgs.lightEstimation.averageColorTemperature.Value;
}
void OnDisable ()
{
ARSubsystemManager.cameraFrameReceived -= OnCameraFrameReceived;
}
}
from arfoundation-samples.
The option enables it on the device, but you need to subscribe to the ARSubsystemManager's camerFrame event, which will provide lighting information. ARFoundation does not do anything automatically with this information other than provide it to you.
from arfoundation-samples.
Related Issues (20)
- Crash on Oculus IN-64517 HOT 1
- Does AR Foundation support hand tracking on Quest 3 via OpenXR Meta HOT 6
- Would this be too computationally intensive? HOT 1
- How to localize within an AR world?
- How to obtain the label of the plane classification? HOT 1
- How can I determine if a coordinate point is inside of a plane? HOT 5
- [Bug] Unable to initialize XR at runtime on iOS 17.2.1 HOT 2
- Web AR HOT 1
- Oculus2 pathThrough issue[Bug] HOT 2
- I'm not sure what I am doing wrong... HOT 1
- AR Foundation light estimation brightness,ColorTemperature NOT working
- AddRaycast() always returns null HOT 1
- Raycast poor performance? HOT 2
- Build Failed while running Xcode HOT 19
- Can I use an iPad instead of an iPhone HOT 4
- [Bug] Low FPS results in face tracking to stop working HOT 1
- How to create ARFoundation's ARAnchor from ARKit's ARAnchor? HOT 2
- 为什么我发布成安卓程序,菜单都是灰色,用不了呢a HOT 2
- Support of MultiPeer for the visionOS platform HOT 2
- ARFoundation how to serializes ARWorldMap information for the specified region ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arfoundation-samples.