Three.js - 奇怪的着色行为

时间:2017-09-23 08:15:33

标签: three.js shadow

左侧立方体上的垂直阴影来自哪里?

https://jsfiddle.net/yz0sfr35/

static func createInterest() -> [Interest1]
    {

        return [
           Interest1(title: "One", featuredImage: UIImage(named:"001.png")!, button1: button1), // Removed from here
            Interest1(title: "Two", featuredImage: UIImage(named:"002.png")!),
            Interest1(title: "Three", featuredImage: UIImage(named:"003.png")!),
            Interest1(title: "Four", featuredImage: UIImage(named:"004.png")!),

        ]

    }

enter image description here

1 个答案:

答案 0 :(得分:2)

你所看到的是阴影中的像素化,因为你的阴影相机平截头体比你的场景大几个数量级。

screenshot of frustum

在您的情况下,一种解决方案是减少聚光灯的角度:

light.angle = Math.PI / 180;

在场景周围保持阴影截头紧密,以获得高质量的阴影。

https://jsfiddle.net/yz0sfr35/2/

three.js r.87