google-ar / arcore-unity-sdk

ARCore SDK for Unity
https://developers.google.com/ar
Other
1.4k stars 403 forks source link

While calculating ambient probe, is it multiplied by some coefficients as like helloar.java sample 1.21.0? #767

Closed huseyinsavran closed 3 years ago

huseyinsavran commented 3 years ago

In the 1.21.0 version of android arcore sdk, helloar.java sample uses sphericalharmonics. but it multiplies the sphericalharmonics values by these coeffcients: sphericalHarmonicFactors = { 0.282095f, -0.325735f, 0.325735f, -0.325735f, 0.273137f, -0.273137f, 0.078848f, -0.273137f, 0.136569f, }

This multiplication came from Filament renderer implementation. I couldn't understand the reason. Does unity arcore sdk do the same? I saw that the spherical harmonics are returned by native unity session code. I couldn't find c sources, so I don't figure out the algorithm of native session.

huseyinsavran commented 3 years ago

I created two identical application with helloar java and helloar unity. These are printing the first 3 number of 27 coefficients. Both apps print similar numbers with the same real camera angle and device. So, Unity multiplies spherical harmonics numbers in native code.