2

I wanted to use gobo for a SpotLight in RealityKit. However, I could not find any documentation how to do that. I only found information about how to do it for SceneKit. But as SceneKit can not be used in combination with RealityKit, I could not find a way to do that.

Has anybody done this before, as I do not want to rewrite the whole app in SceneKit?

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220

1 Answers1

0

Gobo in RealityKit

Unfortunately, the current version of Apple RealityKit 2.0 does not allow a developer to add a GOBO (a.k.a. stenciled light mask) to the light source (how you used to do in SceneKit). Below are the options that the SpotLight fixture currently has in RealityKit.

let spot = SpotLight()
spot.light.color
spot.light.intensity
spot.light.attenuationRadius
spot.light.innerAngleInDegrees
spot.light.outerAngleInDegrees

Solution

The only way to add a gobo to your lighting scene is to use a fake texture or fake shadows.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220