iOS 27 adds soft shadow rendering to RealityKit spotlights and point lights via a configurable lightSize and quality, plus a SurroundingsLightComponent that lets virtual lights illuminate real-world surfaces using the scene understanding mesh.
โข Soft shadows dramatically increase realism by producing physically accurate penumbras based on light area size โ controllable with a single property change
โข Physical space lighting (SurroundingsLightComponent) enables virtual lights like spotlights to paint projective textures and illumination onto real-world walls, floors, and objects
โข Projective textures on spotlights allow cinematic effects like light shining through a stained-glass window or animated caustics, all with minimal code
Demonstrates attaching a soft shadow to a spotlight and enabling physical space lighting so the virtual light illuminates real-world surfaces with a projective texture.
import RealityKit
import SwiftUI
struct SoftShadowDemoView: View {
var body: some View {
RealityView { content in
// 1. Create the spotlight entity
let spotLightEntity = Entity()
// 2. Configure the SpotLightComponent
var spotLight = SpotLightComponent(
color: .white,
intensity: 8000,
innerAngleInDegrees: 20,
outerAngleInDegrees: 45,
attenuationRadius: 6.0
)
// 3. Configure soft shadows
var shadow = SpotLightComponent.Shadow()
// lightSize is the diameter in meters of the virtual light source.
// Larger values produce a wider penumbra (softer shadow edges).
shadow.lightSize = 0.7
// Must be .medium or .high โ .low forces hard shadows
shadow.quality = .medium
spotLight.shadow = shadow
spotLightEntity.components.set(spotLight)
// 4. Enable physical space lighting so the virtual spotlight
// illuminates real-world surfaces via the scene understanding mesh
spotLightEntity.components.set(SpotLightComponent.SurroundingsLightComponent())
// 5. Attach a projective texture (stars/nebulae image)
if let starTexture = try? await TextureResource(named: "stars_nebulae") {
let projectiveTexture = ProjectiveTextureComponent(
texture: starTexture
)
spotLightEntity.components.set(projectiveTexture)
}
// 6. Position the spotlight above the scene origin
spotLightEntity.position = SIMD3<Float>(0, 1.5, 0)
// Point downward/outward into the room
spotLightEntity.orientation = simd_quatf(
angle: -.pi / 4,
axis: SIMD3<Float>(1, 0, 0)
)
content.add(spotLightEntity)
// 7. Add a simple box entity to receive the soft shadow
let boxMesh = MeshResource.generateBox(size: 0.3)
let boxMaterial = SimpleMaterial(color: .systemTeal, isMetallic: false)
let boxEntity = ModelEntity(mesh: boxMesh, materials: [boxMaterial])
boxEntity.position = SIMD3<Float>(0, 0, -1.0)
content.add(boxEntity)
}
}
}
#Preview {
SoftShadowDemoView()
}Liquid Glass is Apple's new material and visual design language introduced in iOS 27, bringing translucent, refractive glass-like surfaces to system and custom UI elements. It replaces the frosted vibrancy aesthetic with a more dynamic, depth-aware material that responds to content beneath it.
PaperKit is Apple's full-featured canvas framework โ previously internal-only โ now publicly available in iOS/macOS/visionOS 27. It powers the drawing and markup experience in Notes, Preview, and Freeform, giving developers access to a complete pencil, shapes, images, and text canvas with a rich data model.
Xcode 27 introduces a fully customizable toolbar and theme system, untitled scratch projects, coding agent integration directly in the editor, and the new Device Hub for evaluating apps across simulators and physical devices side-by-side.
In-depth guide
RealityKit & USDKit in iOS 27 โSetting shadow quality to .low forces hard shadows regardless of lightSize โ must use .medium or .high for soft shadows. Physical space lighting is currently only supported for SpotLight and PointLight components, not directional lights. Performance cost scales significantly with shadow quality; prefer .medium for interactive scenes.
Physical space lighting requires scene understanding mesh support; best results on devices with LiDAR. Soft shadow quality set to 'low' produces hard shadows regardless of lightSize.
iOS 27 introduces new SwiftUI drag and drop APIs including reorderable, reorderContainer, dragContainer, and configuration modifiers that enable reordering within and across collections, multi-item drag, and fine-grained control over how data is transferred during drag and drop operations.