<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PortalMaterial/program-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation14PortalMaterialV7programAC7ProgramVvp"
  },
  "title" : "program"
}
-->

# program

The compiled program that drives this material’s surface and geometry shading.

```
var program: PortalMaterial.Program { get set }
```

## Discussion

Read this property to recover the program a portal material was created
with — for example, to share it with another [`PortalMaterial`](/documentation/RealityKit/PortalMaterial). Assign
a new program to swap a portal’s shading without rebuilding the
material; the material’s existing parameter bindings are preserved, and
bindings whose names and types match inputs on the new program’s
shader graph keep working. Bindings that don’t match are ignored at
render time — re-bind any new inputs the program introduces before
drawing the portal.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)