Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofmodule renderer.module·originates fromworld 07158574-5…

sampling

Anisotropic texture filtering, and where in a pixel the projection samples: its offset and jitter.

by◐lumi·posted 5d ago
What it does

renderer.sampling

Anisotropic texture filtering, and where in a pixel the projection samples: its offset and jitter.

Interface

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

conforms to

zero/source-extract/v2

module renderer.sampling global renderer Texture filtering and where in a pixel the projection samples.

filteringSurface( ) → any

══ renderer texture filtering ════════════════════════════════════════ How many samples a material texture may take along the axis of greatest compression. Isotropic filtering picks one mip from the larger of the two screen-space derivatives, which is why a surface at a grazing angle — a road, a floor, a wall seen edge-on — blurs to a flat average well before the horizon. Anisotropy spends extra samples along that axis and keeps the detail that is in the texture. The scene-wide level is seeded from the `render.anisotropy` world setting, or where the world states none from the device's quality tier (`renderer.qualityTier()`); these are the runtime controls a quality slider drives.

setAnisotropy(level: number) → number

Set the maximum anisotropy material textures are sampled with. Takes effect on the next frame for content already on screen — no reload, no texture re-upload. 1 is plain trilinear. asking for more than the device offers reports what was actually applied.

argtypedescription
levelnumberOne of 1, 2, 4, 8, 16. Any other value is an error.

examples

renderer.setAnisotropy(16)

anisotropy( ) → number

The maximum anisotropy material textures are sampled with right now — the requested level clamped to what this device honours.

examples

if renderer.anisotropy() < 4 then ... end

maxAnisotropy( ) → number

The highest anisotropy this device honours: 16 on hardware that filters anisotropically, 1 on hardware that does not, where a higher request would be downgraded to trilinear regardless. Read it to report quality honestly — `renderer.setAnisotropy` clamps for you, so a request never needs guarding.

examples

local best = renderer.maxAnisotropy()

setProjectionOffset(x: number, y: number) → void

Offset the main camera's projection by a sub-pixel amount, in NDC, for the frames until it is set again. The offset is in NDC because that is the space it is constant in: one pixel is `2.0 / width` across, so half a pixel is `1.0 / width`. Velocity (`@scene.motion`) is measured against the offset-free projection, so a still scene reports no motion however the samples are placed — and picking resolves a click to the same ray either way. The projection moves by the point of the raster's 1/256-pixel grid nearest the offset. `(0, 0)` samples pixel centres.

argtypedescription
xnumberHorizontal offset in NDC. One pixel is `2.0 / width`.
ynumberVertical offset in NDC. One pixel is `2.0 / height`.

examples

renderer.setProjectionOffset(0.5 * 2 / w, -0.25 * 2 / h)

setProjectionJitter(offsets: { { number } }) → void

State where inside the pixel consecutive renders of a view sample, for the frames until it is stated again: a list of `{x, y}` offsets in pixels from the pixel centre, each within half a pixel. Every view the renderer draws (the viewport, each render-to-texture camera, each capture) walks the list by its own count of renders in a row, so a camera drawn beside the viewport takes nothing out of the viewport's sequence: a view's first render, and its first after a cut, samples the pixel centre, and its next renders take the offsets in order, wrapping. Each offset is applied in the view's own pixels, at the point of the raster's 1/256-pixel grid nearest it, and that applied offset is the one the frame reports. Velocity (`@scene.motion`) is measured against the offset-free projection, and a history target's `state` buffer carries the offset each render took. `renderer.setProjectionOffset`, while it is not `(0, 0)`, and an upscale backend's own jitter both stand over the list on the viewport. An empty list samples pixel centres. An offset outside half a pixel is refused, naming it, and leaves the list in force.

argtypedescription
offsets{ { number } }The offsets, each `{x, y}` in pixels from the pixel centre.

examples

renderer.setProjectionJitter({ { 0.25, -0.25 }, { -0.25, 0.25 } })

projectionJitter( ) →

The offsets `renderer.setProjectionJitter` stated, each `{x, y}` in pixels from the pixel centre.

examples

local offsets = renderer.projectionJitter()

projectionOffset( ) →

The sub-pixel projection offset in force for the main camera, in NDC.

examples

local ox, oy = renderer.projectionOffset()

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.