dup*_*upi 9 java augmented-reality arcore sceneform
我正在尝试使用新的Google API API环境HDR进行照明估算。我正在按照开发人员指南中的说明进行操作,但是我不知道如何实现特定于应用程序的代码。
我已经像这样配置会话:
config.setLightEstimationMode(Config.LightEstimationMode.ENVIRONMENTAL_HDR);
session.configure(config);
Run Code Online (Sandbox Code Playgroud)
并将此代码放入我的更新调用中
private void onSceneUpdate(FrameTime frameTime) {
if (fragment instanceof ArFragment && loadedRenderable) {
if ( frame == null )
return;
LightEstimate lightEstimate = frame.getLightEstimate();
// note - currently only out param.
float[] intensity = lightEstimate.getEnvironmentalHdrMainLightIntensity();
float[] direction = lightEstimate.getEnvironmentalHdrMainLightDirection();
//app.setDirectionalLightValues(intensity, direction);
float[] harmonics = lightEstimate.getEnvironmentalHdrAmbientSphericalHarmonics();
//app.setAmbientSphericalHarmonicsLightValues(harmonics); // app-specific code.
// Get HDR environmental lighting as a cubemap in linear color space.
Image[] lightmaps = lightEstimate.acquireEnvironmentalHdrCubeMap();
for (int i = 0; i < lightmaps.length /*should be 6*/; ++i) {
//app.UploadToTexture(i, lightmaps[i]);
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道如何处理这些方法提供的参数
我只想用与场景相同的光照条件来照亮3D模型。谁能帮助我实现这一目标?还是提供任何示例?