【问题标题】:Setting lighting in ARKit framework在 ARKit 框架中设置光照
【发布时间】:2018-04-03 07:33:36
【问题描述】:

好的,我是 SceneKitARKit 的新手,我只想设置我添加到场景中的任何模型以获得一定的明亮照明。我已经尝试了使用 ARSceneView 自动更新照明设置的所有不同配置,但唯一真正产生明显差异的是autoenablesDefaultLighting

func setup() {

    antialiasingMode = .multisampling4X
    //autoenablesDefaultLighting = true
    preferredFramesPerSecond = 60
    contentScaleFactor = 1.3

    if let camera = pointOfView?.camera {
        camera.wantsHDR = true
        camera.wantsExposureAdaptation = true
        camera.exposureOffset = -1
        camera.minimumExposure = -1
        camera.maximumExposure = 3
    }
}

不管从相机获得的照明(我知道 ArKit 能够做到),我只想始终设置 1 个照明设置。我希望我的场景内容像这样被点亮:

这可能吗?为了达到这种效果,我将sceneView.scene.lightingEnvironment 设置为等于什么?

【问题讨论】:

    标签: ios swift scenekit augmented-reality arkit


    【解决方案1】:

    根据文档,您应该能够在某个位置创建一个 SCNNode,然后向其添加一个 SCNLight:

    https://developer.apple.com/documentation/scenekit/scnnode https://developer.apple.com/documentation/scenekit/scnlight

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-25
      • 2019-03-17
      • 2010-10-13
      • 1970-01-01
      • 2020-12-23
      • 2019-05-09
      相关资源
      最近更新 更多