4

I'm playing around with SKLightNodes and attempting to have an object (sun) shine light on anything around it. The problem is that when I add the SKLightNode to the sun node, the SKLightNode only appears in the very center of the sun. I've tried scaling the SKLightNode, but it seems to have no effect on the size or range of the SKLightNode. Here is how The SKLightNode is implemented.

  let light = SKLightNode()
                light.categoryBitMask = 1;
                light.falloff = 1;
                light.ambientColor = UIColor.whiteColor();
                light.setScale(50)
                star!.addChild(light)

If anyone has any input on how I can increase the effectiveness of the light source, I sure would appreciate it.

C. Greene
  • 251
  • 3
  • 15
  • Have you tried turning down the falloff? I believe that will make the light decay less. – Kendel Oct 26 '15 at 01:15
  • I've tried adjusting the falloff, but nothing seems to change. My initial thought was that since I am adding the lightNode to an SKEmitterNode (sun), this is causing sizing issues. I've also tried creating a basic SKNode() as a holder for both the sun and the light, but it didn't seem to make a difference. – C. Greene Oct 26 '15 at 11:54
  • Were you able to solve this? – Aaron May 05 '16 at 22:14
  • I have not been able to increase the size or effectiveness of an SKLightNode – C. Greene May 06 '16 at 13:23

1 Answers1

3

I think the only way to increase the "size" of an SKLightNode is decreasing the falloff value. You must need to set some value between 0 and 1.0.

    // very bright
    light?.falloff = 0.1

    // a little less bright
    light?.falloff = 0.5

    // the default brightness
    light?.falloff = 1.0

    // a little darker
    light?.falloff = 2.0

    // very dark
    light?.falloff = 5.0