缩小模型以显示闪烁的阴影。怎么解决呢?

时间:2019-07-18 12:55:17

标签: ios swift xcode scenekit arkit

我正在尝试在模型的深度侧显示阴影。但是当我缩小模型时,它在模型上显示阴影闪烁。我已附上阴影代码。请检查随附的代码,并根据可能对其进行改进

        `var light = SCNLight()
        var lightNode = SCNNode()
        light.castsShadow = true
        light.automaticallyAdjustsShadowProjection = true
        light.maximumShadowDistance = 40.0
        light.orthographicScale = 1
        light.type = .directional
        light.shadowMapSize = CGSize(width: 2048, height: 2048)
        light.shadowMode = .deferred
        light.shadowSampleCount = 128
        light.shadowRadius = 3
        light.shadowBias  = 32
        light.zNear=1;
        light.zFar=1000;
        light.shadowColor = UIColor.black.withAlphaComponent(0.9)
        lightNode.light = light
        lightNode.rotation = SCNVector4Make(2, 0, 0, -Float.pi / 3)
        self.sceneView.scene.rootNode.addChildNode(lightNode)`

正常结果 Normal

缩小结果 enter image description here

0 个答案:

没有答案