我在玩 SKLightNode。我正在尝试创建阴影,使其看起来像太阳在中午。所以基本上是这样的:
但是,我可以让 SKLightNode 为我渲染的是:
所以问题在于,看起来光是从物体旁边的同一层发出的。
我玩过 SKLightNode 配置,但这就是我目前所拥有的(我尝试了许多似乎没有任何效果的配置)
var light = SKLightNode()
//testing lightnodes
light.name = "light"
light.categoryBitMask = 3
light.position = point
light.zPosition = 100.0
light.falloff = 100.00;
light.enabled = true
light.lightColor = UIColor(red: 86/255, green: 128/255, blue: 45/255, alpha: 0.5) //initWithRed:1.0 green:1.0 blue:0.0 alpha:0.5];
light.shadowColor = UIColor(red: 220/255, green: 220/255, blue: 220/255, alpha: 0.3)//[[UIColor alloc] initWithRed:0.0 green:0.0 blue:0.0 alpha:0.3];
light.ambientColor = UIColor(red: 220/255, green: 220/255, blue: 220/255, alpha: 0.3)//[[UIColor alloc] initWithRed:0.0
addChild(light)