<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 27.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalFX",
  "identifier" : "/documentation/MetalFX/MTLFXTemporalScalerBase",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "MetalFX"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLFXTemporalScalerBase"
  },
  "title" : "MTLFXTemporalScalerBase"
}
-->

# MTLFXTemporalScalerBase

An upscaling effect that generates a higher resolution texture in a render pass by analyzing multiple input
textures over time.

```
protocol MTLFXTemporalScalerBase : MTLFXFrameInterpolatableScaler
```

## Overview

The MetalFX temporal scaler increases the size of your input texture to a larger output texture. You can use the
scaler to upscale every frame of your app’s scene or rendering in real time. With a scaler, you can draw more
complicated scenes in less time by intentionally rendering to a lower resolution to save time before upscaling.

Create an [`MTLFXTemporalScaler`](/documentation/MetalFX/MTLFXTemporalScaler) instance by following these steps:

1. Create and configure an [`MTLFXTemporalScalerDescriptor`](/documentation/MetalFX/MTLFXTemporalScalerDescriptor) instance.
2. Call the descriptor’s `newTemporalScalerWithDevice:` method.

Upscale a rendering by following these steps for every render pass:

1. Set the temporal scaler’s [`colorTexture`](/documentation/MetalFX/MTLFXTemporalScalerBase/colorTexture) property to the input texture.
2. Set the scaler’s [`inputContentWidth`](/documentation/MetalFX/MTLFXTemporalScalerBase/inputContentWidth) and [`inputContentHeight`](/documentation/MetalFX/MTLFXTemporalScalerBase/inputContentHeight) properties.
3. Set the scaler’s [`outputTexture`](/documentation/MetalFX/MTLFXTemporalScalerBase/outputTexture) property to your destination texture.
4. Encode the upscale commands to a command buffer by calling the temporal scaler’s
   [`encode(commandBuffer:)`](/documentation/MetalFX/MTLFXTemporalScaler/encode(commandBuffer:)) method.

## Conforming to texture usage requirements

Temporal scalers expose properties, such as [`colorTextureUsage`](/documentation/MetalFX/MTLFXTemporalScalerBase/colorTextureUsage), that indicate requirements for
your textures to be compatible with it. These properties indicate the minimum set of `MTLTextureUsage` bits
that you are responsible for setting in your texture descriptors for this spatial scaler to use them.

Your game or app can set extra usage bits on your textures without losing compatibility, as long at its maintains
the minimum set the scaler requests.

## Assigning input and output textures

When you use an instance of a class that conforms to this protocol, you typically set its input and output textures,
as well as other properties, and then encode its work to a command buffer.

MetalFX doesn’t track that you assign the same texture instances to each property across different batches of work,
the only requirement is that you provide textures that match the pixel formats and dimensions you specify in the
[`MTLFXTemporalScalerDescriptor`](/documentation/MetalFX/MTLFXTemporalScalerDescriptor) descriptor instance that creates the scaler instance.

## Topics

### Instance Properties

[`var colorContentOffsetX: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/colorContentOffsetX)

The horizontal offset, in pixels, of the region within the color texture to use as input.

[`var colorContentOffsetY: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/colorContentOffsetY)

The vertical offset, in pixels, of the region within the color texture to use as input.

[`var colorTexture: (any MTLTexture)?`](/documentation/MetalFX/MTLFXTemporalScalerBase/colorTexture)

An input color texture you set for the scaler that supports the correct color texture usage options.

[`var colorTextureFormat: MTLPixelFormat`](/documentation/MetalFX/MTLFXTemporalScalerBase/colorTextureFormat)

The pixel format of the input color texture for this this scaler.

[`var colorTextureUsage: MTLTextureUsage`](/documentation/MetalFX/MTLFXTemporalScalerBase/colorTextureUsage)

The minimal texture usage options that your app’s input color texture needs in order to support this scaler.

[`var depthContentOffsetX: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/depthContentOffsetX)

The horizontal offset, in pixels, of the region within the depth texture to use as input.

[`var depthContentOffsetY: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/depthContentOffsetY)

The vertical offset, in pixels, of the region within the depth texture to use as input.

[`var depthTexture: (any MTLTexture)?`](/documentation/MetalFX/MTLFXTemporalScalerBase/depthTexture)

An input depth texture you set for the scaler that supports the correct color texture usage options.

[`var depthTextureFormat: MTLPixelFormat`](/documentation/MetalFX/MTLFXTemporalScalerBase/depthTextureFormat)

The pixel format of the input depth texture for this this scaler.

[`var depthTextureUsage: MTLTextureUsage`](/documentation/MetalFX/MTLFXTemporalScalerBase/depthTextureUsage)

The minimal texture usage options that your app’s input depth texture needs in order to support this scaler.

[`var exposureTexture: (any MTLTexture)?`](/documentation/MetalFX/MTLFXTemporalScalerBase/exposureTexture)

The exposure texture this scaler uses.

[`var fence: (any MTLFence)?`](/documentation/MetalFX/MTLFXTemporalScalerBase/fence)

An optional fence that you provide to synchronize your app’s untracked resources.

[`var inputContentHeight: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/inputContentHeight)

The height, in pixels, of the region within the color texture the scaler uses as its input.

[`var inputContentMaxScale: Float`](/documentation/MetalFX/MTLFXTemporalScalerBase/inputContentMaxScale)

The largest scale factor the temporal scaler can use to generate output textures.

[`var inputContentMinScale: Float`](/documentation/MetalFX/MTLFXTemporalScalerBase/inputContentMinScale)

The smallest scale factor the temporal scaler can use to generate output textures.

[`var inputContentWidth: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/inputContentWidth)

The width, in pixels, of the region within the color texture the scaler uses as its input.

[`var inputHeight: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/inputHeight)

The height, in pixels, of the input color texture for this scaler.

[`var inputWidth: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/inputWidth)

The width, in pixels, of the input color texture for this scaler.

[`var isDepthReversed: Bool`](/documentation/MetalFX/MTLFXTemporalScalerBase/isDepthReversed)

A Boolean value that indicates whether the depth texture uses zero to represent the farthest distance.

[`var jitterOffsetX: Float`](/documentation/MetalFX/MTLFXTemporalScalerBase/jitterOffsetX)

The horizontal component of the subpixel sampling coordinate you use to generate the color texture input.

[`var jitterOffsetY: Float`](/documentation/MetalFX/MTLFXTemporalScalerBase/jitterOffsetY)

The vertical component of the subpixel sampling coordinate you use to generate the color texture input.

[`var motionContentOffsetX: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/motionContentOffsetX)

The horizontal offset, in pixels, of the region within the motion texture to use as input.

[`var motionContentOffsetY: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/motionContentOffsetY)

The vertical offset, in pixels, of the region within the motion texture to use as input.

[`var motionTexture: (any MTLTexture)?`](/documentation/MetalFX/MTLFXTemporalScalerBase/motionTexture)

An input motion texture you set for the scaler that supports the correct color texture usage options.

[`var motionTextureFormat: MTLPixelFormat`](/documentation/MetalFX/MTLFXTemporalScalerBase/motionTextureFormat)

The pixel format of the input motion texture for this this scaler.

[`var motionTextureUsage: MTLTextureUsage`](/documentation/MetalFX/MTLFXTemporalScalerBase/motionTextureUsage)

The minimal texture usage options that your app’s motion texture needs in order to support this scaler.

[`var motionVectorScaleX: Float`](/documentation/MetalFX/MTLFXTemporalScalerBase/motionVectorScaleX)

The horizontal scale factor the scaler applies to the input motion texture.

[`var motionVectorScaleY: Float`](/documentation/MetalFX/MTLFXTemporalScalerBase/motionVectorScaleY)

The vertical scale factor the scaler applies to the input motion texture.

[`var outputHeight: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/outputHeight)

The height, in pixels, of the output color texture for this scaler.

[`var outputOffsetX: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/outputOffsetX)

The horizontal offset, in pixels, of the region within the output texture to write results.

[`var outputOffsetY: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/outputOffsetY)

The vertical offset, in pixels, of the region within the output texture to write results.

[`var outputTexture: (any MTLTexture)?`](/documentation/MetalFX/MTLFXTemporalScalerBase/outputTexture)

The output texture into which this scaler writes its output.

[`var outputTextureFormat: MTLPixelFormat`](/documentation/MetalFX/MTLFXTemporalScalerBase/outputTextureFormat)

The pixel format of the output color texture for this this scaler.

[`var outputTextureUsage: MTLTextureUsage`](/documentation/MetalFX/MTLFXTemporalScalerBase/outputTextureUsage)

The minimal texture usage options that your output texture needs in order to support this scaler.

[`var outputWidth: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/outputWidth)

The width, in pixels, of the output color texture for this scaler.

[`var preExposure: Float`](/documentation/MetalFX/MTLFXTemporalScalerBase/preExposure)

A pre-exposure value this scaler evaluates.

[`var reactiveMaskContentOffsetX: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/reactiveMaskContentOffsetX)

The horizontal offset, in pixels, of the region within the reactive mask texture to use as input.

[`var reactiveMaskContentOffsetY: Int`](/documentation/MetalFX/MTLFXTemporalScalerBase/reactiveMaskContentOffsetY)

The vertical offset, in pixels, of the region within the reactive mask texture to use as input.

[`var reactiveMaskTexture: (any MTLTexture)?`](/documentation/MetalFX/MTLFXTemporalScalerBase/reactiveMaskTexture)

The reactive-mask texture input this scaler uses.

[`var reactiveMaskTextureFormat: MTLPixelFormat`](/documentation/MetalFX/MTLFXTemporalScalerBase/reactiveMaskTextureFormat)

The pixel format of the input reactive mask texture for this this scaler.

[`var reactiveMaskTextureUsage: MTLTextureUsage`](/documentation/MetalFX/MTLFXTemporalScalerBase/reactiveMaskTextureUsage)

The minimal texture usage options that your app’s reactive mask texture needs in order to support this scaler.

[`var reactiveTextureUsage: MTLTextureUsage`](/documentation/MetalFX/MTLFXTemporalScalerBase/reactiveTextureUsage)

The minimal texture usage options that your app’s reactive texture needs in order to support this scaler.

[`var reset: Bool`](/documentation/MetalFX/MTLFXTemporalScalerBase/reset)

A Boolean that indicates whether the temporal scaler discards historical data from previous frames.

## Relationships

### Inherits From

[`MTLFXFrameInterpolatableScaler`](/documentation/MetalFX/MTLFXFrameInterpolatableScaler)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherited By

[`MTLFXTemporalScaler`](/documentation/MetalFX/MTLFXTemporalScaler)

[`MTL4FXTemporalScaler`](/documentation/MetalFX/MTL4FXTemporalScaler)

---

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)