<!--
{
  "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.struct/Descriptor-swift.struct/init(shaderGraph:inputValues:constantValues:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation14PortalMaterialV7ProgramV10DescriptorV11shaderGraph11inputValues08constantJ0AG06ShaderH0AKC_SDySSAA0D10ParametersV5ValueOGSo019MTLFunctionConstantJ0Ctcfc"
  },
  "title" : "init(shaderGraph:inputValues:constantValues:)"
}
-->

# init(shaderGraph:inputValues:constantValues:)

Creates a descriptor with the given shader graph and optional
initial values.

```
init(shaderGraph: ShaderGraph, inputValues: [String : MaterialParameters.Value] = [:], constantValues: MTLFunctionConstantValues = .init())
```

## Parameters

`shaderGraph`

The shader graph that describes the program’s
surface and, optionally, geometry-modifier shading.

`inputValues`

Initial values for the inputs the shader graph
declares. Defaults to an empty dictionary, leaving each
input at its declared default.

`constantValues`

Values for the function-constant inputs the
shader graph declares. Defaults to an empty
`MTLFunctionConstantValues`, leaving each function constant
at its declared default.

---

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)