Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 镜头移开时,场景阴影逐渐消失_Ios_Swift_Scenekit_Augmented Reality_Arkit - Fatal编程技术网

Ios 镜头移开时,场景阴影逐渐消失

Ios 镜头移开时,场景阴影逐渐消失,ios,swift,scenekit,augmented-reality,arkit,Ios,Swift,Scenekit,Augmented Reality,Arkit,我已经在Scenekit中设置了逼真的照明,但是当相机离开对象时,照明就会打开,照明会逐渐消失,最终完全消失 // LIGHTING let floorPlane = SCNFloor() let groundPlane = SCNNode() let groundMaterial = SCNMaterial() groundMaterial.lightingModel = .constant groundMater

我已经在Scenekit中设置了逼真的照明,但是当相机离开对象时,照明就会打开,照明会逐渐消失,最终完全消失

// LIGHTING
        let floorPlane = SCNFloor()
        let groundPlane = SCNNode()
        let groundMaterial = SCNMaterial()
        groundMaterial.lightingModel = .constant
        groundMaterial.writesToDepthBuffer = true
        groundMaterial.colorBufferWriteMask = []
        groundMaterial.isDoubleSided = true
        floorPlane.materials = [groundMaterial]
        groundPlane.geometry = floorPlane
        //
        charNode.addChildNode(groundPlane)
        // Create a ambient light
        ambientLight.light = SCNLight()
        ambientLight.light?.shadowMode = .deferred
        ambientLight.light?.color = UIColor.white
        ambientLight.light?.type = SCNLight.LightType.ambient
        ambientLight.position = SCNVector3(x: 0,y: 5,z: 0)
        // Create a directional light node with shadow
        directLight.light = SCNLight()
        directLight.light?.type = SCNLight.LightType.directional
        directLight.light?.color = UIColor.white
        directLight.light?.castsShadow = true
        directLight.light?.automaticallyAdjustsShadowProjection = true
        directLight.light?.shadowSampleCount = 64
        directLight.light?.shadowRadius = 16
        directLight.light?.shadowMode = .deferred
        directLight.light?.shadowMapSize = CGSize(width: 2048, height: 2048)
        directLight.light?.shadowColor = UIColor.black.withAlphaComponent(0.75)
        directLight.position = SCNVector3(x: 0,y: 5,z: 0)
        directLight.eulerAngles = SCNVector3(-Float.pi / 2, 0, 0)
        // Add the lights to the container
        charNode.addChildNode(ambientLight)
        charNode.addChildNode(directLight)

这里有问题吗?你做了一个陈述,似乎就这些。问题是如何解决这里的问题?你做了一个声明,似乎就这些。问题是如何解决它