Log inGet started
Package

temporalUpscale.package

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

temporalUpscale system

Render fewer pixels than the display has, and get the display's pixels anyway.

Shading cost scales with pixel count, so rasterizing the scene smaller is the one lever that buys frame time without taking anything out of the frame. What it spends is sharpness: an upscale invents nothing, and one frame carries only as many distinct samples as the scene had pixels.

This system spends the frames instead. The projection samples a different point inside every pixel each frame, so consecutive frames are different estimates of the same continuous image; the reconstruction carries them forward through the scene's own motion vectors and mixes each new one in. After a handful of frames the standing result holds samples from several different grids — detail no single frame ever rasterized.

Using it

Put TemporalUpscale on any entity in the scene:

entity(id).component.add("TemporalUpscale", { renderScale = 0.5 })

Half the scale is a quarter of the pixels. Every field is live: edit renderScale in the inspector and the scene rasterizes at the new size from the next frame. Removing the component puts the render scale back where it was before the component moved it, so the frame returns to the resolution it had.

The visibility raster

The visibility raster rasterizes through the same sub-pixel offset this pass moves the projection by, so the depth and motion it lays describe the image the resolve shades.

For code that wants it without a component — a settings screen, a benchmark — reach for the module:

local Upscale = require("@builtin::systems.temporalUpscale.temporalUpscale")

Upscale.enable({ renderScale = 0.5, sharpness = 0.35 })
Upscale.get()
Upscale.disable()

Leaving renderScale out of enable leaves the scale where it is, which is what lets @builtin::systems.renderScale.renderScale keep steering it against a frame budget while the reconstruction runs.

Where it runs

The reconstruction is a compute pass at the head of the display stage (afterScenePost), ahead of the debanding, edge antialiasing and sharpening the stage then lays on it: the seam where the frame has already reached the display's resolution and the UI has not been composited onto it yet. So the scene is reconstructed and the text over it stays untouched, drawn once at the display's own size.

Its accumulation is a history target created with screenSpace = "composite", which is what keeps it the size of that composited image while the scene renders smaller. Every view accumulates in images of its own: an offscreen render (an RT camera, a capture) runs the reconstruction on its own picture and leaves the viewport's accumulation as the viewport left it. The scene's depth and velocity stay at the scene's resolution; the pass maps each composite pixel back into that grid to read them.

Where the composite lands depends on who presents the viewport. In a runtime session the renderer presents it, and the upscale to the display's resolution happens before afterScenePost — so the composite is the display's own size and the reconstruction resolves onto the display's grid. Under a UI viewport panel the panel draws the scene target at its own rect, nothing upscales before the composite, and the two spaces carry the same size: the pass then accumulates at the render resolution and the panel scales the result. It says so in the log on the second frame when that is what it finds.

The resolve, and the sample sequence

The reconstruction folds each frame in through the temporal resolve (@builtin::systems.antiAliasing.temporal_resolve), the one temporal antialiasing runs at scale 1: the history is read through a Catmull-Rom spline, which keeps the contrast of thin lines through a slow pan; samples are weighed in a reversible tonemapped space; the history is variance-clipped in YCoCg against the scene samples within a texel and a half of the pixel; and the frame's share is halved wherever the history passes the clip untouched. Every frame takes the same share: a frame trusted more when one of its samples landed nearest a pixel weighs each pixel by where the jitter fell in its row as well as its column, which settled the rows of one scene texel on alternating values along every thin edge. The clip pulls the history fully into the current frame's neighbourhood wherever it falls outside it, so a surface that moves across a still background, a change of light and the first frames after the reconstruction starts reach the picture at once.

The sequence of points inside the pixel the projection samples is eight per display pixel, scaled by how many display pixels a scene pixel covers: 32 at half scale. A run too short for that visits some display pixels more often than others, and the converged picture kept that unevenness as a fixed pattern along every thin edge.

sharpness sharpens the shown picture with @builtin::systems.antiAliasing.rcas after the reconstruction, outside its history, so it never compounds.

Its relationship to the other temporal pass

@builtin::systems.antiAliasing.temporalAntiAliasing is the same resolve at the scene's own resolution, and a world created from the default template runs it. The frame has one temporal reconstruction, so enabling this module with a reconstructing backend ("taau", "dlss", or "auto") has temporal antialiasing stand aside (temporalAntiAliasing.yieldedTo() names this module); disable hands the frame back, and temporal antialiasing runs again if it is still enabled. Backend "none" reconstructs nothing and leaves it running.

Files

temporalUpscale.package/
  TemporalUpscale.component/     -- the settings, authored and persisted
  temporalUpscale.module/        -- enable / get / active / disable
  taau.renderFeature/            -- the jitter, the two targets, the pass
  taau_resolve.computeShader/    -- the reconstruction itself