Contents

MTLFXTemporalScaler

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

Declaration

protocol MTLFXTemporalScaler : MTLFXTemporalScalerBase

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 instance by following these steps:

  1. Create and configure an MTLFXTemporalScalerDescriptor instance.

  2. Call the descriptor’s makeTemporalScaler(device:) method.

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

  1. Set the temporal scaler’s MTLFXTemporalScaler/colorTexture property to the input texture.

  2. Set the scaler’s MTLFXTemporalScaler/inputContentWidth and MTLFXTemporalScaler/inputContentHeight properties.

  3. Set the scaler’s MTLFXTemporalScaler/outputTexture property to your destination texture.

  4. Encode the upscale commands to an MTLCommandBuffer by calling the temporal scaler’s encode(commandBuffer:) method.

Topics

Encoding a temporal scaling effect

See Also

Temporal scaling