Questions tagged [scnlight]

14 questions
6
votes
1 answer

SceneKit: adding directional light to camera node has no effect

Based on the advice in this answer, the goal is to add an ambient light to a scene along with a directional light to the camera. This works in the Xcode Scene Editor, with the directional light set at 70% white and the ambient light at 50% white.…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
4
votes
2 answers

how to create a disc-shaped light source in SceneKit using Swift

I am looking to create a light source that will resemble the way the Sun lights up the Earth using SceneKit. This is for an amateur astronomy course project. Since the Sun is larger than the Earth, an omnidirectional SCNLight will not do, since the…
Ugo
  • 163
  • 2
  • 9
4
votes
2 answers

SceneKit Directional Light causing flickering

I'm trying to add a directional light in Scenekit to cast shadows, but it is causing weird artefacts on objects. The orange block below has a material with default settings and the diffuse set to orange. The directional light is pointing downwards,…
James P
  • 4,786
  • 2
  • 35
  • 52
3
votes
1 answer

iOS SceneKit lights not working in simulator

When I run my app containing a SCNView, containing some objects and some SCNLight (added a keylight and ambientlight), it does run correctly on real iOS devices. However, when I try to run in iOS Simulator, the lighting does not work. When I set the…
jxd
  • 610
  • 6
  • 13
2
votes
1 answer

Make SceneKit light only cast shadows without lighting the scene

I'm using physically based lighting to light my scene in ARKit, however, I also want to add shadows to make it more realistic. I tried adding a directional light and setting the intensity as low as possible but I still am not able to reach my…
SilentK
  • 587
  • 7
  • 20
2
votes
1 answer

How to use ScnNode as a ScnLight?

var sun = SCNNode(geometry: SCNSphere(radius:0.35)) sun.geometry?.firstMaterial?.diffuse.contents=#imageLiteral(resourceName: "Sun") sun.position=SCNVector3(0,0,-1) And i want to use the sun SCNSphere as a omni light source. let OmniLight =…
DAWID
  • 79
  • 6
2
votes
0 answers

ARKit / SceneKit: Shadow gets cut off around the edges of the view

I'm trying to add shadows in ARKit using a directional light and planes on which to cast the shadows. When moving the camera however, parts of the shadow (not the plane) get cut off. I'm using a directional light with shadow mode set to deffered.…
LeonardRockstar
  • 139
  • 2
  • 10
2
votes
1 answer

Is it possible to draw a clear SCNSphere with a bright red SCNSpotlight?

The last few days I am struggling a bit with SceneKit. I am trying to plot a clear/transparent SCNSphere, with a red spotlight. It appears that my red spotlight is becoming transparant as well if I set my SCNSphere to transpararent / clear colour.…
Rosa90
  • 21
  • 4
1
vote
0 answers

How to prevent a SCNNode from receiving any kind of shadows?

I have a spot light over a SCNNode (skull), I want shadows to cast only in the skull. How could I prevent the other nodes (see node underneath the skull in the photo) that aren't the skull from receiving any kind of shadow?
Sergio
  • 1,610
  • 14
  • 28
1
vote
2 answers

autoenablesDefaultLighting is too bright in iOS 12 and SCNView.pointOfView is not effective

I am using SceneKit’s autoenablesDefaultLighting and allowsCameraControl functions of my sceneView to provide light to an obj 3D model in the app and rotate around this object in Objective-C. Since upgrading to iOS12, the default light intensity of…
A.Ozda
  • 39
  • 9
1
vote
3 answers

How to change color of dark spots in SceneKit?

How to change color of the area where light doesn't reach? By default it's black, so how can I make it white for example? I couldn't find it, if its duplicate, please let me know how to form my question in order to find correct answer! Thank you in…
Baxa Voice
  • 11
  • 1
0
votes
1 answer

SCNNode clone() adds more light to the scene as nodes are cloned

i am trying to add multiple 3d objects with shadows in my ARKit code. I create node like this func loadNodaA() { isObjectCoordinatesAtCentre = false let scaleFactor = 0.005 let dragonScene =…
AKumar
  • 381
  • 6
  • 16
0
votes
2 answers

Is there a way to make moving/changing shadows on Scenekit (like a rising sun)?

my basic code is pretty much this on that tutorial: https://code.tutsplus.com/tutorials/an-introduction-to-scenekit-fundamentals--cms-23847 I want to make a sunrise behaviour. Something like the lightNode begins on the same height as the constrained…
Alexander Langer
  • 320
  • 2
  • 11
0
votes
1 answer

SceneKit: zFar or Far Clipping value influences directional lights and their shadows?

Would love help understanding directional lights and scene shadows in Scene Kit. The class reference on SCNLight says zFar represents the maximum distance between the light and a visible surface for casting shadows. It further suggests this value…
Crashalot
  • 33,605
  • 61
  • 269
  • 439