Log inGet started
❒
package · drop-in viewer
asset⌬ packagepackageprimary: package.yaml·originates fromworld 07158574-5…

renderScale

The scene's resolution as a budget rather than a constant.

by◐lumi·posted 4mo ago
What it does

renderScale system

The scene's resolution as a budget rather than a constant.

Shading cost scales with pixel count and with nothing else, so how many pixels the scene is rasterized into is the one lever that buys frame time without taking anything out of the frame — no feature switched off, no geometry removed, nothing missing from the image. What it spends instead is sharpness.

The renderer owns the lever (renderer.setResolutionScale). This package owns the decision: read what the GPU frame actually costs and move the scale toward the cost you asked for.

By default

At the governed quality levels (medium and low) the scene's resolution already follows the frame budget in every world: the quality governor holds the frame to the level's GPU budget (14 ms at medium, 28 ms at low) between a floor of 0.5 and the scale the tier chose. A world turns that off with the setting quality.<level>.dynamic_resolution = false and moves the floor with quality.<level>.min_scale. At high the scale is the tier's until something here takes it.

Using it

Put DynamicResolution on any entity in the scene and give it a frame budget:

entity(id).component.add("DynamicResolution", { targetMs = 16.6 })

Every field is live: edit targetMs in the inspector and the controller aims at the new number from the next frame.

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

local RenderScale = require("@builtin::systems.renderScale.renderScale")

RenderScale.set({ target = 16.6, min = 0.6 })  -- take automatic control
RenderScale.step()                              -- one step toward the target
RenderScale.get()                               -- what it aims for, and last read
RenderScale.setScale(0.7)                       -- set it directly
RenderScale.scale()                             -- what the renderer has
RenderScale.off()                               -- stop steering

What the knobs do

fieldeffect
targetMsThe GPU's own frame time to hold. 16.6 is 60 Hz, 33.3 is 30.
minScale / maxScaleThe range the scale may move in, within the engine's own [0.25, 1].
rateHow much of the distance to the target one step takes. Lower settles more slowly and holds steadier.
deadbandHow far off the target a frame must be before the scale moves, as a fraction of the target. Without it the scale never sits still.

How it steers

The reading is the GPU's own time per frame, profiler.frameCost's gpu.own: its median over a window of window frames (30 by default), not one frame, because one frame's figure is noisy and a controller fed it oscillates instead of settling. Each window opens as the last one is read, so every step reads frames drawn at the scale the step before chose. The GPU's own time leaves out the time the CPU spends between a frame's submits, so a frame the CPU holds up leaves the scale where it is.

Pixel count moves with the square of the scale, so the scale that would have hit the target is the current one over the square root of how far off the frame was. A step takes rate of the way there, which is what keeps one heavy frame from throwing the scale across its whole range.

Files

renderScale.package/
  DynamicResolution.component/  -- the budget, authored and persisted
  renderScale.module/           -- set / step / get / setScale / scale / off

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

This asset doesn't declare a schema or structured payload.

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.