An SKLightNode object is used to add lighting into a scene in the iOS and OS X SDKs.
Questions tagged [sklightnode]
21 questions
7
votes
2 answers
SKLightNode cast shadow issue
I have been unsuccessful in getting a SKSpriteNode to cast a shadow AND also be made to disappear when going into a shadow from the same light source. I am able to do one of the two but not both.
According to the docs: If the sprite is inside a…

sangony
- 11,636
- 4
- 39
- 55
6
votes
0 answers
SKSpriteNode lighting doesn't work with textures from SKTextureAtlas
I ran into a problem with SpriteKit (tried Xcode 7 beta and Xcode 6.4 on OS X 10.11 beta) where normal-mapped lighting breaks down if I create a SKTextureAtlas from the image and normal files that work when used individually. See this example:
From…

CodeSmile
- 64,284
- 20
- 132
- 217
6
votes
1 answer
SKLightNode performance issues
I've been experimenting with SKLightNode in SpriteKit (new in iOS8) and, even in a really simple test case, I've been getting terrible performance. For instance, with a single light source on a solid color SKSpriteNode I get 13.2 FPS on a 3rd…

Mike S
- 41,895
- 11
- 89
- 84
4
votes
1 answer
How to increase the size of an SKLightNode in iOS
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…

C. Greene
- 251
- 3
- 15
3
votes
1 answer
How to get sun at noon shadow with SKLightNode
I'm playing around with SKLightNode. I'm trying to create shadows so that it would look like the sun is at noon. So basically something like this:
However all I can get SKLightNode to render for me is this:
So the problem is that it looks like the…

user3673836
- 591
- 1
- 9
- 23
2
votes
1 answer
SKLightNode's shadow doesn't hide sprites
I'm currently working with a SKLightNode and I have some sprites on the screen.
I want those sprites to cast a shadow depending on the light's position, but I want the sprites lit directly by the light to be shown and the sprites behind another…

Drakalex
- 1,488
- 3
- 19
- 39
2
votes
1 answer
How to add lighting effect in SKShapeNode
I am using SpriteKit, does SKLightNode can only work with SKSpriteNode? because there is no shadowCastBitMask property on SKShapeNode, I cannot make SKLightNode work with SKShapeNode. Is there a way can make them work together? Thanks!

rockXrock
- 3,403
- 1
- 25
- 18
2
votes
1 answer
How to make shadows shorter in SpriteKit?
I don't want shadows to be that long (sorry, can't post pictures yet). Is there any property for SKLightNode, like distance, to make shadows shorter? And if not, how do you usually implement dynamic shadows in SpriteKit?

ttrs
- 127
- 2
- 9
1
vote
0 answers
SKLightNode causes crash if added too soon with SKSpriteNode
I have a scene with 20ish SKSpriteNodes that are added at run time. I also Add an SKLightNode
However I get a crash with the following log
-[MTLDebugRenderCommandEncoder…

MandelDuck
- 401
- 5
- 16
1
vote
1 answer
SpriteKit progressive darkness in the Scene
Does anyone know how to bring progressive darkness on a SKScene using SpriteKit?
I tried using a SKLightNode, which works great to have "full" darkness in the scene and some light sources.
I also tried to have a Node in front of everything else…

PujolDeveloper
- 43
- 4
1
vote
0 answers
Lighting glitch when trying to create a fog of war with a light node
I'm building a game using sprite kit and I am running into an odd bug when adding a light node as a child to my main character. The bug seems to occur when the main character's node is close to a sprite node like a wall or floor.
I've played around…

Dylan Martin
- 11
- 3
1
vote
1 answer
Use multiple LightNodes
I found out that I can't use more than 8 LightNodes, I can add them as a child but they are not shown on the view.

Chris
- 25
- 7
1
vote
1 answer
How can I achieve a node that will desaturate everything below it?
I am building a game where everything behind the player is greyed out as if it lives in a memory. But I don't know how I can achieve this effect. Is this where shaders are being used for?
Now I can create a SKLightNode to create the lighting and…

Mark
- 16,906
- 20
- 84
- 117
1
vote
1 answer
Spritekit game crashes (because of SKLightNode threading issue?)
I'm trying to create a simple game for my Kids. I'm trying to implement light and emitter nodes. However the game crashes on collision which should result to gameOverScene. The strange thing is that the code completes ok if I add a brakepoint.…

user594883
- 1,329
- 2
- 17
- 36
1
vote
1 answer
SKLightNode not showing up in Sprite Kit
My light:
self.light = [[SKLightNode alloc] init];
self.light.categoryBitMask = 0;
self.light.falloff = 1;
self.light.ambientColor = [UIColor whiteColor];
self.light.lightColor = [[UIColor alloc] initWithRed:1.0 green:1.0 blue:0.0…

HelloimDarius
- 695
- 5
- 23