小编dup*_*upi的帖子

如何在Sceneform中实现环境HDR照明估算?

我正在尝试使用新的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 < …
Run Code Online (Sandbox Code Playgroud)

java augmented-reality arcore sceneform

9
推荐指数
0
解决办法
194
查看次数

标签 统计

arcore ×1

augmented-reality ×1

java ×1

sceneform ×1