MTLFXTemporalScaler
An upscaling effect that generates a higher resolution texture in a render pass by analyzing multiple input textures over time.
Declaration
protocol MTLFXTemporalScaler : MTLFXTemporalScalerBaseOverview
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:
Create and configure an MTLFXTemporalScalerDescriptor instance.
Call the descriptor’s makeTemporalScaler(device:) method.
Upscale a rendering by following these steps for every render pass:
Set the temporal scaler’s
MTLFXTemporalScaler/colorTextureproperty to the input texture.Set the scaler’s
MTLFXTemporalScaler/inputContentWidthandMTLFXTemporalScaler/inputContentHeightproperties.Set the scaler’s
MTLFXTemporalScaler/outputTextureproperty to your destination texture.Encode the upscale commands to an MTLCommandBuffer by calling the temporal scaler’s encode(commandBuffer:) method.