Render
Volver a la referencia

Render

What the renderer is told and what it answers: backends, capabilities and draw items.

4 símbolos

LINE_VERTEX_FLOATSvariablenacatamalon

LINE_VERTEX_FLOATS: 7

How many numbers one corner of a line takes: where it is (x, y, z) and its colour (r, g, b, a).

The colour rides on the corner rather than on the whole set, so one draw can paint the three arms of an axis gizmo three colours, and a line can fade from one end to the other for free.

Written once here and read by both backends and by whoever writes lines, so the three can never count a corner differently.

Ver el código · render/shared/line_vertex.ts:15

TCaptureResulttypenacatamalon

Pixels brought back from the graphics card, as RGBA8, row by row from the top-left corner.

Top-left because that is where every other picture in this engine starts. WebGL2 reads from the bottom, so its backend turns the rows around before handing them over: a picture that comes back upside down depending on which backend ran is exactly the kind of difference the interface exists to hide.

Propiedades

widthnumber
heightnumber
dataUint8Array

width * height * 4 bytes.

Ver el código · render/interface/t_capture_result.ts:13

TRendererTypetypenacatamalon

TRendererType: 'AUTO' | TRendererBackend

What a caller may ask createRenderer for.

  • 'AUTO': tries WebGPU, and on any failure falls back to WebGL2.
  • 'WEBGPU' / 'WEBGL2': that backend or nothing. A named backend never falls back: asking for one explicitly and silently getting the other hides the thing you were testing.
Ver el código · render/interface/t_renderer_capabilities.ts:21