【问题标题】:Adapt AR video to background使 AR 视频适应背景
【发布时间】:2018-11-06 18:20:13
【问题描述】:

我有一个视频在 AR 场景中检测到他的第一帧时开始播放。这幅画似乎栩栩如生。视频和图片以相同的颜色绘制。 如何让视频动态适应不同光照的场景?

What I have now – color of video is very different from background color
What I want to achieve. Example 1
What I want to achieve. Example 2 in another lighting
.
我使用 SceneKit
我在 SKScene
上添加了 SKVideoNode 我在方法中编写了我的代码

func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor)

【问题讨论】:

    标签: swift scenekit arkit


    【解决方案1】:

    在 ARKit 2 中,您可以使用 ARWorldTrackingConfigurationenvironmentTexturing 属性为场景添加逼真的光照。如果您不需要超级具体,可以将其设置为 .automatic,如果您想完全控制环境纹理,可以将其设置为 .manual

    https://developer.apple.com/documentation/arkit/adding_realistic_reflections_to_an_ar_experience 本页更好地解释了环境纹理

    对于ARImageTrackingConfiguration,您可以向视频场景添加灯光并使用ARLightingEstimate 的属性更新其灯光。从ARSessioncurentFrame 属性或通过将视图控制器设置为委托并使用session didUpdate frame 方法获取ARLightingEstimate

    【讨论】:

    • 使用ARImageTrackingConfiguration,您可以使用ARFramelightEstimate 属性获得基本的光照估计
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多