Environment Matching
Lens Studio comes with Several techniques for adding realism to your AR objects.
Take a look at the ML Environment Matching Template for an example of the techniques covered here.
Blur Noise Estimation
The Blur Noise Estimation Component utilizes a Machine Learning model to analyze the camera input and applies a similar artifact to your AR objects in order to allow it to blend better.
Note that this feature only applies to the front camera, and will only work when the user’s device is capable of running the estimation. When not available, the feature will automatically disable itself.
You will likely not see the effect in the Preview panel as it is very subtle. The effect is most visible in darkly lit conditions and when there’s a lot of movement.
Add Blur Noise Estimation
In your Objects
panel, select the object containing your Camera
component. Then, in the Inspector panel, press the Add Component
button and choose Blur Noise Estimation
.
Dynamic Environment Map
The Dynamic Environment map generates an environment map in real time from some input–usually the Device Camera Input
. This Dynamic Environment map will allow your object to receive lighting from the real world. When available, this feature will automatically leverage a Machine Learning model to improve the results of the generated environment map. When not available, the system will automatically fallback to just using the inputted texture.
With Dynamic Envmap | Without Dynamic Envmap |
---|---|
![]() | ![]() |
The Machine Learning generated environment map is only available in the front camera.
Add Dynamic Environment Map
In the Objects
panel, select your Light object. In the drop down, you can select Environment Map
. In the Input
field, select your Device Camera Texture
.
Now, all your PBR material will use the generated environment map to light itself!
Try using the Webcam option in the Preview
panel and shining a light on yourself to see the effect in action!
The ML generated environment map may be blurred such that it won’t allow your object to have a mirror effect. However, you can modulate the result with a simple reflection based on a texture. Take a look at the ML Environment Matching template to learn more about this technique.