<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:19RealityCoreRenderer24LowLevelMaterialResourceC13SurfaceShaderC"
  },
  "title" : "LowLevelMaterialResource.SurfaceShader"
}
-->

# LowLevelMaterialResource.SurfaceShader

A compiled Metal function that implements the surface shader function.

```
final class SurfaceShader
```

## Overview

Create a `SurfaceShader` by compiling a [`LowLevelMaterialResource.SurfaceShader.Descriptor`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/Descriptor) with
[`makeSurfaceShader(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeSurfaceShader(descriptor:)-66tq8), or use
[`makeSimpleSurfaceShader(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeSimpleSurfaceShader(descriptor:)-74vhb) for the built-in
simple surface shader function.

## Topics

### Describing the shader

[`struct Descriptor`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/Descriptor)

The name and library for a user-authored Metal surface shader function.

### Configuring shader parameters

[`var parameterMapping: LowLevelMaterialParameterMapping?`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/parameterMapping)

The parameter name-to-slot mapping for this surface shader function, or `nil` if it takes no custom parameters.

[`var argumentTableDescriptor: LowLevelArgumentTable.Descriptor?`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/argumentTableDescriptor)

The argument table descriptor for this surface shader, or `nil` if it takes no
per-draw arguments.

## Relationships

### Conforms To

[`Function`](/documentation/RealityKit/LowLevelMaterialResource/Function)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)