makepad/libs/render_lines/src
Admin 53e0e85b92 draw and widgets: Slug text everywhere, no blank glyphs, slimmer widgets
All outline text draws with Slug curves on every platform (SDF/MSDF stays
selectable per size); a frame never presents a blank glyph and retained draw
lists keep theirs. One coverage model for vector feathering, widget families
split out of the core crate, fewer steady-state allocations, video keeps its
aspect (Contain/Cover), render and SSAO pass unification.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 12:26:21 +02:00
..
batch.rs render, render_lines: typed instance records, and the 3D shaders take the shared sRGB curve (C9, C12) -- TransformTint (#[repr(C)] model matrix + linear tint) is LAYOUT_TRANSFORM_TINT's record: TransformTint::floats gives the packed floats a scene item holds and TransformTint::records reads them back, so the renderer's item path reads typed records and TRANSFORM_TINT_FLOATS and the hand indices go. render_lines: Sprite (pos, size, colour, rotation, birth) is the point record and PointBatch::push takes one, as LineBatch::push takes a Segment. The skinned shader's surface_linear/surface_display and fast GI's decode_srgb are mod.shared's srgb_to_linear / linear_to_srgb (registered before the scene shaders); the display encode now uses the exact 1/2.4 exponent. 2026-10-01 18:45:35 +02:00
draw.rs render: what motion3d's Scene3D renderer needs to be the only one -- a world's linear and exp2 fog are fogged with distance as they say in the HDR lane (clustered scene_fog: fog_ctl.z 1 linear start..end, 2 exp2 by density; height fog stays the default), not mapped to a height fog's density; an HDRI's prefilter and irradiance are kept for the process under its texture reference (render_material ibl::prefiltered / ibl_texture_kept), so a host prewarms it behind its loader and scenes sharing a map share one prefilter; render_graph's tone map can write the exposed, supersample-resolved linear light (DrawToneMap::set_linear_output) for a host that tone maps a composed frame itself; render_lines strokes may take LineEdge::Inner (antialiased within the stroke's own outline, at least a pixel wide: crisp hairlines). Checked: cargo check --release -p makepad-render -p makepad-render-lines -p makepad-render-graph; with the commercial motion3d change, the P(DOOM) 22 plates x 4 frames against the old renderer (worst mean 0.069 levels, stack), motion3d pixeltest 42/42. 2026-10-01 14:54:22 +02:00
ink.rs libs: makepad-render-lines, makepad-geom3d and makepad-text-mesh, the P4 lines/geometry/text crates, with typography primitives and the text.outline/text.layout kernel host components -- render-lines draws capsule segment batches (per-end width, colour, distance and birth) and sprites into whatever pass is current, linear, premultiplied and unclamped (HDR; the BGRA8-declared shaders get their RGBA16F pipelines from the platform), over or additive, with dashes, trim windows, comet tails, camera-distance fade, birth reveal, near-plane clipping, world or pixel widths, in world space or logical screen pixels. Widths are logical pixels and coverage is the exact one-physical-pixel box overlap, so a line keeps its ink at every output scale (sharper, not thinner, at 4K); lines under 0.7 physical px draw at 0.7 with alpha width/0.7 (the fade floor). The kernel record layouts LinePoint, LineSegment and Sprite feed batches directly. geom3d is Stage motion3d's mesh, math and geom builders (primitives, shapes, extrude/lathe, curves/tubes, procedural surfaces) plus vj_fx's FxMesh stream (its upload helpers dropped; hosts call Geometry::update directly), moved. text-mesh is vj_fx's text_mesh.rs moved verbatim (only import paths change) and motion3d's per-letter text3d as letters, plus typo: fonts read at any variable-axis values (Send, parsed on use), shaped kerned layout metrics (glyph x, advance, ink box, cap/x-height, glyph_x for split runs, OpenType features), glyph outlines as placed polylines with hole detection and resampling, fit solvers (width, justified column, area, slot, shared-size groups, balanced breaks), single-stroke fonts (our own .strokefont format and a bundled "Makepad Technical" single-stroke sans drawn for Makepad, optical kerning from per-band ink profiles, write-on with the pen head, voice-timed length with no run-ahead), karaoke char/syllable/word states (unsung/sung/cooled, anticipation, rtl), and text on a projected 3D path. host registers text.outline and text.layout into makepad-script-compute's host registry: fonts registered at load (register_font), text as a scalar slice, per-input declared cost, tier X, overflow returns -1. Checked: cargo test --release -p makepad-render-lines (8) -p makepad-geom3d (41) -p makepad-text-mesh (60, incl. native and interpreted kernels calling text.outline/text.layout); MAKEPAD_HIDE_WINDOWS=1 lines_check check on Metal: ink at 1x and 2x equals the width for 0.35-4 px lines to 8-bit precision, an intensity-3 additive line reads 3.0 in RGBA16F, dash 6/gap 2 covers 0.750, trim/tail/birth windows, near-plane clip and world widths hold; lines_check bench: 200k segments, 3.08 ms/frame end to end into 1080p RGBA16F (unpaced), 2.8 ms CPU packing. 2026-09-30 12:09:46 +02:00
layouts.rs draw and widgets: Slug text everywhere, no blank glyphs, slimmer widgets 2026-10-13 12:26:21 +02:00
lib.rs libs: makepad-render-lines, makepad-geom3d and makepad-text-mesh, the P4 lines/geometry/text crates, with typography primitives and the text.outline/text.layout kernel host components -- render-lines draws capsule segment batches (per-end width, colour, distance and birth) and sprites into whatever pass is current, linear, premultiplied and unclamped (HDR; the BGRA8-declared shaders get their RGBA16F pipelines from the platform), over or additive, with dashes, trim windows, comet tails, camera-distance fade, birth reveal, near-plane clipping, world or pixel widths, in world space or logical screen pixels. Widths are logical pixels and coverage is the exact one-physical-pixel box overlap, so a line keeps its ink at every output scale (sharper, not thinner, at 4K); lines under 0.7 physical px draw at 0.7 with alpha width/0.7 (the fade floor). The kernel record layouts LinePoint, LineSegment and Sprite feed batches directly. geom3d is Stage motion3d's mesh, math and geom builders (primitives, shapes, extrude/lathe, curves/tubes, procedural surfaces) plus vj_fx's FxMesh stream (its upload helpers dropped; hosts call Geometry::update directly), moved. text-mesh is vj_fx's text_mesh.rs moved verbatim (only import paths change) and motion3d's per-letter text3d as letters, plus typo: fonts read at any variable-axis values (Send, parsed on use), shaped kerned layout metrics (glyph x, advance, ink box, cap/x-height, glyph_x for split runs, OpenType features), glyph outlines as placed polylines with hole detection and resampling, fit solvers (width, justified column, area, slot, shared-size groups, balanced breaks), single-stroke fonts (our own .strokefont format and a bundled "Makepad Technical" single-stroke sans drawn for Makepad, optical kerning from per-band ink profiles, write-on with the pen head, voice-timed length with no run-ahead), karaoke char/syllable/word states (unsung/sung/cooled, anticipation, rtl), and text on a projected 3D path. host registers text.outline and text.layout into makepad-script-compute's host registry: fonts registered at load (register_font), text as a scalar slice, per-input declared cost, tier X, overflow returns -1. Checked: cargo test --release -p makepad-render-lines (8) -p makepad-geom3d (41) -p makepad-text-mesh (60, incl. native and interpreted kernels calling text.outline/text.layout); MAKEPAD_HIDE_WINDOWS=1 lines_check check on Metal: ink at 1x and 2x equals the width for 0.35-4 px lines to 8-bit precision, an intensity-3 additive line reads 3.0 in RGBA16F, dash 6/gap 2 covers 0.750, trim/tail/birth windows, near-plane clip and world widths hold; lines_check bench: 200k segments, 3.08 ms/frame end to end into 1080p RGBA16F (unpaced), 2.8 ms CPU packing. 2026-09-30 12:09:46 +02:00