# 0.4.0

## Summary

- Names: renamed to the Rust conventions (Rust API Guidelines C-CASE). Functions, methods, variables, fields and modules are snake_case, enum values UpperCamelCase and associated constants SCREAMING_SNAKE_CASE.
- Same as the original vanilla.js: ported the general-purpose features that came into the original 0.4.0 (features moved from games, window stacking, loading and saving, input actions, the standard form of toon 3D, the shadow atlas) and its bug fixes with the same API. The folders now match the original too. (module paths are unchanged)
- Engine: graphics are usable anywhere. Scenes build GL resources with engine.get_graphic() in create, initialize, tick and async tasks. async/await is used like the original as well.
- The desktop now does what the browser used to: sound output moved from kira to the engine mixer on cpal, AVIF and HE-AAC decode, and word segmentation, fonts and Canvas2D set_font and put_image_data match Chrome.
- Scene and Engine: the original now also passes touches to widgets on nodes whatever the scene type, like the Rust version, so the two engines match. Fixed it, together with the original, so the view transform is applied before each scene draws.
- Docs: tools/apidoc (crate vanilla-engine-apidoc), which extracts the API data from doc comments, docs/api/0.4.0.json and the guide docs/guide/0.4.0/ko, en.
- Migration: where the public API or usage changed is gathered in one place in the 'How to migrate' section at the bottom. A game only needs that section to see what to change. (naming conventions, SoundSystem::new and its functions, Image::get_pixels, ScreenEffect::destroy, JsonAsset.load, FbxLoader names, ToonScreenOutline, toon shading)

## New features and changes

- GPU memory tracking (the same as the original afb9fc8 and 14586d0, for development): counts the bytes of textures, renderbuffers and buffers by kind and by owner. Bytes are nominal values computed from format and size (multisample renderbuffers multiply by the sample count; the canvas default framebuffer share is 4 bytes color + 4 bytes depth and stencil, times 4 plus one resolved color image when multisampled) and are counted only while tracking is on. It is off by default, so the creation and sizing calls of GlContext only look at one flag and nothing runs per frame. Added: EngineConfiguration::track_gpu_memory (default false), enable_gpu_memory_tracking, is_gpu_memory_tracking_enabled and read_gpu_memory_usage on Engine and Graphic (read turns tracking on if it is off and counts from then on), the enum GpuMemoryKind (Texture, Renderbuffer, Buffer) and GpuMemoryUsage, GpuMemoryKindUsage, GpuMemoryOwnerUsage (counterparts of the original { totalBytes, canvasBytes, kindTable, ownerList }). The owner is the top three frames of the creating call stack (desktop captures the frames at creation and resolves them when read; the web has no stack and uses the creating source location). Everything is cleared when the context is lost. Counted in GlContext: create_texture, create_buffer, create_renderbuffer, delete_*, tex_image_2d, tex_image_3d, tex_storage_2d, tex_storage_3d, generate_mipmap, renderbuffer_storage, renderbuffer_storage_multisample, buffer_data_size, buffer_data_u8_slice; the same calls the engine made directly on the glow context now go through GlContext. Web image-source uploads (tex_image_2d_with_*, tex_image_3d_with_*) are counted like the original, as width x height x format bytes (image, canvas, video, ImageBitmap, VideoFrame, ImageData). Named creation (create_named_*) is desktop-only and does not exist in the original (WebGL2), and partial buffer updates (buffer_sub_data) do not change the storage size and are not counted by the original either, so they are not counted.
- Graphic context loss handling and shader build failure notification (the same as the original afb9fc8 and its shader build failure notification; the web build receives webglcontextlost and webglcontextrestored the same way and desktop never loses the context): Engine gained add_graphic_context_event_listener, remove_graphic_context_event_listener, dispatch_graphic_context_event (the enum GraphicContextEvent with Lost and Restored, the listener type GraphicContextEventListener), Graphic::is_context_lost and GlContext::is_context_lost. On the web, when the context is lost the engine accepts the restore with preventDefault, does not draw while lost (it only updates scenes), drops the piled-up batch, reports once on standard error and passes Lost. When it comes back the engine rebuilds the base resources it made (the default shader program, vertex array, white texture, batching, particles, blend shaders, offscreen targets, the image texture and glyph caches), resumes drawing and passes Restored. GL objects the game made (toon renderers and meshes, shadow maps, its own shaders, render targets) cannot be rebuilt by the engine, so the game rebuilds them on Restored. When the engine cannot build a shader program (a toon renderer material, a screen effect pass, a Graphic::resolve_shader_program program, the ToonView3D renderer) it reports a GraphicError { kind, name, error } once to the graphic error listeners, in addition to standard error. Added: Engine::add_graphic_error_listener, remove_graphic_error_listener, dispatch_graphic_error, GraphicError, GraphicErrorKind::ShaderBuildFailed, GraphicErrorListener. A failure after the context was already lost is not the shader's fault, so it is neither reported nor remembered, and the program is rebuilt after the context comes back. The toon body shader's readShadeLevel now reads the last shade stop color with a constant index and a loop, letter for letter the same as the original (an iPhone SE2 A13 killed the GPU process on the dynamic index read).
- Capture mode (VANILLA_CAPTURE_*): the 0.3 s fade-in of a scene loaded before the first frame is counted from the first frame's time (same as the original). The desktop reads files at once, so the assets handed off finished before the first frame and the fade started at clock 0, while in the original fetch finishes after the first frame and the fade starts at the first frame time (1/60 s), so the scene's first tick was frame 19 in the original and 18 in Rust. Both are 19 now, and the toon showcase captured at the same frame number differs from the original in 36 pixels (5 above 8). Outside capture mode nothing changes.
- Canvas antialias advice for games using post processing (docs only, behavior unchanged, same as the original): ToonPostProcess draws into its own MSAA target, so a game that uses it builds with EngineConfiguration::antialias set to false. With true the canvas itself is MSAA, so the pass that copies to the screen and the UI blend per sample and cost more (Mac mini 2560x1440 toon post scene GPU throughput 6.89 to 6.49 ms, with the other build 6.81 to 5.22 ms).
- Toon body shader feature variants (same as the original a5e964c, the standard way, like Unity shader keyword variants: unused branches are removed from the program, picture unchanged): the renderer looks at what a draw uses (base, emissive, decal, matcap and angel ring textures, receiving shadows, and from the light set a ramp texture, two or more shade stops, the two rim lights, light intensity limit) and builds the body fragment shader for those feature bits. Code of unused branches is gone at compile time, so each pixel costs less (original, iPhone SE2 frame interval of the miner game with outline and shadow off: 28.6-31.6 ms before vs 24.7-25.3 ms). A variant is built the first time it is drawn (one frame may hitch then; ToonRenderer::prepare_material only prebuilds the default program) and the number of variants is the number of used bit combinations. The default program keeps every branch on. The only API change is a trailing parameter disabled_features of compose_toon_program_sources (&[&str], empty by default, an unknown name panics). The shader text is identical to the original down to the character, including not dropping the shadow branch when there is no shadow input (on the original's Mac Chrome the compiler folded the expression differently and 8 pixels changed by one step)
- Toon screen-outline batching of mirrored items (same as the original c69269c, ToonDrawQueue, the is_mirrored slot at the end of draw_mesh_batch of ToonScreenOutline, for games that draw a reflection by queueing the same actor again with a matrix flipped about the floor): items whose winding flips (a negative determinant or is_mirrored) were drawn one by one, in the screen-outline board only (the body, the outline shell and the shadow already batched mirrored items among themselves). The screen-outline board now batches mirrored items of the same mesh and line style into one instanced draw too, and every item in a batch is drawn with the same winding. The test (toonbatchtests) checks that three mirrored items become one batch in the screen-outline board too, and that the screen is byte-identical to the one drawn without batching
- Toon instance buffer path (same as the original 293fe41, the path the miner game uses): ToonRenderer gained update_instance_buffer_range (updates only from the first instance with buffer_sub_data, Err when out of range), and ToonInstanceBuffer gained get_generation (+1 on every change), get_bounds (ToonInstanceBounds: center of the position box, distance to the farthest position, largest scale), get_data and get_id. Instance layouts gained instanceLineId (size 1, location 15, TOON_INSTANCE_LINE_ID_NAME, TOON_INSTANCE_LINE_ID_LOCATION, has_line_id; with it, at most two user attributes). ToonDrawQueue::add_mesh_instance_buffer and ToonScreenOutline::draw_mesh_instance_buffer let the body, the outline shell, the shadow and the line board share one uploaded GPU buffer without uploading again (the line board reads the instanceLineId slot as the line id). The shadow cache notices changes through the buffer id and generation. The existing draw_mesh_instance_buffer now culls the whole buffer by its bounds (same name and arguments, a buffer outside the screen has no pixels so the picture is the same; with is_culled false it does not cull). read_instance_buffer_sphere and is_sphere_in_frustum are public. The instance-layout shader text and the line board vertex shader are identical to the original down to the character (the test loads the original repository with node and compares). The test (tooninstancebuffertests) draws the miner mid scene for 75 frames on both the array and the buffer path and checks byte-identical pixels, fewer uploads (24 vs 6 on frame 0, then 13 vs 0), one buffer_sub_data on the frame where one rock changes, and the shadow cache re-baking
- A 3D color space setting (same as the original a803b71, in the style of Color Space: Gamma/Linear in Unity Player Settings): added EngineConfiguration::color_space and the enum ColorSpace (Gamma, Linear). The default is Gamma, and the screen is byte-identical to before. With Linear, toon 3D draws along the standard linear path. ToonRenderer::create_texture uploads color textures (base color, emission, decal, matcap, angel ring, ramp) as SRGB8_ALPHA8 so the GPU decodes them to linear (filtering and mipmaps in linear space), the shader no longer applies pow 2.2 to those textures, and passed colors (vertex color, tint, emissive color, decal color, outline color) are converted to linear with the standard sRGB curve (IEC 61966-2-1) before they are multiplied and mixed. Screen output, ToonPostProcess after tone mapping, the HDR shell outline and ToonScreenOutline line color, and the GLB base color (baseColorFactor into the vertex sRGB color) use the same curve. Data textures such as normals and masks are uploaded as plain RGBA8 with is_color_data: false in ToonTextureOptions (gamma does not distinguish them). With Linear, the 3D shaders the engine builds get #define VANILLA_COLOR_SPACE_LINEAR 1 (the shader text has the same two #ifdef paths as the original), and material chunks get toSurfaceColor(vec3), which converts an sRGB color into the space of ToonSurface.baseColor. ToonRenderer::new_with_options(ToonRendererOptions), ToonScreenOutline::new_with_options(ToonScreenOutlineOptions) and ToonPostProcessOptions::color_space take the color space (the default is the engine's value, Gamma without an engine, and new uses the engine's value) and report it with get_color_space. Added Engine::get_color_space and Graphic::get_color_space. Desktop GL does not enable GL_FRAMEBUFFER_SRGB on the default framebuffer (the shaders apply the curve themselves, as on the web canvas). 2D is composited in gamma space either way. Frames 5 and 40 of six toon examples (toonview, toonmaterial, toonpost, toonstyle, toonfx, toonshowcase) and the test scenes are byte-identical to before with Gamma. A capture test (tests/tooncolorspace.rs) runs the same checks as the original tooncolorspacechrome (texture encoding, the define line, the half mix at 127 for gamma and 188 for linear, the same values as the original, and engine defaults).
- Toon ambient occlusion (same as the original 61a68fa, screen-space AO, GTAO: Jimenez, Wu, Pesce, Jarabo 2016, applied only to indirect light like Unity URP SSAO): added ToonPostProcess::set_ambient_occlusion(is_enabled, intensity, radius, resolution_scale, direct_lighting_strength), get_ambient_occlusion (ToonAmbientOcclusion), is_ambient_occlusion_enabled, draw_ambient_occlusion(gl, line_target, view_matrix, projection_matrix), get_ambient_occlusion_texture, get_ambient_occlusion_prepass(gl) and draw_ambient_occlusion_with_prepass, ToonRenderer::set_ambient_occlusion_texture, get_ambient_occlusion_texture, ToonDrawQueue::set_post_process and has_post_process. The three shaders (GTAO, horizontal blur, vertical blur with upsampling) are the original text as is. Normals and depth reuse the screen outline's line target, and scenes without outlines draw only the line target with no lines (ToonScreenOutline skips seeds and flooding when both outline and crease widths are 0, and draw_outline draws nothing). ToonDrawQueue computes it after the line target and before bodies, sets it on the renderer and clears it after end_frame. The body shader switches to a body program with TOON_AMBIENT_OCCLUSION defined (sharing the default outline and shadow depth programs, falling back to the default when it cannot be built) and multiplies the visibility at the screen position into the ambient light. The texture unit is 16. The original uploads the origin in the ambientOcclusionOrigin field of the ToonFrame frame block; Rust has no frame block yet and uploads the same value in a uniform with the same name. With it off, bodies use the default body program, so the screen is byte-identical to before. A capture test (tests/toonambientocclusion.rs) draws the same scene as the original toonambientocclusionchrome (room corner, crate, robot) with the same checks, and the measured darkening (wall corner, left corner, beside the crate, under the robot's feet) equals the original to the first decimal. Between the two engines (640 x 360), 55 pixels differ when on in perspective, 6 in orthographic and 25 to 140 in the AO texture, by 1 to 2.
- Direct lighting strength for toon ambient occlusion (same as the original 50cb8de, in the form of Direct Lighting Strength in Unity URP SSAO and HDRP ScreenSpaceAmbientOcclusion.directLightingStrength): added the fifth argument direct_lighting_strength of set_ambient_occlusion (0 to 1, default 0 in the original), get_ambient_occlusion_direct_lighting_strength (post process and renderer), ToonAmbientOcclusion::direct_lighting_strength and the second argument of ToonRenderer::set_ambient_occlusion_texture. After the band is chosen, the body shader multiplies the diffuse and specular of the sun band light, fill light, point lights and spotlights by 1 - strength x (1 - visibility) (the original text as is, multiplied at the same places, so strength 0 is byte-identical). Rim light, glow, matcap and angel ring stay as they are. The value is uploaded in the uniform ambientOcclusionDirectLightingStrength (the original uses the last field of the frame block). The capture test checks that with strength 0, 0.25, 0.5 and 1 the wall corner darkens 4.9, 5.9, 7.3, 9.8 and under the robot's feet 4.2, 6.0, 8.1, 12.1, the same as the original, and that open floor and the robot head stay byte-identical to off even at strength 1.
- Toon ambient occlusion vertical blur at half resolution and upsample as a four-tap depth and normal weighted bilinear (same as the original 394f5af, like Unity URP SSAO, which blurs in the reduced buffer): the vertical blur was moved out of the full-resolution upsample pass (7 x 2 = 14 taps) into the half-resolution pass with the same shader as the horizontal blur (direction uniform blurDirection), and the upsample now mixes the 2 x 2 nearest half-resolution cells with the bilinear weight multiplied by a weight chosen by the pixel's depth and normal (4 taps). No new buffer: the GTAO buffer and the blur buffer are used in turns (horizontal from the GTAO buffer to the blur buffer, vertical from the blur buffer back to the GTAO buffer). The shader text is identical to the original character by character (a test compares with the original file). On the same scene (room corner, crate, robot, 640 x 360, perspective, orthographic and outline) the picture differs from the original in Chrome by at most 2/255 (within 0.5% of the pixels).
- Does not use discarding attachments at the end of a pass (invalidate_framebuffer); passes that overwrite a whole target clear it first (clear_buffer) (same as the original f94e794): measured per site in the original on real devices in Safari (iPhone SE2, iPad mini 6), no site showed a gain and each added several to tens of ms per frame (51 ms on SE2 becomes 11 ms with it off, 90 ms becomes 25 ms on iPad). RenderTarget::resolve no longer discards attachments after resolving (is_attachment_kept of resolve_with_attachment_kept is no longer used and is kept), and the opacity layer (begin_opacity_layer) no longer discards its depth and stencil when it ends. The bloom bright extraction and blur, the multi-level bloom extraction and downsampling, and the four ambient occlusion passes clear their target first. The screen result is unchanged.
- Web image decoding through the browser (same as the original) and wasm size: on the web, 2D images are always decoded by the browser (HTMLImageElement), as in the original. Images of AssetLoader and ImageAsset::load are decoded by the browser by content without a type even if the response type and extension are not images (same as the original img.src), and ImageAsset::load_from_bytes stays loading until the browser decodes an untyped Blob, like the original loadFromBytes (if it cannot, it fails with "Load fail: path", same as the original). So the web wasm no longer ships the image crate decoders (including webp, gif, bmp, ico), the engine JPEG decoder or the color profile reading. On the web, color glyph PNG decoding and screen capture PNG writing use the png crate under image (desktop is unchanged). On the web the image crate remains only on the paths that decode 3D material and GLB images on the spot (Material, decode_glb_image), and is not shipped in games that do not use them. The wasm-bindgen command in the README and guides now has --remove-name-section --remove-producers-section (drops the function name section and the producers section). _bg.wasm size after wasm-bindgen (Mac, wasm-release, engine codegen-units 1, before is the old README command, after is the new one): uigallery 3,431,940 -> 2,945,625 bytes (gzip -9 1,196,670 -> 1,109,185), toonview 3,533,498 -> 3,047,917 (1,230,223 -> 1,142,121). loadingshowcase, which loads images, compared with sections removed on both sides: 5,356,171 -> 4,931,916 (2,195,165 -> 2,047,645). The pictures of the three examples captured in headless Chrome differ from before by 0 pixels.
- Streaming audio loading (same as the original AudioLoadType, the form of Unity's AudioClip Load Type and Unreal's sound wave streaming): AudioAsset gains the load type AudioLoadType (Automatic, DecompressOnLoad, Streaming) with set_load_type, get_load_type, is_streaming, get_stream_url, and the threshold AUTOMATIC_STREAMING_BYTE_THRESHOLD (1 MiB). Until now every sound was fully decoded to PCM, so one 3 minute stereo background track held about 61 MiB (f32). The default stays full decoding (DecompressOnLoad) as in the original, and only assets set to Automatic stream files larger than 1 MiB (the file size on desktop, the response Content-Length on the web). The engine SoundSystem sound row (SoundRow) gains a load_type field; when it is None, background music (is_music) uses Streaming and sound effects use DecompressOnLoad. Desktop: a streaming asset holds only the compressed source (a file path or bytes in memory) and the trim plan (opening demuxes the file once), and when played, a decoder thread per player decodes chunk by chunk into a ring buffer (16384 frames, 128 KiB for stereo) that the mixer's streaming source reads (nothing is decoded on the audio thread). Packet reading, Chrome's start and end trimming, the SincResampler and the speaker rules are the same code as full decoding, so the produced samples are bit-identical to the fully decoded buffer (27 test formats), and the streaming source computes like the buffer source, so playback, the end, the loop seam, a start position, stopping, playback rate and a different device sample rate produce bit-identical output. Looping reopens the decoder at the end and writes the next pass right after, without a gap, and a start position (set_time) decodes from the start and discards up to it. When the ring runs dry it outputs zeros meanwhile and the position follows the context clock. The duration (get_duration) is the length the container reports (the same as full decoding for the MP3, AAC, FLAC, WAV and Ogg test files; WebM, whose blocks carry no duration, can differ by about 4 milliseconds (-68 to +177 frames)) and becomes the decoded length once the sound has been decoded to the end. Web: as in the original, an HTMLAudioElement is connected to the player's GainNode through a MediaElementAudioSourceNode (one media element per player, the pitch follows the playback rate, other origins use CORS, sounds loaded from memory use a blob: URL). When the context is suspended the media element pauses and resumes with it, get_time is the media element's position, and background music faded out by SoundSystem stops when the fade ends. Measured (Mac mini M2 Pro, 3 minute stereo AAC of 2.92 MB, release optimization): full decoding loads in 107 ~ 125 ms and holds 63,504,000 bytes of PCM; streaming loads in 1.6 ~ 1.8 ms (demux only) and holds a 131,072 byte ring, playing from the start takes 0.7 ~ 1.0 ms (one ring fill), and playing from 150 seconds takes 0.03 ms (the decoder thread decodes from the start and discards up to that point, so the sound starts that much later; that delay was not measured). The original on a real device (iPhone SE2) loaded in 137 ms against 8,618 ms for full decoding.
- Drawn rects now match the original: Text follows the original calculateDrawnRect and calculateWrappedDrawnRect (a single line reserves 1.5 times the font size above and below the baseline, wrapped text reserves one font size around the line block, horizontally half the font size plus the stroke, and Start and End cover both sides). Before, the rect used the measured ascent and descent and was tighter, so Rust alone culled a row at the scroll edge that the original draws. ShadowText reports a generous rect regardless of baking (twice the blur, the bake padding and the shadow offset), RichText the summed width of its segments with the largest font size and stroke (append_segment and clear_segments mark it dirty), the rich mode of UILabel uses that rect, HeatHazeEffect the wobble amplitude plus 1, UIInputField the content area and the single line text area plus 2 (tick marks it dirty when the drawn values change), and the input field context menu its shadow margin. Before, all of these were unknown, so their ancestors were never skipped. The per node component culling (WorldNode::draw_components) now also widens the content area by one unit when a component draws inside the content, and ignores empty rects, like the original (before, it was one unit tighter and culled boxes at the scroll edge one frame earlier than the original).
- Subtree "fully inside" mark (same as the original): when the subtree draw bounds of a node lie fully inside the visible rect (shrunk by one device pixel), its descendants skip the subtree check, the component culling and the visible child range search while the node is drawn, and only look at the bounds size. A new clip starts checking again inside it (clip state serial). The check in parent coordinates uses the inner rect when the transform is axis aligned, and the check after the transform uses device coordinates. Added Graphic::is_inside_visible_bounds. The example subtreecullinside (SUBTREECULL_CHECK=1) renders the scene of the original subtreecullinsidechrome with culling on, off and all off, and compares the screen bytes, the draw count of each box and the count drawn as fully inside.
- Uploading images during the loading screen (same as the original prepareLoadedImages and prepareImage, the form of Unity's asyncUploadTimeSlice and Unreal's upload while loading): added Graphic::prepare_loaded_images(time_limit_milliseconds) and prepare_image(image). Images read and decoded by ImageAsset and AssetLoader (AssetLoadHandle::set_decoded_image) are stored as images not uploaded yet (weak references), and after the scene's tracked assets are read the engine uploads them to the GPU during the loading screen, 2 milliseconds per frame (counted together with the extra 0.3 seconds of display). It initializes only after all are uploaded. Capture mode uploads all at once. The Graphic held by the engine when ImageAsset::load is called is the owner, and a Graphic uploads only its own (if the owner is unknown, only when there is a single Graphic, same as the original). Until now uploads piled up on the first drawing frame.
- UIInputField IME, two fixes (same as the original; single line and multiline, including the desktop dialog input box): composing with text selected shows [text before the selection, composition, text after the selection] while composing (get_display_text, TextEditBuffer::build_display_text, drawing, cursor and underline positions; until now the composition was inserted at the cursor leaving the selection in place; committing replaces the selection as before). Added TextEditBuffer::get_composition_start, get_composition_end and get_display_text_before_cursor. set_text during composition clears the composition state and text (until now it stayed stuck in the composition state with the old composition text left in the visible text).
- Bone pose hook (the same place as the original, the same shape as Unreal AnimBP's Transform (Modify) Bone and bone overrides in Unity's LateUpdate): added a seventh argument pose_adjust: Option<ToonPoseAdjust> to write_skin_pose. After the animation is sampled and blended, and before the skin matrices are built, it modifies each bone's local transform (translation, rotation, scale). ToonPoseAdjust::Hook(&mut hook) is called with (locals, skeleton) and the hook makes the changes (locals is a copy for that call only, so modifying it in place does not change the skeleton's rest pose), and ToonPoseAdjust::Bones(&[BoneModifier]) applies a per-bone modification table (node_index or name, translation, rotation, scale, mode, weight, Default changes nothing). Added adjust_bones(locals, skeleton, modifiers), which applies the table, and the modification mode BoneModifyMode (Add adds translation in parent space, multiplies rotation after in the bone's own space and multiplies scale, Replace sets the given value). weight is the ratio between before and after the modification. With None the result is bit-for-bit the same as before, and modifying one bone changes only that bone and the bones below it. The skin matrices of fox.glb (table, blend and table, hook) are bit-for-bit the same as the original run in Chrome 158. (tests/assets/skinposeadjust)
  - Quaternion normalization in pose computation (sampling animation channels, mixing two rotations) now uses the Math.hypot computation like the original (the engine's hypot_list). Before it was the square root of the sum of squares, so the last digit of the length could differ from the original. (34 % of a million random quaternions; skin matrices are f32 so the last digit rarely differed)
- 3D camera shake (the same place as the original, the shape of Unity Cinemachine Impulse and Unreal Camera Shake): added CameraShake. CameraShake::new(base seed) (Default is 1); each shake from add(CameraShakeOptions) takes the strength of 3 position axes and 3 rotation axes (pitch, yaw, roll) (amplitude, rotation_amplitude, per-axis shares position_axes, rotation_axes), frequency (frequency, default 10), duration (duration), attack (attack), decay ((1 - age / duration) to the power decay_exponent, default 2), age (age, an event seen late added with that age continues with the same values as if added from the start, negative starts later) and seed (seed: Option<u32>). The signal is two sine waves with slightly different frequencies per axis, live shakes are summed, and the same seed gives the same values. It has update(seconds), read() (CameraShakeOffset { position, rotation } in camera local axes), is_shaking and clear. As places to apply it, added Camera3D::set_view_offset(position, rotation) (an offset in camera local axes applied last to the view matrix, on both the computed path and raw matrices, get_eye_position is the value before the offset) and create_offset_view_matrix(&view_matrix, position, rotation), which applies it to a view matrix the game computed. The seed drawing order and sine wave constants are the same as the original, so 852 read() values and the offset view matrices are bit-for-bit the same as the original run in Chrome 158. (tests/assets/camerashake)
- glTF quantized mesh reading (KHR_mesh_quantization, same as the original): the toon GLB readers (read_glb_arrays, read_glb_node_arrays, read_glb_node_infos) and SkinnedModel read GLB files whose vertex attributes are stored as integers. Normalized integers are divided with the glTF spec formulas (signed ones as max(c / 127, -1), max(c / 32767, -1)) and non-normalized integers are read as is. Position dequantization comes from the node transform or inverseBindMatrices, and texture coordinates get the material texture's KHR_texture_transform baked in. Normalized integer rotations in animations are read too. An unnamed mesh node belongs to the part of its named parent node (the leaf node a quantizer adds for the dequantization transform, read_glb_node_infos gathers the bounds per name). The rebuilt outline thickness of a skinned mesh with integer positions is matched to rest pose model coordinates. If extensionsRequired lists an extension the reader cannot read (EXT_meshopt_compression, KHR_draco_mesh_compression and others) or an accessor points to a buffer outside the binary chunk (the meshopt fallback buffer), it returns Err with the same text as the original. Added read_float_accessor_array, AccessorArray::Byte and Short, COMPONENT_TYPE_BYTE and COMPONENT_TYPE_SHORT. The original test's synthetic GLB files and the values the original readers produce (tests/assets/glbquantization) check that both engines give the same values (tests/glbquantization.rs, difference 0 on macOS). For the mining ship, the mannequin and the fox with normals quantized with gltfpack, the arrays read by both engines are identical to the byte.
- Flat normals for glTF primitives without normals (same as the original 8cc37df, glTF 2.0 specification 'Using Primitive Data': without normals the primitive has flat normals and tangents are ignored): the toon GLB readers (read_glb_arrays, read_glb_node_arrays) split the vertices of a primitive without normals per triangle in index order, and give each triangle's (p1 - p0) x (p2 - p0) scaled to length 1 to its three corners (0 for a triangle with zero area). The outline shell rebuilt from the body does the same. Before, such primitives were not stored, so reading the example fox.glb with the toon reader gave an empty picture. SkinnedModel used to build smooth normals at upload when normals were missing (for an indexed mesh, face normals summed and averaged per vertex), which differed from the specification. Now interpret_content splits the vertices with the same math and gives flat normals (rounded to 32-bit floats like the original Float32Array), and indices is None (positions, texture coordinates, joints, weights and morph deltas are split too). The toon and PBR arrays of eight real GLB files (the mining ship, the fox without and with normals, the mannequin and their quantized versions) read by both engines are byte-identical in all 110 files (108 before, the two PBR foxes differed). The body and shell arrays of a row of mesh builder shapes (box, rounded box, cylinder, sphere, lathe, capsule, torus, octahedron, faceted chunk, and quad and triangle shells of front and back faces whose normals cancel) are also byte-identical to the original in all 28473 values. (tests/glbquantization.rs, the fox and asset tests in skinnedmodel.rs)
- Toon highlight (same as the original e85d927): per-ID line color on ToonScreenOutline, set_line_color(line_id, color), remove_line_color(line_id), clear_line_colors(), get_line_color_count(). (The Unreal Custom Stencil form, the color is picked by the ID already in the line target) The table is a 128 x 128 lookup texture covering every line ID, so there is no limit on how many are set, and it is uploaded only when it changes. A line where two IDs touch takes the color of the nearer ID, and IDs not in the table keep the set_color color. With an empty table the composite is pixel-identical to before.
  - ToonRenderer per-instance emission: emissive_color (Option<[f64; 3]> sRGB, default None) and emissive_intensity (linear multiplier, default 1) on ToonInstance. Added on top of that instance's shading and pattern so only that instance brightens. The instance data stays 20 values. The matrix is read as an affine 3x4 and the emission goes into the four values of the bottom row (elements 3, 7, 11, 15). (The 3x4 matrix form of Godot MultiMesh and Unity BatchRendererGroup) The instanceMatrix of ToonInstanceLayout is the same, and in the vertex chunk it is vertex.emissive.
  - Capture test of the same scene as the original Chrome test, tests/toonhighlight.rs (cargo test --test toonhighlight, GL of a hidden window): the five images (base, line color, after clearing, body, emission) are pixel-identical to the original in Chrome on the Mac. (0 different pixels out of 96000 at 480 x 200)
- Toon GLB accessor range: the toon GLB readers (read_glb_arrays, read_glb_node_arrays, read_glb_node_infos) return an Err for an accessor that reads outside the binary chunk instead of filling it with 0, and fill an accessor without a bufferView with 0 as the glTF specification says instead of reading bufferView 0. (The same meaning as the accessor reading of the original SkinnedModel. The original toon readers use the short array they read as it is and throw a TypeError without a bufferView, so the same check goes into them too)
- Sun shadow bias follows the shadow texel size (same as the original 025ea9d, in the style of the texel-unit Depth Bias and Normal Bias, receiver normal bias and slope-scaled bias of Unity URP): the normal offset 0.02 (world) and depth bias 0.0015 (depth) that ToonRenderer had baked into the shader are replaced by the new ShadowMap set_bias(depth_bias, normal_bias), get_depth_bias and get_normal_bias (in texels, default 1 and 1). They are multiplied by the world size of one texel (light matrix width / resolution) and the 1.5 texel radius of the 3x3 PCF, and a slope-scaled bias that grows as the light grazes the surface (2.5 texels x tan, tan clamped at 10) is added. The baked values did not follow the extent and resolution: at extent 40, faces grazed by the sun (84 degrees, down to 73 degrees at resolution 512) received their own shadow entirely (acne), and with near 1 and far 100 the depth bias was 0.15 in world units, so a caster 0.1 high cast no shadow at all (peter panning). A capture test with the same scene as the original Chrome test, tests/shadowbias.rs (cargo test --test shadowbias, GL of a hidden window), checks both, and the measured values (face darkening 0.0 and 0.0, low wall shadow -1.505 ~ -1.53 with depth 98, tall wall -1.505 ~ -2.095) match the original in Chrome. The shader chunks match the original character for character, and the bias math matches the original readShadowBias bit for bit. Point and spot light shadows (ShadowAtlas) already use a normal bias scaled by texel size and slope and are unchanged.
- Capture mode determinism (same as the original): in capture mode (VANILLA_CAPTURE_*, web ?capture=), the 0.3 second loading screen wait after a scene loads is counted on the engine clock (1/60 second per frame) instead of real time. While a scene still has loading that takes real time, such as downloading assets (tracked assets and tasks other than the GameScene loading gate, which opens on the engine clock), the frame number and the clock do not advance, so counting starts once everything has arrived. Capturing the same example twice gives byte-identical images for the same frame number. (.github/scripts/capturedeterminism.cjs captures quickstart and loadingshowcase twice each and compares them)
- Scene hook forms now match the original (since the global engine works anywhere, hook names and arguments are the same as the original Scene, GameScene and UIScene): the load order is create(), then load(engine), then initialize(engine), as in the original. The former create(engine) (the place of the original async load) is renamed load(engine), and a new create() hook without arguments is added (called once before load; the engine fits the root to the view size in between). Only the hooks that take the engine in the original (load, initialize, finalize, unload) receive engine: &Engine; the others receive only the original arguments: draw_on_load(graphic), destroy(), on_page_process_restored(), on_page_visibility_restored(), resize(canvas_native_size), tick(time_delta), pre_draw(graphic), draw(graphic), post_draw(graphic), draw_gizmos(graphic), touch_press, touch_move, touch_release, touch_cancel(view_input_position), touch_wheel(view_input_position, wheel_delta). load_assets() and layout() of GameScene and UIScene take no arguments, like the original loadAssets() and layout(). The public base functions match the original too: SceneBase::tick(time_delta), tick_touch(time_delta), draw_scene_background(graphic), and on GameSceneBase and UISceneBase load(engine) (formerly create), load_assets(), draw_on_load(graphic), resize(canvas_native_size), layout(), compute_safe_area_rect(), tick(time_delta), is_dev_tools_capturing_input(), pre_draw(graphic), post_draw(graphic), draw_screen_fade(graphic), apply_play_area_reference(). ScreenFadeDarkStarter::start(scene) no longer takes the engine.
- Global engine (the same place as the original static Engine.getEngine(), the form of Unreal's GEngine and Godot's Engine singleton): the engine is created once and never removed. Engine::new puts the engine in a place that lives until the program ends and returns &'static Engine, and Engine::get_engine() returns the same engine as Result<&'static Engine, EngineAccessError> anywhere right after creation (scene functions, draw, component tick and draw, widget callbacks, page event listeners, inside async tasks). All public engine functions are now &self (interior mutability), and the engine that scene hooks and task contexts (EngineContext::with, SceneContext::with) receive changed from &mut Engine to &Engine. Reading managers and the graphic gives Ref from get_x and RefMut from get_x_mut (get_all_loaded_scenes, get_canvas, get_engine_configuration and get_platform give Ref too), and borrowing the same field again while it is being changed panics with the function name and field name. Another thread gets Err(OtherThread), and if no engine was ever created it is Err(NotCreated). The original Scene.getEngine is SceneBase::get_engine and UIView.getEngine is UIView::get_engine, giving the same global engine. ComponentContext::get_engine gives an &Engine that outlives the context. (core/globalengine.rs)
- Anti-aliasing on and off (same field as the original): added EngineConfiguration.antialias (default true, same look as before). Turning it off stops using multisampling (MSAA) for the default framebuffer. Desktop picks the GL configuration with the fewest samples without asking for multisampling, and the web creates the WebGL context with antialias: false. It removes the per-frame resolve cost on high-resolution mobile devices. The web only chooses on or off and the browser picks the sample count. Desktop uses 4 samples when on.
- Render pixel ratio cap (ViewManager::set_max_render_pixel_ratio) in the same form as the original: the same value does nothing, and a change only stores the value and raises is_view_rect_pending. Both desktop and web fit the canvas and view area at the start of the next frame through the same path as a window resize (Engine::resize), and scenes receive the screen area change. calculate_view_rect lowers it once fitted. Added ViewManager::is_view_rect_pending().
- 3D render scale (ToonView3D::set_render_scale, get_render_scale, same range 0.05 ~ 4 as the original, same meaning as Unity URP renderScale and Unreal screen percentage): when the scale is not 1 (default, unchanged), ToonView3D clears a target of the on-screen content size x scale (depth 24, 4 samples when the default framebuffer is multisampled) to transparent and draws the 3D into it (stencil and scissor off, resolved when done), then stretches it on through the 2D drawing path with linear filtering and source-over. The UI stays at device pixels, so text does not blur. It follows 2D clipping, and the 2D below shows where the 3D does not cover. The target has its own depth, so reusing earlier 3D depth with set_depth_cleared(false) only works at scale 1. The target is deleted when detached from the node (detach) and when dropped. The fifth argument of the draw function changed from the drawing buffer height to ToonViewOutput (output_framebuffer, the framebuffer bound now, None for the default framebuffer, and output_viewport, the GL viewport inside it, integers, bottom-left origin; outputFramebuffer and outputViewport of the original rect). examples/toonview shows it with the environment variable VANILLA_RENDER_SCALE=0.5 (original ?renderScale=0.5). As in the original, the ToonRenderer translucent blend builds the alpha channel as premultiplied over (ToonBlendMode::Alpha is SRC_ALPHA, ONE_MINUS_SRC_ALPHA, ONE, ONE_MINUS_SRC_ALPHA) and additive leaves alpha unchanged (ONE, ONE, ZERO, ONE). On macOS, toonview at scale 0.5 against the original in headless Chrome has a mean difference of 0.10 and 0.33% of pixels over 8 (multisample patterns on edges). The UIDocument test data (the RenderScale field of ToonView3D) is the original files as is.
- Same names as the original: WorldNode::copy_content_size_to(&mut Vector2) (original copyContentSizeTo) and ShadowAtlas::get_light_count() (original getLightCount). The original made isComponentDrawCulled, refreshMatrices and readStorage, used only internally, private and removed UIButton.setStateEvent, which did nothing.
- Toon outline depth margin (same as original 836e59e, in the spirit of Unity and Unreal depth-normal edge detection that fits the threshold to the measured error): when ToonScreenOutline separates occluded silhouettes inside one id, it uses the distance of the occluding pixel from the tangent plane of the occluded pixel. It used the smaller of the two pixels' tangent plane distances, but when the occluder is the silhouette of a round surface its tangent plane contains the view ray and the distance shrank below one pixel, so a line could break into dots. The fixed margin added to the threshold (twice the pixel size at that depth) became a margin proportional to the measured error: the angle error of the 8-bit octahedral normal (0.0165 rad) x the distance between the two pixel positions, one pixel x the sine of the angle between the two normals for two pixels on either side of a crease, and one 24-bit depth step. Added the margin scale set_depth_margin, depth_margin (default 2) and depth_threshold. The seed shader text is the same as the original. In the toonao offOutline frame (640 x 360) the pixels that differ between the two engines went from 37 (largest difference 153) to 0.
- GPU throughput measurement (same as original 9af0e19, like the Unity profiler GPU module and Unreal stat gpu, to see the time the GPU takes to draw on its own): added Engine::measure_gpu_throughput(frame_count). It draws the current scene back to back without ticking scenes, through the same draw path as an engine frame (the scene drawing of the engine update split into the same function), waits for the GPU with a 1-pixel read, and returns the wall-clock time per frame as GpuThroughput { frame_count, chunk_frame_count, milliseconds_per_frame, chunk_milliseconds_per_frame } (Promise<Result<GpuThroughput, String>>). From the next engine update it draws 10 warm-up frames and then one chunk of 30 frames per update so it never blocks for long; engine time, input, frame number and capture stand still while measuring, and the engine loop resumes when done. Because it draws the same state repeatedly, caches such as shadow OnChange do not re-bake, and presenting happens only for the last frame of each chunk.
- Engine GL context GlContext (the same place as the context with intercepted state functions that the original Graphic.getWebGL2RenderingContext returns): Graphic::get_gl, the run_external_pass pass, the toon renderer's on_before_draw, ToonDrawQueue stage callbacks and the ToonView3D draw function now give GlContext instead of glow::Context. glow's HasContext is a sealed trait that cannot be implemented outside glow, so GlContext intercepts the state functions (bind_framebuffer, viewport, scissor, enable, disable, is_enabled, clear_color, color_mask, blend_func, blend_func_separate, blend_equation, blend_equation_separate, depth_mask, depth_func, front_face, cull_face, use_program, link_program, delete_program, bind_vertex_array, active_texture, bind_texture, pixel_store_i32, create and delete, get_parameter_* reads) as methods with the same names and signatures as glow and calls them through the state cache; every other function (all methods of HasContext and the inherent methods of the web glow::Context, 380 of which 44 are web only) is generated by machine as a method with the same name and signature (src/core/glcontext/generated.rs, the header comment says how it is generated) and calls the inner glow::Context as is. Deref is removed and there is no public way to take out the inner glow::Context, so passing a GlContext to a function taking `&glow::Context` is a compile error (game code has no way to skip the state cache, the same as the original intercepting the context and knowing every state call). Functions inside the engine that receive GL (public and private alike) also take `&GlContext` instead of `&glow::Context`. The named creates of desktop GL 4.5 (create_named_framebuffer, create_named_texture, create_named_buffer, create_named_vertex_array), program_binary, pixel_store_bool and the web bind_external_framebuffer are also written by hand so that they go through the state cache or make it forget what it remembered. Desktop GL functions that the original WebGL2 does not have (per draw buffer enable_draw_buffer, color_mask_draw_buffer, blend_func_draw_buffer, blend_equation_draw_buffer and the like, plus viewport_f32_slice, scissor_slice, bind_texture_unit) make the state cache forget the affected value. So when game code changes state through GlContext and keeps calling engine drawing inside the same callback, the engine no longer skips wrongly. The state cache also tracks the blend equation (blend_equation, blend_equation_separate), like the original. Two real GL tests were added: 800 random calls mixing GlContext and the engine path, checking without any reset that read answers and skip comparisons match real GL (0 differences), and a pixel test that engine drawing is right right after GlContext changes the program, texture, active unit, blending and scissor (it also checks that changing them through raw glow goes wrong, so the test does catch the problem). Added a test that calls 44 kinds of state functions 2000 times at random through the game path (GlContext) only and compares in check mode after every call (0 mismatches), and five compile_fail doc tests checking that code taking out the raw glow::Context or passing it to a function taking `&glow::Context` does not compile. The safety-net resets the engine did at the boundaries (get_gl, the end of a run_external_pass pass, after on_before_draw, after stage callbacks) are removed (same as the original). The examples modelviewer, blendmodes and batchclip render pixel-identical images to before (modelviewer compared with frames paired two apart, because its scene start depends on wall clock time).
- 2D batching breaks less often (same screen result, the same scheme as the original): (1) Axis-aligned square clips whose edges lie on pixel boundaries (begin_clip_rect, Mask, UIScrollView) are discarded by the batch shader at pixel centers using a clip rectangle table index carried in the vertices instead of the stencil (the Unity RectMask2D and UI Toolkit scheme), so setting and releasing clips keeps the batch going. Rotated or rounded clips, and clips whose edges are not on pixel boundaries on a multisampled screen (desktop reads the sample count of the default framebuffer, the web reads the context attribute antialias like the original), still use the stencil (a multisampled stencil half-covers edge pixels, which differs from the pixel center rule). Unbatched draws (swapped-in shaders, shader blending, shader-blended particles) apply the same rectangle as a scissor, and run_external_pass writes the shader clips to the stencil for its duration. (2) One batch binds several textures (the smaller of the device MAX_TEXTURE_IMAGE_UNITS and 16), so the batch continues while images, shapes (white texture) and text textures alternate (the PixiJS scheme). (3) draw_colored_quads (particles, heat haze) also joins the same batch under fixed blending and computes with the same formula as the particle shader. (4) Off-screen culling (is_local_rect_visible) also checks the bounding box of the active clip, so components of rows outside a scroll view are not drawn (like Unity RectMask2D, automatic with no option). The DevTools inspector shows isDrawnInsideContent of UIView, UIButton, UIProgressView and UISlider in the same place as the original. The batch vertex limit is 6 x 8192, the same as the original. Measured (macOS desktop, hidden 1920 x 1080 window, example batchclip, every pixel identical to before): a settings-window-like scene (one window, a UIScrollView, 50 rows, each with text, a button and a shape) went from 45 draw calls to 1, and the same scene as the original tests/core/batchclipchrome.test.mjs from 51 to 14 (every pixel identical to the stencil path drawn with a 1e-9 radian rotation).
- Shadow and toast argument forms (same as the original): ShadowText::set_shadow and ShadowImage::set_shadow take the opacity separately like the original setShadow(color, opacity, offset, blur) (the color's alpha is ignored). ToastMotion::new() takes no arguments like the original new ToastMotion() (enters from the top, change it with set_enter_side), and show(text, stay seconds, apply function) takes a FnOnce(&mut ComponentContext) called when the toast starts to enter, like the original show(text, seconds, applyText). set_apply_text_handler and ToastApplyTextHandler are gone (now ToastApplyText).
- No reserved-word names (same names as the original): neither engine uses a reserved word (use, move, loop, in) as a name. Cooldown::r#use is removed in favour of activate (original activate), FullscreenPass::r#use and ShaderProgram::r#use are removed in favour of use_program (original useProgram), PointerGesture::r#move is move_pointer (original movePointer), Action::r#loop is repeat_while (original repeatWhile), and easing_function's r#in, out, in_out are ease_in, ease_out, ease_in_out (original easeIn, easeOut, easeInOut). Easing names in timeline data (such as "quadratic.in") are a data format and stay the same.
- Text antialiasing as a Graphic method (same place as the original Graphic.setTextAntialiasEnabled, isTextAntialiasEnabled): added Graphic::set_text_antialias_enabled(bool), is_text_antialias_enabled(). The original import.js now also exports AudioManager, DevTools (renamed from the original DEVTools), Pane, PaneStyle, PaneTheme and WebSocketClient, so both engines share the same top-level names.
- Matching the two engines (small Rust-side items): the soft disc texture (default particle sprite) is fully opaque up to radius 0.7 and fades out with smoothstep from 0.7 to 1 like the original (it was (1 - distance)^2, so particles were smaller and fainter). Node gizmos draw component gizmos first and then the border and pivot in '#00ff00' with a pivot radius of 4, like the original. BuildInfo quietly moves on when version.json cannot be fetched, like the original (the handle finishes with empty bytes, so it is not in the AssetLoader failed list). The statistics panel (use_statistics) writes engineVersion, platformName, browserName, canvasNativeSize, referenceResolutionSize, viewScaleMode, viewNativeRect, viewSize, input positions, time, framePerSecond, timeDelta, drawCalls, vertices, triangles and culledNodes at 1.4x in 16px DOSGothic, 16 per line, like the original drawStatistics (ViewScaleMode::get_name gives the original value text such as "stretchShort"). format_number and format_number_with_unit check the language tag in the same order as Chrome (V8 CanonicalizeLanguageTag, ECMA-402 IsStructurallyValidLanguageTag), and an invalid tag ("EN_gb", an empty string, "en-u" and so on) is Err(FormatError::InvalidLanguageTag) like the original RangeError (the error text matches Chrome too, 77 tags checked against node). Capture mode (VANILLA_CAPTURE_*, ?capture on the web) advances time by 1/60 s per frame for deterministic captures (the same arithmetic as the original ?capture, and the time at frame 30 is bit-identical to Chrome. The Chrome comparison also takes the same frame number through the original capture mode. The 0.3 s after scene loading is real time, like the original setTimeout). SpriteAnimator::find_sprite (the original findSprite, remembers the NodeId of the node holding the Sprite). UIDocument to_json_text and serialize_node are single functions like the original toJsonText and serializeNode and read &mut self getters too. UISceneBase::get_dev_tools and get_dev_tools_mut (the original UIScene.getDevTools). The draft tilemap shares tilesets like the original (Rc<Tileset>, do not modify after adding)
- Logic numbers are f64 (same as the original JavaScript number; like Unreal 5's large world coordinates, the CPU is f64 and the GPU is f32): all of the engine's logic arithmetic is f64. The components of Vector2, Vector3, Quaternion, TransformMatrix, Rect, OBB, Pivot and Color, base::math, tweens and easing, timelines, actions, animators, particles, node transforms and UI resolution, cameras, input coordinates, time (elapsed time, time_delta), sound volume and playback position, 3D transforms and skeleton arithmetic, reflection values and UIDocument numbers are f64. f32 stays only where the original uses Float32Array, Math.fround or WebAudio float: vertices, indices and uniform arrays going to the GPU (Graphic's vertex buffer, ToonMeshArrays, toon instance data, joint matrices, morph weights), the elements of Matrix4 (stored as f32 like the original, calculated per element in f64 and stored as f32), sound samples, the mixer and AudioParam values (Chrome WebAudio float), glyph raster and the inside of Canvas2D (Skia float), image decoders and color management. The drawing functions narrow to f32 when they put into a vertex buffer and when they upload uniforms. The last digits that differed from the original because of f32 arithmetic now match (a timeline color at 1 second is the same #80007fc0 as the original, 0.2 no longer becomes 0.20000000298023224 in a UIDocument round trip, the Gaussian sum of a blurred shadow is f64 like the original). The experimental physics world's advance now runs holding a FixedStepper like the original (before, the same arithmetic was kept separately inside the world). FixedStepper::get_alpha means the same as the original Math.max(0, Math.min(1, ratio)) (-0 becomes +0).
- Web dialogs and web context menu: matching the original, which moved to engine dialogs and engine menus, the Rust web build no longer uses the browser window.alert, confirm, prompt or the DOM context menu. It draws on the canvas the same engine dialog as the desktop (Chrome tab modal style; the scene and async tasks pause while it is open; Enter confirms, Escape cancels) and the engine context menu (UIInputFieldContextMenu). Text in the prompt field is received by a hidden DOM input, like the original (IME). Right-clicking a field or an engine menu blocks the browser menu. Browser UI text is chosen from the 82 Chromium translation locales by navigator.languages
- Reflection cannot be left out (every component is reflected, like the original): Reflect is now a supertrait of Component. The one way to make a component is #[vanilla::reflect], and leaving out either the impl block or the impl Component block gives a compile error that points at where to add it. Engine components that were missing it (the drafts RigidBody2D, Tilemap, AudioSource2D, AudioListener2D, Skeleton2DAnimator, plus UIInputFieldQuickMenu, the three web pane components, and the tree's placeholder) all have it now. The UI document writes every unregistered component by reflection like the original, and the developer tools inspector shows the getters of every component. (The "no reflection" line, the saved-key fallback, and the warning that dropped components without reflection are gone) The five enums of the draft Tilemap (orientation, stagger axis and index, render order and mode) are reflected as the original strings. The UI document output (keys, order, values) of the five draft types was compared and matches the original.
- GameScene loading and touch recognizer (the same in both engines): both engines measure the minimum loading time with the engine clock (get_realtime_since_startup), and if the engine clock has not started yet (before the first frame) they measure from the first loading screen frame. A press on the loading screen is read from engine input (is_touch_pressed) by draw_on_load. The TouchRecognizer is created in initialize like the original.
- Developer tools memory fields (desktop): the jsHeapSizeLimit field shows the upper bound the operating system allows for this process's heap. (platform::desktop::read_heap_size_limit: on macOS and Linux RLIMIT_DATA if set, otherwise physical memory; on Windows the smaller of physical memory and virtual address size from GlobalMemoryStatusEx) In both engines, all three fields are "(N/A)" if the heap cannot be read, and only that field if just the limit cannot be read.
- Desktop Pane canvas tag: where the original tools put the preview engine's canvas (the canvas element in uieditor and particleeditor), the render target's screen is drawn. Draw the preview scene into a render target and pass it with PaneElement::set_canvas_texture, and it is stretched over the element's inner box (calculate_canvas_box_size, where the original canvas has clientWidth, clientHeight). The same scene (a canvas in an rgb(16, 17, 20) box with vanilla at top left and red at bottom right) was captured in Chrome and on the desktop, and the position, orientation and colors matched. The original keeps its DOM canvas, so nothing changed there
- Opacity layer (group opacity like CSS opacity): Graphic's begin_opacity_layer and end_opacity_layer (the original beginOpacityLayer, endOpacityLayer) gather what is drawn between them in a screen-sized buffer and lay it down at once with the current global alpha. A node with set_opacity_layer(true) (the original setOpacityLayer) and opacity below 1 is drawn with its descendants as a layer, so overlapping children do not show through each other (the same as Chrome CSS opacity). Clips (Mask) inside the layer still work and layers can be nested. Both engines are the same. Desktop Pane elements read CSS opacity and draw it with this layer. The same scene (red and blue boxes overlapping, grouped at opacity 0.5) was captured in Chrome and on the desktop, and the overlap color matched (19, 19, 146)
- Glyph raster (Windows and Linux desktop): painted like Chrome. Windows paints with DirectWrite using the same settings as Skia's SkScalerContext_DW (on a machine with ClearType on, Chrome keeps text as LCD so kGenA8FromLCD applies on the canvas, so it uses the average of the three channels of a ClearType 3x1 texture; with it off, grayscale A8; grid fitting, rendering mode chosen by the gasp table, size, bytecode hints and bitmap fonts; fake italics through the glyph matrix), and contrast and gamma are the DirectWrite rendering values only when the primary display has the Avalon.Graphics registry key like Chrome 158, otherwise contrast 1 and sRGB pre-correction. Linux follows Chrome 158, which draws system fonts and ordinary web fonts with Skia Fontations (skrifa) instead of FreeType: it applies the same hinting from fontconfig's hintstyle to skrifa outlines (Light with glyf auto-hinting for slight, Normal with auto-hinting fallback for medium, Strong for fonts that require hinting) and pre-corrects with gamma 1.2 and contrast 0.2. Both use 1/4 pixel subpixel positions like the Mac. CI compares a text scene (examples/glyphparity.rs) with Chrome 158 on the same machine.
- Audio thread priority (desktop): turned off cpal's realtime feature (audio_thread_priority, MPL-2.0) and, on the first call of the output callback thread, sets what Chrome's kRealtimeAudio does with operating system APIs (platform/audio/threadpriority.rs). Windows uses THREAD_PRIORITY_TIME_CRITICAL and MMCSS "Pro Audio" (AVRT_PRIORITY_CRITICAL, restored when the thread ends; was "Audio") like Chrome's wasapi_render_thread; Linux uses SCHED_RR priority 8 and nice -10 if that fails like Chrome's SetThreadTypeLinux (before, with no dbus feature, it did nothing); on the Mac the CoreAudio IO thread already has a time-constraint policy so it is left alone, and other threads get Chrome's SetPriorityRealtimeAudio three settings (timeshare 0, importance 63, time constraint of the buffer period). audio_thread_priority left the dependencies.
- Desktop Engine::new builds the graphics: like the original Engine constructor, get_graphic exists right after the engine is created. It builds the event loop on the main thread, creates the window hidden with that loop, builds the GL context and Graphic, and run shows the same window (hidden in capture mode) and draws as is. Textures, render targets and shaders built before run are used as they are. On machines that cannot build GL (CI without a display) and off the main thread (unit tests), it is built when run opens the window as before.
- JPEG decoding (desktop, and Image::load_from_memory on the web): decoded with a decoder written in the engine (core/jpegimage.rs) instead of the image crate (zune-jpeg). It follows the arithmetic Chrome 158's libjpeg-turbo 3.1.0 and Blink's JPEGImageDecoder choose (JDCT_ISLOW integer inverse DCT, smooth chroma upsampling h2v1, h1v2, h2v2, the 16-bit YCbCr tables of jdcolor.c, choosing the color space from component ids and the JFIF and Adobe markers), and matches Chrome WebGL texImage2D bit for bit on 51 test images (4:4:4, 4:2:2, 4:2:0, 4:4:0, 4:1:1, mixed ratios, progressive, restart, gray, RGB, CMYK, YCCK, ICC, EXIF orientation, lossless, small 1x1 to 33x18 images; before, up to 2 to 5 levels off). Lossless (SOF3) is newly decoded, and EXIF orientation is applied like Chrome (6 and 8 swap width and height). The CMYK ICC profile of a CMYK JPEG is converted like skcms. What Chrome cannot decode (12-bit, arithmetic coding, gray and YCbCr lossless, incomplete files with truncated data, no EOI or no remaining scan) is a transparent image with only the size read (Chrome fails to upload with INVALID_VALUE in WebGL texImage2D after onload; before, part was decoded or it failed). Chrome Canvas2D draws an incomplete file as far as it was received, which differs from that. JPEG inside SVG and in mouse pointer images use the same decoder. The jpeg feature of the image crate is off.
- Input field context menu: right-clicking a direct-touch field (set_use_direct_touch) now opens the same engine context menu as other fields. In both engines it has four items like the original: cut, copy, paste, plus select all (when there is text), and the original also blocks the browser edit-field menu on direct-touch fields. The Chrome edit-field menu that desktop drew separately (undo, redo, paste as plain text, emoji, writing direction, inspect) is gone. The long-press quick menu stays, and when there is nothing selected or to paste, and for "...", it opens the engine context menu
- Line breaking in multi-line input fields: desktop and the web canvas mode use the same algorithm. Like a Chrome textarea, it applies Blink's line breaking (the LazyLineBreakIterator fast table: ASCII pairs break only before opening brackets and after '-' and '?', a digit after '-' only when the character before is alphanumeric, Latin-1 pairs take the two-character ICU value) on top of the ICU4X LineSegmenter dictionary build at normal strictness (breaks before small kana and the prolonged sound mark). The break positions of 30 texts taken from a Chrome 158 textarea (English, URLs, punctuation, Korean, Japanese, Chinese, Thai, Russian, Latin-1) all match. (Until now desktop used plain strict UAX #14, which differed from Chrome after '/' and before small kana, and the web canvas mode approximated with word boundaries) icu_segmenter is now also a web dependency
- Component lookup: get_component, get_components, has_component, get_or_add_component, remove_component and NodeTree.with_component_mut also find embedded base types, like the original instanceof. Component::get_base_component(_mut) reports the embedded base (the original superclass), so ShaderSprite is found as Sprite and Paint, UIButton as UIControl and UIView, RichText as Text. (also Sprite, UIControl, UIDraggable, UISlider, UIToggleButton, UIScrollView, UISnapScrollView, UIImageView, UIProgressView, UILabel) `dyn Component` gets is_instance_of and as_instance_of(_mut).
- DevTools: the tree Type column and the inspector type are the node type name (FloatingText, UIWindow and so on), like the original constructor.name. Adds UIDocument.get_node_type_name(node). The document DevTools holds at first calls register_editor_types.
- DevTools inspector: property values that point to a node (such as UIHitArea.targetNode) show that node's type name ([FloatingText], [UILabel] and so on) like the original constructor.name (always [WorldNode] until now). Document values of components without reflection also round numbers like the original toFixed (0.125 → 0.13).
- Action: the names now pair with the original. The form that holds the target is start(node_tree, Some(node_id)), step(node_tree, time_delta) and get_target() (the original start(target), step(timeDelta), getTarget), and start(node_tree, None) restarts with the previous target like the original start(). The form that passes the target every time without holding it is start_with(&mut target), step_with(&mut target, time_delta), and the original gained the same startWith(target), stepWith(target, timeDelta). The inner actions of repeat, forever and loop run in this form in both engines and do not hold the target.
- Animator.get_parameters(): returns the names and AnimatorParameter (Float, Int, Bool, Trigger) in first insertion order, like the original getParameters. AnimatorParameter is public.
- FloatingText: draws the label with UILabel like the original. (same settings: text, size, color, bold)
- FloatingText::create: like the original constructor, puts the FloatingText node's pivot and anchor at the top-left. spawn's world position is relative to the parent's top-left, so labels appear at the same place as the original (until now the anchor was the center, so they were pushed by half the parent size). Captured both engines with the same settings and saw a pixel difference of 0.
- JSON writing: every engine path that writes JSON (LocalStorage.set_json, PersistedStore, UIDocument.to_json_text, WebSocketClient.send, DevTools settings, the draft save) writes text identical to the original JSON.stringify down to the character through the single storagetext::stringify_json. Numbers use the original String(number) form (1.0 → 1, 1e21 → 1e+21, 1e16 → 10000000000000000), and object entries put array-index-like names first like an original JS object. The indented form is stringify_json_with_space (the original JSON.stringify(value, null, space)) and text quoting is quote_json_text. JSON reading turns on serde_json's float_roundtrip and reads the nearest number like the original JSON.parse (123456789012345680000 used to be off by one digit).
- TouchEffect: bakes the particle gradient with the engine Canvas2D radial gradient (create_radial_gradient, fill_rect) like the original. All 64x64 alpha values match the same canvas code in headless Chrome.
- PersistedStore: get_string_code_units(path) and set_string_code_units(path, code_units) read and write a string in the state as JS code units (UTF-16). A lone surrogate saved by the original comes back exactly as the original string. (the same form as LocalStorage *_code_units)
- Shader build failure: when ShaderSprite or ScreenEffect fails to build, the original now reports once and skips like the Rust engine. (the original used to stop the frame with an exception) Both engines are the same.
- Fallback font choice (desktop) like Chrome FontCache::PlatformFallbackFontForCharacter: the 217 measureText strings are identical on Mac Chrome 158 (arm64, Rosetta x86_64), Windows Chrome 158 and Linux Chrome 158. (Before, Mac 144, Windows 181, Linux 216)
  - The default font chain (the original SYSTEM_FONT_STRING) follows only when the default font name default was asked for. With another name such as "16px Arial", it goes to the operating system fallback without the chain. (The original also uses that chain as the font string only for the default font)
  - Fallback is asked separately per first font (the first face that has a space glyph) and per font string, and the fallback face draws only the characters the operating system chose that face for. When bold is asked for, the bold faces (Helvetica-Bold in Helvetica.ttc, GeezaPro-Bold, tahomabd.ttf on Windows) are read separately too, and on Mac and Windows the fallback faces are grouped by the family name in the font name table to pick the weight. (Tahoma, which has a different file per weight, also becomes Tahoma Bold for bold) Linux, like Chrome, asks fontconfig without weight and slant and uses the chosen file as is, drawing fake bold and fake italic, and for bold or italic it looks at the regular face of the first name first. (Bold Arabic is fake bold of DejaVuSans.ttf)
  - Even when a face in the name list lacks the composed character (ï), if it has the canonically decomposed characters (i, U+0308), it draws with that face like HarfBuzz. (decompose_character was added to third_party/rustybuzz)
  - Mac: asks CTFontCreateForString on the CTFont of the first font (an uploaded font is one built from bytes), and picks again from the same name when the traits or weight differ. (Until now it asked the system UI font, so Arabic was drawn with another font)
  - Windows: for bold or italic, the regular face of the first name, then the Blink font_fallback_win.cc blocks and per-character tables (Thai Tahoma, monospace Arabic Courier New, Han characters by the UI language), the wide font list, and a DirectWrite order based on the first name. (Until now it asked only DirectWrite based on Segoe UI, so Thai was Leelawadee UI)
  - Text whose characters are all U+00FF or below is shaped as Latin like Chrome (the 8-bit text path of HarfBuzzShaper). Words with only Common characters, such as digits, also use the font's latn features. (Linux Norasi has digit kerning only in DFLT, so 16px "0123456789" was 3.8px narrower)
  - The web is the same: the original SYSTEM_FONT_STRING at the end of the font list handed to the browser is appended only when default was asked for.
- YUV to RGB conversion of AVIF (desktop) like Chrome 158 (CrabbyAvif crabby_avifImageYUVToRGB, libyuv, called by AVIFImageDecoder): the forms libyuv accepts (BT.601, unspecified, BT.709, BT.2020 NCL, chroma NCL matrices at 8, 10 and 12 bits) use libyuv's integer arithmetic (YuvPixel, YPixel, doubled chroma upsampling), and everything else uses libavif's float arithmetic (changed to divide per value and then mix chroma). High bit depths are stored as 16 bits like Chrome WebGL and decoded as half precision with the mantissa truncated like libyuv HalfFloatPlane. Alpha is decoded as straight alpha and multiplied with rounding. 19 test images match Chrome 158 WebGL texImage2D bit for bit (before, libavif's float arithmetic was 1 to 23 levels off). Picture pixels change by a level or two.
- FBX multiple materials: an FBX mesh with several materials (the Materials of LayerElementMaterial, MappingInformationType ByPolygon or AllSame) is split into partial meshes by each polygon's material index and drawn as one drawable per material. (three.js FBXLoader groups, Unity and Unreal submeshes) Until now the material index was looked up by polygon vertex order instead of polygon order, and each mesh was drawn with only the first material of its owning node, so the Quaternius mannequin (M_Main, M_Joints) was all orange. New SkinnedModel::split_fbx_corners_by_material and FbxCornerArrays; the FBX MeshDescription and the drawable's material_name are the FBX Material name (like glb), FbxMaterial.name. Same as the original. Unit tests multiple_materials_split_by_polygon and mannequin_fbx_materials_from_examples (the same triangle counts as the original, 5732 and 8012). The doc images model-viewer, and effect-gallery, shader-sprite and screen-effect after the shader hash change, were captured again (same size, cwebp -q 85).
- SceneBase.set_touch_dispatch_enabled(is_enabled), is_touch_dispatch_enabled(): turns off the scene's default touch passing, like the original Scene.setTouchRaycaster(null) (and the new setTouchDispatchEnabled). When off, tick_touch does not pass press, move, release or wheel to nodes (nor call the first touch callback), and only the scene's touch hooks are called, so the hooks can intercept and pass touches directly.
- SpriteAnimator.play: the default form takes the node and puts the first frame into the Sprite right away, like the original play: SpriteAnimator::play(&mut node, clip_name, options) (formerly play_on_node). The old play(&mut self, ...) that took only the animator is now play_clip, for when there is no node (inside the complete callback). After the complete callback the frame goes in during the same tick, so it changes right away.
- GamepadManager: get_all_connected_gamepads and get_connected_gamepad read in place when called, like the original navigator.getGamepads() (desktop drains the gilrs events for the current state and hands connects and disconnects to the next update, the web calls navigator.getGamepads()). Reading takes &self and returns copies read in place (Vec<Gamepad>, Option<Gamepad>, a copy of that moment like the original). gilrs is created on the first call (update, vibration or list read), so vibrate before the first tick also rumbles on desktop. A manager fed with update_all_gamepads_with_list returns the list it was given.
- Dropping an AudioPlayer: dropping the player no longer stops what it is playing. Like a WebAudio source node in the original, the sound plays to the end. On desktop the mixer keeps the player node (and the bus node it outputs to) until the source ends and then removes them. On the web, onended is replaced with a self-releasing callback, the source plays to the end and the GainNode is disconnected afterwards. A play that was waiting for the context to resume still starts after the resume, as in the original. (until now dropping stopped the sound)
- Sine, cosine, tangent: math::sin, cos and tan and the tween easings (sinusoidal, elastic) no longer use the system libm. They compute what Chrome's Math.sin, cos and tan compute (correctly rounded f64, src/base/trigonometry.rs: Payne-Hanek reduction with a 2/π bit table and a double-double series, no fma) and store the result in f32. Over 22,000 inputs sin, cos and tan matched Chrome 158 bit for bit. (The macOS system libm differed in 896 sin and 8,719 tan results) The system libm gave different last digits on macOS, Windows, Linux and wasm. math::tan now computes the tangent directly instead of sin / cos. It is slower than the standard functions (about 0.5 microseconds per call).
- Shader hash: hash21 (ScreenEffect, ShaderSprite) and hashPoint (toon VFX) became integer hashes that mix the float bits with the fmix32 finalizer of MurmurHash3 (Austin Appleby, public domain), same arithmetic as the original. The patterns of film grain, glitch, value noise and toon VFX noise change.
- Human skin environment BRDF: uses a formula the engine fitted by computing the split sum integral directly instead of the Karis approximation (same coefficients as the original, RMS error 0.071, 0.029 to 0.002, 0.006). Environment reflection changes.
- Images (desktop): embedded color profiles are converted to sRGB like Chrome. PNG cICP, iCCP, sRGB, gAMA and cHRM, JPEG APP2 ICC, WebP ICCP, AVIF colr (ICC, nclx primaries and transfer, PQ, HLG). ICC is read like Skia's Rust parser (para, curv, mft1, mft2, mAB, mBA, cicp), color space choice follows Chrome skia/ext/color_profile.cc and SkColorSpace, and conversion follows skcms and SkColorSpaceXformSteps (core/colorprofile.rs; the new direct dependency png 0.18 is the same version image already uses). 31 PNG and WebP test images match Chrome 158 WebGL texImage2D bit for bit. AVIF differs by a level or two because of the YUV to RGB arithmetic (Chrome uses libyuv), a few levels with a profile attached, and JPEG by a level or two because of decoder differences. 3D materials are not converted, like the original createImageBitmap (colorSpaceConversion "none"). (Until now no color profile was applied.)
- Animated AVIF (desktop): like Chrome (CrabbyAvif), the first frame of the track for the major brand avis and the primary image item for avif are decoded, and files with only a track are decoded too. Chrome always uses the first frame in drawImage and texImage2D (bitmap_image.cc ImageForDefaultFrame, image_extractor.cc) so it does not animate. (Until now an avis file decoded the primary image item, which could give a different frame from Chrome, and a file with only a track could not be decoded.) An AVIF with nclx transfer characteristics 9, 10, 11 or 12 cannot be decoded, like Chrome.
- Glyph positions (desktop): calculated at the 16.16 fixed point scale of the font size like Chrome HarfBuzz (Blink HarfBuzzFace::GetScaledFont, SkiaScalarToHarfBuzzPosition). Font unit values use em_scale, variable GPOS deltas em_scalef, rounded at that scale; axis values are normalized in 16.16 like HarfBuzz hb_ot_var_normalize_coords, avar is mapped in floating point and reduced to 2.14, and trak tracking is rounded with em_scalef_x. 222 of 228 strings (three texts at weights 300, 400, 700 and italic, Mac SFNS (system-ui) 8 to 128px) match Chrome 158 measureText to the last digit and the rest are within 6.1e-5px. (Before, "AVATAR Type Wolf" at weight 300 128px differed by up to 0.093px.)
  - rustybuzz 0.20.1 has no scale, so a build with Face::set_scale and HarfBuzz-style axis normalization is in third_party/rustybuzz, and a corrected ttf-parser 0.25.1 (which read the device table of pair kerning, PairPos format 1, 2 bytes off) is in third_party/ttf-parser, both depended on by path. A game that fetches by git gets them too. There is no new crate.
- Font choice (desktop, Mac): italic system-ui and BlinkMacSystemFont use the SF italic font (SFNSItalic) like Chrome MatchSystemUIFont. (Until now it was fake italic on upright SFNS, 0.7px narrower at 13px and 7.4px at 48px.)
- Font names (desktop): like Chrome, a quoted generic name ('monospace', 'serif', 'system-ui') is not turned into the default font table; the font of that name and the uploaded face (FontFace) are looked up. The Mac has no font of that name so it is the next name or the standard font, and 'system-ui' is the system UI font like Mac Chrome FontCache. An unquoted generic name does not look up uploaded faces. -webkit-body is the standard font, and if the last generic name in the list is -webkit-body, even a name with no uploaded face is the standard font. The Mac finds BlinkMacSystemFont among the faces uploaded under the name system-ui. (Blink style_builder_converter.cc ConvertFontFamily, css_font_selector.cc GetFontData, font_selector.cc FamilyNameFromSettings, 24 strings measured on Mac Chrome 158.) The web also passes quoted generic names to the browser with their quotes. (Until now the quotes were stripped and they became generic names.)
- Desktop text ascent and descent (TextMetrics font_ascent, font_descent, and the top, middle and bottom baseline positions) like the Chrome canvas: like Blink FontMetrics::AscentDescentWithHacks, the operating system's vertical values (Linux typo if USE_TYPO_METRICS else hhea, Mac hhea, Windows OS/2 win values unless USE_TYPO_METRICS) are each rounded, and only small fonts (ascent under 3px or ascent + descent under 2px) are not rounded (the canvas's subpixel_ascent_descent). The Mac adds 15% to the ascent of Times, Helvetica and Courier (the same table as line height). Until now hhea values were not rounded, so they differed from Windows and Linux Chrome by up to 0.27px, and Windows Consolas by 3.1px. (Checked with CI's Windows and Linux Chrome 157 measureText.)
- Desktop font choice: when no face is found in the name list of a font string (an uninstalled name, or a generic name with no default font such as Linux cursive and fantasy), the first font is the screen language's standard font like Chrome (-webkit-standard; Times New Roman for Windows and Linux English). Until now the sans-serif of the default font chain (the original SYSTEM_FONT_STRING) came first, so widths differed from Windows and Linux Chrome. The name default is still the default font.
- Desktop bitmap color fonts (CBDT such as Noto Color Emoji): the advance is the integer advance in the glyph metrics of the strike converted to a ratio of the font size, like Linux Chrome (FreeType and Skia), and the actual bounding box (actual_bounding_box_*) is the picture box moved and widened to outer integers. Until now hmtx was converted directly so one 16px emoji was 0.04px narrower than Chrome and the box was 0. (colorglyph::read_bitmap_glyph_advance, read_bitmap_glyph_bounds, LoadedFont::is_bitmap_only_font)
- Desktop emoji face choice in Chrome FontFallbackIterator order: a face in the name list is used first if it has the glyph regardless of color (Linux Chrome 157 draws the 😀 of "16px DejaVu Sans" in black and white), a sequence with a variation selector (❤️) accepts only faces that fit that presentation, and a color glyph face is preferred only at the operating system fallback stage. Until now a color face was preferred anywhere in the list. FontFaceDescriptors gained is_system_fallback (whether it is a face of the operating system fallback font, default false).
- Linux touch detection: reading X11 input devices (XIQueryVersion) is serialized so one thread at a time does it. libXi builds its extension info table without locking, so when several threads created an InputManager (in tests) it crashed with SIGSEGV in libXext's XextAddDisplay. (Confirmed with gdb on CI Linux.)
- Desktop shape edges: asks for multisample 4 in the window's GL configuration. (Chrome paints the original WebGL context's default antialias with min(4, GL_MAX_SAMPLES) samples of MSAA, Blink DrawingBuffer.) Mac CGL gives only configurations without multisample unless asked, so the edges of circles, rounded rectangles and lines were stair-stepped. If there is no configuration of 4 or more it picks again without asking and uses the closest to 4. On the Mac the number of differing pixels at shape edges of the same scene dropped from 1894 to 897 (what remains is the share where the sample positions are flipped vertically, ARCHITECTURE chapter 10).
- Mac desktop glyph raster like Chrome: every non-color glyph is painted by CoreText in the same way as Chrome Mac Canvas2D (Blink FontPlatformData::CreateSkFont's kSubpixelAntiAlias and subpixel positions, kUnknown_SkPixelGeometry on a transparent canvas, Skia SkScalerContext_Mac's A8-from-LCD: paint on white RGB with font smoothing on, undo CoreGraphics gamma 2 and apply brightness through a gamma pre-correction table, the table being Chrome Mac's sRGB with contrast 0, and 1/2 of the text color when font smoothing is gray). Glyph positions add 1/8 to x and round down like Skia, and pass the rest to CoreText in 1/4 pixel units. Overlapping glyphs are layered on top like the canvas (they used to take the larger value). Fake italics are drawn with the slant of the CoreText text matrix. Fonts uploaded as bytes are also built with CoreText. On the Mac the differing pixels of text in the same scene (10 to 48px text, serif, bold, italic, Korean, emoji, fractional positions, white and dark backgrounds) went from 59438 to 0.
  - TextStringTextureCache: rasterize_text_with_color (a raster told the text color, used by the original's ShadowText, which bakes the text color as is, and by 2D canvas fillText) and textshaping::rasterize_glyph_at (glyph raster at a subpixel position and text color).
- Engine: the graphic is usable anywhere. Engine holds Graphic instead of EngineRunner, and like the original getGraphic, GL resources (textures, render targets, shader programs, toon renderers and the like) are built with engine.get_graphic(), get_graphic_mut() in a scene's create, initialize and tick, a component's tick (context.get_engine()), and the first segment of an async task and the lines after an await. (Until now the graphic was received only as the graphic argument in draw functions) Draw functions take the graphic argument as before. It is the engine's graphic taken out for a moment with Option::take and passed in, so inside them engine.get_graphic() is None and the graphic argument is used. (Neither RefCell nor unsafe is used, so there is no way to blow up with a double borrow) To use the engine and the graphic together as &mut outside drawing, use the new engine.with_graphic(|engine, graphic| ...)
  - EngineContext::with_graphic, SceneContext::with_graphic also give the graphic in the first segment at the spawn site. (Until now None) Only the first segment of a task spawned inside a draw function is None, because that is while the engine has lent the graphic to that function
  - DevTools: forcing all gizmos visible (the original setForceGizmosVisible) is applied to the engine's graphic at the end of tick. Like the original, it shows from the drawing of the same frame in which F2 or the Settings checkbox was pressed. (Until now it was applied in the draw of post_draw, one frame late)
  - Examples: toonstyle and toonmaterial build GL resources in create, like the original constructors, and oldface and modelviewer build them in initialize after all assets are received. The guide's DynamicFont example also bakes once in initialize, like the original
- ToonRenderer::create_mesh: if building a GL buffer or vertex array fails, deletes the buffers and vertex arrays built so far and returns None. (Until now the ones built earlier were left behind and leaked) For the vertex array bound together with the instance buffer too, if the outline side cannot be built, the body side is deleted. (In the original, Chrome's createBuffer, createVertexArray always return an object, so there is no path that fails midway)
- FbxLoader: strips the binary FBX type suffix ("\u{0}\u{1}Model", "\u{0}\u{1}AnimStack") from the name of nodes (Model) and animation stacks. Clip names are "Take 001", not "Take 001\u{0}\u{1}AnimStack", and bone names are "mixamorig:Hips". (three.js FBXLoader cuts at the first null byte in BinaryReader.getString, and Assimp changes it to "AnimStack::Take 001" and then FBXConverter strips "AnimStack::", "Model::"; the original was changed too) Bone name matching when adding FBX animations to a model read from glTF (add_animations_from_fbx_*) also matches with these names.
- tools/apidoc: grouping modules reachable from outside through a pub mod chain (modules that hold modules below them, such as vanilla::experimental, experimental::tilemap) keep their module description and examples in the data even without items. (In place of experimental/experimental in the original's data; the crate root lib.rs is left out, like the original) Grouping modules are not counted as modules without examples. Removed the Korean text from the draft example code (physics 2D, save slots, pannermath).
- Folders: moved the mature features the original vanilla.js had in src/experimental to their proper places, so the folders of the two engines are now the same. The Rust version already had them in these places, and module paths (such as vanilla::graphics3d) are unchanged. In the original, games that used import.js are unaffected, and games that imported by file path directly switch to the new paths. Fixed the original paths in the file header comments and ARCHITECTURE chapter 9 to the new paths. (Old path in the original → new path)
  - src/experimental/graphics/*.js (3D) → src/graphics3d/*.js (Rust graphics3d/)
  - src/experimental/graphics/toon/*.js (toon 3D) → src/graphics3d/toon/*.js (Rust graphics3d/toon/)
  - src/experimental/graphics/fullscreenpass.js → src/core/fullscreenpass.js (Rust core/fullscreenpass.rs)
  - src/experimental/animation/animator.js, timeline.js, src/experimental/action.js → src/animation/ (Rust animation/)
  - src/experimental/indicator.js, visual/visual.js → src/misc/ (Rust misc/)
  - src/experimental/bunchasset.js, visual/visualasset.js → src/resource/ (Rust resource/)
  - src/experimental/collection/*.js → src/base/collection/*.js (not in Rust, since the standard Vec, HashMap and the like handle it)
  - src/experimental/camera.js → src/deprecated/camera.js (deprecated in the original too; not in Rust, since Camera2D covers it)
  - src/experimental/aabb.js, transform2d.js, graphics/gl2d.js, graphics/webgl2.js (dead code) → src/deprecated/ (not in Rust)
- UIInputField word movement and deletion: like the original, Ctrl on Windows and Linux and Option on Mac together with Left, Right (extending the selection when combined with Shift), Backspace, Delete move and delete by word. (On Mac also Option + Ctrl + Backspace, B, F from the key bindings) Positions follow Blink NextWordPosition, PreviousWordPosition: Right goes to the start of the next word only on Windows (the end of the current word on Mac and Linux), on Mac a selection being extended does not cross its anchor, and in multi-line fields, like Chrome textarea, it does not cross to the previous line at the start of a line that has characters. If there is a selection, only the selection is deleted as its own undo group, and word deletion opens a new group that following deletions and character insertions join. (Same as 2309 positions measured in a headless Chrome 158 textarea)
- Added WordLeft, WordRight, DeleteWordBackward, DeleteWordForward to TextInputKey. Added DeleteWordBackward, DeleteWordForward to TextEditKind. (Code that matches TextInputKey, TextEditKind exhaustively adds the new arms)
- Added collect_word_boundaries, find_next_word_position, find_previous_word_position to core::textinput. Word boundaries, like Chrome, join across a period only between digits and do not join across a colon. (Chromium ICU wordbrk.patch) Desktop double-click word selection also uses these boundaries. (Double-clicking "www.example.com" used to select it whole; now, like Chrome, only the clicked piece)
- Text line-wrap word splitting (desktop): splits at periods (except between digits) and colons, like Chrome's ICU. ("www.example.com" used to be one chunk that could not wrap; matches the values measured with the original splitWords in Chrome; on the web the browser splits)
- Platform::get_safe_area_rect: clamps width and height to 0 or more. area_size is a size in CSS pixels. (Same as the original getSafeAreaRect fixed to CSS pixels)
- UIDocument: reading an unregistered node type reads it as a WorldNode and emits a warning. (Like components, in the original too) The original gained registerEditorTypes and filling in what the constructor created when reading again, so document reading in the two engines is the same
- Color: to_rgba_string, to_hex_string clamp components to 0 ~ 255 and the rgba alpha to 0 ~ 1 when writing. (Same as the original toByteComponent; previously 1.5 became "17f") Stored components are not clamped, like the original. (HDR colors) create_from_rgba reads the same things as the regex of the original createFromRGBA. (Starts with rgb, integer r, g, b, alpha like parseFloat; also fixed a panic on text with reversed parentheses such as ")(")
- RenderTarget::new, resize: if a GL object cannot be created midway, deletes what was built so far and sets the size to 0. (It leaked)
- Graphic.draw_polyline, draw_line, draw_line_loop, draw_convex_polygon: when the vertex buffer fills up, draws what has accumulated and keeps writing. Previously segments from the 683rd on (triangles from the 1366th on for convex polygons) were dropped.
- AudioPlayer.get_time: while playing, advances with the audio context clock (web currentTime, desktop mixer clock). Multiplies by the playback rate, wraps around by the length when looping, and otherwise stops at the length. When stopped or finished, it is the start position from set_time. (Same as the original)
- Web: key, mouse, finger and page events no longer halt when they re-enter within a frame (dispatchEvent, focus() and the like in game code). Previously keydown, keyup, blur borrowed the RefCell again and wasm halted with unreachable, and mouse, finger and page events dropped that event (dropping mouseup left the button stuck pressed). If the borrow is available right away the event is handled on the spot; if not, it is queued and handled in arrival order at the end of the frame callback. (platform/eventqueue.rs)
- Web: if EngineConfiguration.title is not empty and is not the default ("바닐라엔진", the desktop window title), writes it to the document title (document.title) at startup, like the original.
- ParticleSystem.apply_description: reads imageDataUrl of the description (the data: URL of the image picked in the particle editor) and sets it as the particle image. Desktop decodes it on the spot, and the web draws it once the browser finishes decoding. (null or empty text removes the image)
- FontAsset.load(engine, asset_path): newly added. Like the original load, calls load_font with the file name minus its extension as the family name.
- JsonAsset.load: awaiting the returned handle now ends in failure when JSON parsing fails too. (The rejection of the original JsonAsset.load; a fetch failure was already a failure) How to migrate: code that assumed it ends with Ok even on a parse failure gets Err. Code that does not await and checks with is_finished and get_data (SpriteAtlas and others) is unchanged.
- UISnapScrollView: set_snap_to_nearest, set_velocity_threshold only held values and were not used in the snap calculation. (The original was the same) Now in one-page mode (the default), on release, if the drag velocity is at least set_velocity_threshold (default 200, offset pixels per second), it moves one page in the velocity direction regardless of the dragged distance, and otherwise decides by the set_page_change_threshold ratio as before. set_snap_to_nearest(true) does not clamp to the page range while dragging, and on release goes to the nearest page. Added get_drag_velocity(). (The original getDragVelocity; also added to the inspector expected values inspector_getters.json)
- UILineChart: lowering the cap with set_max_sample_count drops the samples already held, oldest first. (Fixed to match the original)
- DevTools: with Show FPS on in Settings, draws an "FPS <value>" box at the top left of the window even when the panel is closed. (Same as the original, canvas native coordinates, over the panel when the panel is visible)
- UIInputField cursor and deletion: like the original, the Left and Right arrows and Delete work in grapheme clusters (extended grapheme clusters), and Backspace follows Blink BackspaceStateMachine (one code point, with emoji sequences and CR LF as a whole). With a selection, an arrow without Shift collapses to the front or back of the selection. The clicked position lands only on grapheme cluster boundaries. (find_previous_grapheme_boundary, find_next_grapheme_boundary, collect_grapheme_boundaries, find_backward_deletion_boundary, TextEditBuffer::delete_range in core/textinput.rs)
- UIInputField maximum length: insertion, like a Blink input field, inserts the text only up to the remaining UTF-16 length. (Previously the whole value was truncated)
- UIInputField multi-line and Pane line-height normal: instead of 1.2 times the font size, rounds and adds the ascent, descent and line gap of the first font, like Chrome SimpleFontData. (On Linux typo if USE_TYPO_METRICS, otherwise hhea; on Mac hhea with the 15% adjustment for Times, Helvetica, Courier; on Windows the DirectWrite win values. On the web, the line height the browser lays out) Added textstringtexturecache::measure_normal_line_height_without_graphic, LoadedFont::calculate_normal_line_height.
- Mac key bindings: Home, End, like Chrome on Mac, scroll to the start and end while leaving the cursor (to the start and end of the line if there is nothing to scroll), and with Shift select to the start and end of the text. PageUp, PageDown scroll by one screen while leaving the cursor (with Option they move it, with Shift they select), and Ctrl + Left, Right go to the start and end of the line. Added ScrollToDocumentStart, ScrollToDocumentEnd, ScrollPageUp, ScrollPageDown to TextInputKey. (Code that matches TextInputKey adds the new arms)
- UIInputField double and triple click: in fields that emulate DOM input (use_dom_input, multi-line), like Chrome, a mouse double click selects a word (on Windows including the trailing space), a triple click selects a paragraph, and dragging extends by that unit. Consecutive clicks count, like Chrome aura, within 500ms (NSEvent.doubleClickInterval on Mac) and within 2 DIP horizontally and vertically. On the web it is the detail of mousedown. (Added TextInput::set_pointer_click_count, get_pointer_click_count, systemfont::read_double_click_seconds)
- Pane (desktop): reads flex-wrap (wrap, wrap-reverse), flex-flow, align-content, row-gap, column-gap (the two values of gap), white-space and text-overflow: ellipsis. Wrapping collects lines per CSS Flexbox 9.3, 9.4 and stretches them with align-content: stretch. (Same positions as headless Chrome) A wrapping flex with height auto inside a block takes the height of the lines collected at that width.
- Scroll bars of Pane (desktop) and multi-line UIInputField: like Chrome, on Windows and Linux a Fluent bar that takes up space (thickness 15, thin 10, buttons 18, thumb 9); on Mac an overlay thumb if the system setting (NSScroller.preferredScrollerStyle) is overlay bars, or a bar that takes up space (thickness 15, thin 11) if classic. Reads scrollbar-width and the track color of scrollbar-color. (Added read_classic_scrollbar_metrics, calculate_classic_thumb_span in web/pane.rs, systemfont::is_overlay_scrollbar_preferred)
- Animator: completed as a standard state machine, like the original. AnimationState gets set_speed, get_speed, set_loop (Option, None follows the clip), is_loop, get_duration, get_normalized_time, get_frame_index. AnimationTransition gets set_exit_time, get_exit_time, set_duration, get_duration, set_can_transition_to_self, can_transition_to_self, add_condition (name, AnimationConditionMode, threshold), get_conditions, is_exit_time_reached, and a from of None means from any state (Any State). New AnimationConditionMode, AnimationCondition (also exported from lib.rs). Animator gets set_float, get_float, set_integer, get_integer, set_bool, get_bool, set_trigger, reset_trigger, get_trigger, play, find_transition, start_transition, is_condition_satisfied, get_current_state_index, get_current_normalized_time, get_current_frame, is_in_transition, get_next_state_index, get_next_normalized_time, get_next_frame, get_transition_weight. In the same scenario it produces the same state order, weights and frames as the original. How to migrate: set_property, get_property, get_properties (serde_json::Value) are gone. Replace them with set_float, set_integer, set_bool, set_trigger and their getters. get_animation, get_animation_mut (the inner Animation) are gone too. AnimationTransition holds a list of conditions and is no longer Copy.
- Visual: added set_document_text, get_document_text, create_node (UIDocument, node tree). Builds a new node tree from the document and sets the root's local position to location. (Ok(None) if there is no document, Err if the form is wrong)
- SkinnedModel: when an animation FBX has several stacks with channels, each stack becomes a "clip name/stack name" clip. (Fixed in the original too; previously they all had the same name, so play_animation played only the last one)
- Timeline: made public the handler type aliases TimelineEventHandler, TimelineMarkerHandler, TimelineCompleteHandler, TimelineTargetResolver used in public function arguments, and exported them from lib.rs. The name form in the TIMELINE_EASING_NAMES docs is now "<kind>.<in|out|inOut>", matching the actual names.
- ImageTextureCache::get_texture: images whose pixel length is not width x height x 4 are not passed to GL. An image whose pixels another cache released after uploading is read back from that texture and uploaded, and if it cannot be read back either, it is not uploaded and returns None. (An empty array was passed to tex_image_2d along with the width and height, so GL read outside the array)
- Image::create_from_premultiplied_pixels, Image::create_from_pixels: panic if the pixel length is not width x height x 4. (Same as the original ImageData throwing an exception when the length is wrong)
- BloomEffect: if new or set_use_float_color fails midway, deletes the passes and render targets built earlier. A set_use_float_color failure keeps the previous version as is. (GL objects leaked)
- NodeTree::add_component: like the original addComponent, if a dependency component (require) is not on the node, attaches it first through the same path (attach, attach_to_tree). Until now only WorldNode::add_component attached them
- TextStringTextureCache: unregister_font_face, set_font_face_order, get_font_face_count, watch_unresolved_family_characters, take_unresolved_family_characters also strip the surrounding quotes from the name before looking it up, like register_font_face. (Names given with their quotes could not be found)
- ScreenEffect::destroy, HeatHazeEffect::destroy: no longer take graphic. (Same as the original destroy()) They hold a weak handle to the context when first creating GL resources, and release the GL resources themselves on destroy and when dropped (Drop, when the node is removed or the scene is unloaded). How to migrate: `screen_effect.destroy(graphic)` → `screen_effect.destroy()`; the resources are released even if it is not called when unloading the scene. (The public API changes) If ScreenEffect fails midway while building render targets, it deletes what it built earlier
- Renamed to the Rust conventions (Rust API Guidelines C-CASE). Functions, methods, variables, fields and modules are snake_case, enum values are UpperCamelCase, associated constants are SCREAMING_SNAKE_CASE. (setFillColor → set_fill_color, Colors::white → Colors::WHITE, Pivot::topLeft → Pivot::TOP_LEFT, ButtonState::normal → ButtonState::Normal) Removed #![allow(non_snake_case)] and the like, which silenced naming warnings, from lib.rs and the examples. Code that uses the engine must be renamed by the same conventions. (This changes the public API) 11,071 places changed, behavior is the same. (cargo test 252 passed, 0 warnings in desktop and web builds, example screens same as before)
- README: noted that it was verified on macOS (Apple silicon) desktop
- Moves general-purpose features that Exoplanet Miner had built and used separately on the game side into the engine. (The same features added to vanilla.js first, the game's content implementations are not brought over)
- Outline: a component that draws only the border. Rounded rectangle border (set_round_size) or circle border (set_circle); the line stays inside the content size
- UIProgressRing: progress ring that fills clockwise from the top center following the node's shape. Perimeter points are computed only when the size changes
- SoftShade, SoftShadeShape: soft shade that bakes a band (Band) or floor (Bottom) gradient into a small image and draws it stretched to the content size
- FrameProbe: detects slow devices from frame intervals over the first few seconds. (25% or more of frames exceeding 1.4 times the target interval; skipping every other frame at 90 Hz is not counted as slow)
- InputManager: held state and this frame's press and release of the three mouse buttons (MouseButton::Left, Middle, Right) (is_mouse_button_down, is_mouse_button_just_pressed, is_mouse_button_just_released), the list of touching fingers (get_touch_points, TouchPoint), whether the last input was a finger (is_touch_input), whether the wheel was scrolled with Ctrl (is_wheel_with_ctrl)
- Web: feeds mouse (press, move, release, wheel) and fingers (touchstart, touchmove, touchend, touchcancel) into engine input. Until now the web build did not pass canvas presses to the engine, so widgets such as UIButton could not be pressed on the web. The left button and the first finger are passed as touch, and emulated mouse events the browser sends right after a finger is lifted are ignored. Prevents finger scrolling and zooming over the canvas, the right-click menu, and page scrolling by the wheel
- Desktop: feeds the middle and right buttons and fingers (winit Touch) into the input manager. Records Ctrl for the wheel
- CameraGestures: camera gestures. Right drag (horizontal rotates, the canvas width is one full turn; vertical tilts; releasing without dragging is a right click), middle drag (pan), two fingers (pan, pinch to zoom, twisting past a threshold rotates). Read every frame with update(input_manager, view_manager) and taken out with take_pan, take_rotation, take_tilt, take_zoom
- PointerCursor, CursorValue: mouse cursor. The engine holds one (get_pointer_cursor_mut), and when enabled it sets the cursor at the end of every frame. Over a UIButton (including while pressed) it is the button's cursor, otherwise the cursor of set_screen_cursor. A winit cursor icon on desktop, the canvas cursor style on the web (including image cursors from register_image_cursor). When disabled (default), behaves as before
- Engine: is_coarse_pointer() (CSS pointer: coarse on the web, false on desktop at first, later Windows and Linux read the devices). Added set_cursor and is_coarse_pointer to the platform layer
- UIHitArea: hit area expansion. UIHitArea::attach(node_tree, button_id, minimum_size) places a transparent hit area as the sibling right behind the button, expanding its width and height to at least minimum_size. Clicks in the expanded area call the button's Clicked and Click notifications. Tracks the button's position, size and pivot every frame, and set_clip_node clips the expanded area to within a window or scroll area. (Clips after converting to node coordinates even if the parent is rotated)
- UIButton: fire_click_events(context). Calls only the click notifications (Clicked, Click) without pressing
- ToastMotion, ToastPhase, read_toast_seconds: enter and exit motion attached to a notification node. show(text, seconds) slides in from the outer side (top or bottom) while growing slightly and settling back, then after staying, floats up and disappears. If different text arrives while shown, the previous one moves aside quickly; if the same text arrives again, only the time is refilled and it pops. show only takes the request and moves on the next tick, and the text is put into the node by the function set with set_apply_text_handler. While hidden, the node is only made invisible
- ButtonMotion, ButtonMotionStyle, ButtonMotionArea, set_button_motion_area, shake_button: button feedback. The Normal style grows on hover, shrinks while pressed and pops on release. The Inset style (inside windows) does not grow; while hovered it brightens the background Paint and draws a white inner border. The style is set per button (set_style) or on an ancestor node with set_button_motion_area. Reads the pivot to scale around the center. Buttons inside scroll areas also shrink while pressed. Touch devices do not use hover. When there is no feedback, the node is left untouched. To make decorations light up in their own shape, set_lit_handler
- ShaderWarmer, ShaderWarmerSource: shader pre-linking. At startup, links the same sources in the background with KHR_parallel_shader_compile and leaves them in the program cache of the driver (the browser on the web), so it does not stall when ShaderProgram later builds the same sources. Does nothing if the extension is absent. update(gl) every frame, is_finished, is_supported
- ShaderProgram is exported from the crate root
- Toon 3D (graphics3d/toon): clay-like single-color material and outlines. (Only the general-purpose part of the board 3D of Exoplanet Miner)
  - MeshBuilder, ToonGeometry, ToonPartOptions, ToonQuad, ToonMeshArrays: puts box, rounded box, cylinder and cone, sphere, lathe, capsule, torus and octahedron shapes (create_*_geometry) into one mesh, multiplied by position, rotation and scale (create_part_matrix). Vertices are position 3, normal 3, color 3 (sRGB), material 2 (emissive, unlit), pattern 4 (index and color, meaning defined by the shader). Outlines are a shell (inverted hull) pushed out with points at the same position moving together, so it does not stick out too far at corners, and faces that fold over and flip while pushing are removed. Winding is corrected using the normal so the outside is the front face. Terrain built from faces uses add_quad, add_quad_shell
  - read_glb_arrays, read_glb_node_arrays, read_glb_node_infos, write_skin_pose, read_animation_swing, ToonOutlineOptions, ToonSkeleton: reads GLB painted with material colors without textures into arrays. Reads baseColorFactor as sRGB, emissiveFactor as emissive, and outline (shell) and basic (unlit) from material extras. Given outline settings, builds a new shell from the body of nodes that have a ".outline" pair (or added_parts). Reads the skeleton and motion (including loop "once" in extras) and computes bone matrices for a single moment. (Blending with the previous motion, sway scale) Separate from the engine's SkinnedModel (textured PBR)
  - ToonRenderer, ToonMesh, ToonDrawOptions: draws with a sun and ambient light of sky and ground colors, cel shading with set_band_count, emissive and unlit, tint and opacity, and the outline shell as back faces. Up to 96 bones. (Same as SkinnedModelRenderer) begin_frame records the previous draw state and end_frame restores it, so it can be inserted between 2D drawing (after flush_batch, before restore_render_state). read_program_sources can be passed to ShaderWarmer
- ToonPostProcess: HDR finishing. Blooms bright areas with BloomEffect on the scene drawn into a half-float render target, and outputs to the screen with exposure, approximate ACES tonemapping and sRGB gamma. (begin, end, set_exposure, set_bloom)
- SoundSystem, SoundRow: background music and sound effects managed through a sound table. Picking a recording different from the previous one in a recording group, the interval before the same sound can play again, limits on simultaneous instances of the same sound and in total (the oldest is cut when exceeded), pitch variation, playing only the first few seconds and fading out, background music crossfade and resuming from where it stopped, music volume, music ratio and effect volume. Mute engages if any one of the user, the page being hidden (set_page_hidden), or an external source (set_external_mute_provider) holds. load_sounds(engine) loads from the asset folder, and add_sound_asset adds sounds in memory. update(time_delta) every frame
- Renamed the audio backend module alias audioBackend to audio_backend (naming conventions)
- Localization: matches language tags by stripping subtags one at a time from the end (zh-Hant-TW → zh-hant → zh, underscores become hyphens) and also checks aliases from set_language_aliases. Right-to-left languages (is_right_to_left, set_right_to_left, initially ar, fa, he, ur, ps, yi, dv), wrapping inserted values in direction isolation characters (isolate_text), filling named placeholders (text_named, values joined only by slashes are wrapped once as a whole). (Only the engine part of vanilla.js LanguagePack; reading the list file, the tab title and font hookup belong to the game framework and were not ported)
- ShadowText: single-line text with a shadow underneath. Bakes the text over the shadow into a single image, so the node's opacity applies to it as one layer. The shadow is spread with three box blurs, and on overflow the text shrinks down to set_fit_minimum_ratio. When baking with a system font without font bytes on the web, it draws as Graphic text without the shadow
- ShadowImage: image with a shadow underneath. Places the image (or an atlas piece) centered in the node preserving its aspect ratio, lays a shadow under the image's shape, and bakes them into one layer. set_image_color tints it a single color. Downscaling blends evenly by overlapping area
- blur_coverage, compose_shadow_image: blurring coverage and composing an image with the shape over the shadow (used by ShadowText, ShadowImage)
- TextStringTextureCache: rasterize_text(text, font_string, bake_scale, padding) → TextRaster. Gets only the shape of the text as a raster. (Does not upload it as a texture)
- README: rewrote it with a strengths-focused introduction, example screenshots (docs/images), usage (scene lifecycle, nodes and components, asset loading, web build), technical notes (generational handle node tree, component access, batching, culling, asset loading without async, text rendering, 2D and 3D, web Korean input, platform layer), and a performance table
- README: external dependencies section. Lists each crate's version, where it is used, what it does and its license in tables split into common, desktop and web
- UIDocument, UIDocumentSaveContext, UIDocumentLoadContext, UIDOCUMENT_VERSION: exports a node tree to the same JSON document as vanilla.js UIDocument (.scene.json, the format the visual editor saves) (to_json_text, serialize_node) and reads it back to build it (from_json_text, deserialize_node). Key order, tab indentation and even number formatting match the text produced by the original toJsonText. Instead of reflection, build, write and read functions are registered in a table per type name (register_component_type, register_widget_type for widgets), and Paint, Sprite, Text, RichText, Mask, Outline, SoftShade, ShadowText, UIProgressRing, UILabel, UIImageView, UIButton, UIToggleButton, UIProgressView, UISlider, UIScrollView from the original table plus ShadowImage are registered in advance. Types the original saves by reflection are written with the same keys as the original reflection result. Children inside a widget's content (contentChildren), excluding components a widget attaches by itself, and node references ($nodeRef) also follow the original. Unregistered types emit a warning and are skipped. Image paths are resolved with the image resolver (set_image_resolver), or without a resolver, from the ImageAsset requested by load_images, and images loaded later are attached by bind_pending_images
- Sprite: set_image_path, get_image_path (original sprite.imagePath), set_round_size, get_round_size (the original used these by inheriting Paint). UIImageView: set_image_path, get_image_path. ShadowText: get_text_align, get_fit_minimum_ratio. ShadowImage: get_image_color, set_image_path, get_image_path
- Enabled preserve_order of serde_json. JSON object keys keep the order they were written in. (UIDocument writes in the same order as the original JSON.stringify; until now it was alphabetical)
- ParticleSystem: ported the original's render shapes (Circle, Rect, Streak, Image of ParticleRenderShape and set_render_shape), attractor (set_attractor, clear_attractor, position relative to the emission point), wobble (set_wobble), streak length (set_streak_scale), world space (set_world_space), and the edge emission shape (EmitterShape::Edge, set_edge_width). The description (apply_description) also reads renderShape, attractor, wobble, streakScale, worldSpace, edgeWidth by their original names. Drawing gathers quads per shape and draws them at once. (circle is a soft circle, rect and streak a white texture, image the image texture) Like the original, image fades only by start alpha x (1 - life ratio) without a color curve
- EmitterShape, ParticleRenderShape are exported from the crate root
- Format (base/format.rs, original base/format.js): format_number (locale thousands notation), format_number_with_unit, format_compact_number (1.2K, 5.6M, 1.3B), format_padded_number (range clamping and zero padding), format_minutes_seconds (minutes:seconds). It outputs the same text as the original through rounding, negatives and -0, unit boundaries, NaN and infinity, and the exponent form of String(number). Locales use a table extracted from node 25 (ICU 78.3) instead of Intl (121 lines: decimal point, thousands separator, negative prefix, digit shapes, Indian grouping, minimum grouping digits, NaN text), and a tag not in the table is en-US. (The original uses the browser's default locale and a wrong tag is a RangeError.) It matches 24,000 values from running the original format.js with node.
- Version: branch field and create_with_branch. With a branch, to_string produces "major.minor.patch-branch". (Original base/version.js) Since the branch is text, Version is no longer Copy
- Platform: is_desktop_web(). true if not mobile, and not an iPad presenting as a Mac with multiple touch inputs (navigator.maxTouchPoints > 1). Always true on desktop builds (original base/platform.js)
- Rect: the rest of the original base/rect.js. overlaps (touching edges count as overlapping), intersection, union, Rect::clamp, get_min / set_min, get_max / set_max, get_center / set_center, get_left / get_top / get_right / get_bottom and set_..., set_width, set_height
- Vector2: the rest of the original base/vector2.js. divide, divide_scalar, modulo, modulo_scalar, add_scalar, subtract_scalar, half, cross, length_squared, angle, get_x, get_y, minus_one, positive_infinity, negative_infinity, Vector2::lerp (original formula from * (1 - t) + to * t), Vector2::clamp. Fixed two original bugs: modulo doing division instead of remainder, and half returning double instead of half
- math: the rest of the original base/math.js. random_int (both ends inclusive), pick_random, shuffle, shuffle_with_random_function, approach, move_towards, min, max, round (halves toward +infinity, -2.5 → -2), POSITIVE_INFINITY, NEGATIVE_INFINITY. floor, ceil, sqrt, abs, trigonometric functions and pow with original names were added under the same names in the math line below. (Computed with f32 methods. The original's hand-rewritten sqrt, asin, acos, pow, which were wrong, were also fixed in the original to use built-in functions)
- NodeTree: sibling order and hierarchy checks. set_sibling_index (past the end goes last), get_sibling_index, get_child_index, get_sibling_ids, is_active_in_hierarchy, is_visible_in_hierarchy (active, visible flag, opacity > 0 up to the root). WorldNode: get_child_index. (Original base/node.js, core/node/transformnode.js)
- ViewManager: set_max_render_pixel_ratio / get_max_render_pixel_ratio (render pixel ratio cap; on the web the canvas is refit at the capped ratio at the start of the next frame; not used on desktop since the GL default framebuffer cannot be shrunk), limit_render_pixel_ratio, apply_aspect_view_scale_mode (StretchWidthExpandHeight if taller than the reference, StretchHeightExpandWidth if wider, recalculated immediately), get_css_pixel_scale, set_safe_area_override and get_safe_area_insets (override > URL ?safeArea=top,right,bottom,left > measured CSS env, view coordinates). (Original core/viewmanager.js) Added read_page_query_value (web URLSearchParams, desktop None) and read_safe_area_insets (web measured env, desktop 0) to the platform layer
- Engine: unload_scene(scene_id). Destroys and removes just one scene after this frame ends. (Original SceneManager.unloadScene) load_scene returns a SceneId, and a scene knows its own handle via get_scene_base().get_scene_id(). A scene loaded and unloaded in the same frame gets neither create nor destroy
- Scene: on_page_process_restored, on_page_visibility_restored. (Original core/scene.js) Called for each scene after the engine wakes sound again and clears input. On the web: visible of visibilitychange, document resume, pageshow (persisted); on desktop: when the window is no longer occluded (Mac and X11) and resumed after suspended. The original called an undefined function (dispatchPageProcessRestored) on pageshow and threw an exception; the Rust version fixes it with the same recovery as resume
- Engine: page events (PageEvent: Hidden, Visible, Blurred, Focused, PointerDown) and add_page_event_listener, is_page_hidden. When the platform reports one, the engine passes it to listeners on the spot. (The original attaches listeners to document and window in each module)
- Audio backend: suspend_audio_context (web AudioContext.suspend, desktop silences the kira main track and resume restores it), player pan (web StereoPannerNode, desktop kira panning)
- Graphic: batches tinted draws too. Like the original, adds a separate batch shader that carries color and tint per vertex. (Until now, tinted draws were not batched and were drawn one by one) The screen is the same as before. (uigallery draw calls 63 → 61, misctour 24 → 12)
- Graphic: remembers the last bound shader program and the texture of texture unit 0, and skips use_program and bind_texture that rebind the same ones. The call that returns to the default program after flushing a batch is also deferred to the next single draw. The memory is forgotten when GL is handed out via get_gl, on restore_render_state, and at frame start and end, so no wrong image appears after code that touches GL directly, such as toon, skinning, bloom, SSAO, ScreenEffect and ShaderSprite
- Graphic: set_image_mipmap_bias, get_image_mipmap_bias. (Original setImageMipmapBias) Sets the value added when choosing a mipmap level as textureLodBias in the default, batch and particle shaders. Swapped-in shaders receive it if they have that uniform. Until now it was hardcoded to 0
- Text: keeps the wrapped lines and re-measures only when the text, font string (name, size, bold, italic), wrap width or registered fonts change. (Until now it measured on every draw) The font string is also built only in setters. TextStringTextureCache: get_font_registration_count. Finds baked strings by a hash of the key instead of a key string, so no key is built on every draw. Graphic: push_state reuses the storage of a slot used once instead of cloning the font string. set_font_string leaves it as is if equal. NodeTree: reuses the empty placeholder put in place when tick and touch take out components, instead of allocating it every time
- Off-screen culling: text is culled too. Component gets calculate_drawn_rect (the rectangle actually drawn, None if unknown), and if all enabled components of a node give a rectangle, their union is checked with the Graphic transform at draw time. By default, as before, the content area if is_drawn_inside_content, otherwise unknown (not culled). Text and UILabel (when not rich text) give the text rectangle from the alignment, overflow and wrapping results, ShadowText the position of the last baked image (not culled if changed and not yet baked), ShadowImage the rectangle including the shadow margin. (ShadowText and ShadowImage were culled by the content area until now, so overflowing text and shadows could be cut at the screen edge) In scenes with overflowing text, text scaled 5x, children of culled parents, and multi-line text aligned to the bottom growing upward, the screen with culling on is the same as with culling off. (uigallery2 draw calls 83 → 81)
- Text decoration: set_underline, is_underline, set_strikethrough, is_strikethrough, set_wrap_mode, get_wrap_mode and TextWrapMode (Word, Character) on Text, RichText, UILabel. (Original setUnderline, setStrikethrough, setWrapMode "word" / "char") Underline and strikethrough draw a line in the text color (thickness max(1, size / 16)) like the original, and RichText segments use the Text values when they have no segment attribute. Italic (set_italic) only held the value until now; the glyph cache reads italic, oblique from the font string and emulates it by shifting the fontdue raster right above the baseline and left below it (0.2 times the height). Web system fonts put italic into the Canvas2D font. is_italic in FontDescription. ShadowText also gets set_italic, set_underline, set_strikethrough (not in the original; the lines are baked together so the shadow lies under them too. Since it is single-line text shrunk to fit, no wrap mode was added). Text decoration at the top right of example engineextras
- TextStringTextureCache: set_text_antialias_enabled, is_text_antialias_on. (Original setTextAntialiasEnabled, isTextAntialiasOn) When off, the alpha of baked glyphs is split into 0 and 255 at threshold 128 and textures are sampled with NEAREST. (For pixel fonts, on by default) Glyphs baked with web system fonts are the same. The original leaves already baked glyphs as they are, but here the on state is part of the cache key, so glyphs drawn after the change are baked that way. Pixel text that turns it off only while drawing in example engineextras
- Image: releases CPU pixels after uploading to the GPU to return memory. (Until now the same pixels as the texture were held on the CPU to the end) get_pixels returns Ref<[u8]> and may be empty after upload. (This changes the public API) Added has_pixels, set_pixels_retained, is_pixels_retained. Images whose pixels will be read again are kept with set_pixels_retained(true). ShadowImage keeps the images it receives by itself, and if one was already released by being drawn elsewhere first, it attaches the texture to a framebuffer and reads it back. (The read-back pixels are byte-identical to the original pixels) The engine has no path for restoring a GL context, so there is never a need to re-upload from released pixels
- Input: moves the input that the shipped games (Found You, Doomsday Survival, Space Creature, Aberrant, Exoplanet Miner) built and used separately on the game side into engine defaults. (The same features added to vanilla.js first)
- GamepadKind, read_gamepad_kind(gamepad_id): classifies the kind by pad name. PlayStation (054c, playstation, dualshock, dualsense, sony), Nintendo (057e, nintendo, joy-con, pro controller), Xbox (045e, xbox, xinput, microsoft), anything else Other
- GamepadManager.vibrate(strong_magnitude, weak_magnitude, seconds): vibrates all connected pads. gilrs force feedback on desktop (Linux, Windows), vibrationActuator dual-rumble on the web. Does nothing on macOS, where gilrs does not provide vibration. For this, gilrs is built with vibration enabled. (One gilrs vibration thread runs on desktop; until now it was off)
- GamepadManager.get_active_gamepad_id(): the name of the pad that pressed a button or tilted an axis more than 0.5 in the last update
- GamepadManager.set_input_log_enabled, is_input_log_enabled: turns off and on the log printed on every button and axis change. Changed default behavior: off by default, so button and axis logs are no longer printed. (Changed the same way as the original; moving a stick even slightly flooded the log every frame, and no game relies on the log) set_log_enabled remains the master switch for all logs, including connection and disconnection
- InputManager.is_key_just_pressed, is_key_just_released, is_mouse_button_just_pressed, is_mouse_button_just_released changed behavior: instead of comparing snapshots at frame end, accumulates and checks events (push_key, pop_key, set_mouse_button_down) that arrived since the end of the last frame. Fixed missing presses and releases between frames. (In that case the held state is false and press and release are both true) Same as the original
- Added phase (TouchPhase: Began, Moved, Stationary, Ended, Cancelled) and view_position to TouchPoint. (The struct gains fields, so code that builds TouchPoint directly must be fixed) InputManager.begin_touch_point, move_touch_point, end_touch_point receive each finger, and fingers lifted this frame stay in get_ended_touch_points for one frame. The desktop and web platforms feed through this path, and the web removes fingers missing from the event's touches as cancelled. get_touch_points is still only the fingers currently touching
- InputDevice, InputManager.get_last_input_device, get_last_gamepad_kind (set_last_input_device, set_last_gamepad_kind): the last used device (Keyboard, Mouse, Touch, Gamepad) and gamepad kind. The platform records it from keys, mouse (movement over 6 pixels on the web) and fingers, and gamepads are recorded in tick via get_active_gamepad_id. Initially Touch on finger devices, otherwise Keyboard
- InputManager.set_prevented_keys(keys), get_prevented_keys, is_key_prevented, is_typing_in_text_field: keys whose default browser behavior is prevented. Web keydown prevents them when not typing in a text field. (Desktop windows have no default behavior to prevent) A text field is the focus of an engine input field and, on the web, the document focus (text input, textarea, contenteditable, select). Added is_text_field_focused to the platform layer
- InputActions, InputActionSource (core/inputactions.rs): input actions. InputManager holds one (get_input_actions, get_input_actions_mut) and updates it in tick. bind_key, bind_gamepad_button, bind_axis(action, axis_index, direction), unbind_action, get_bound_keys, set_repeat(action, delay_seconds, interval_seconds), set_dead_zone (initially 0.2), set_axis_press_threshold (initially 0.5), set_keys_ignored_while_typing (initially true), add_source(Box<dyn InputActionSource>) → id, remove_source(id), is_pressed, is_just_pressed (including repeats), is_just_released, read_value, read_axis(negative_action, positive_action), read_gamepad_stick(x_axis_index, y_axis_index), read_move_axis (the longest of WASD and arrow keys, left stick, and external sources, length at most 1). Unlike the original, movement keys and pad axes read the values recorded at update in the same frame
- Camera3D, ProjectedPoint: 3D camera. (Added together with vanilla.js) Perspective (set_perspective) and orthographic (set_orthographic), aspect ratio (set_aspect_ratio), look_at, and view and projection matrices cached and recomputed only when values change (get_view_projection_matrix, get_inverse_view_projection_matrix). project_to_view(x, y, z, view_rect) computes a world point's position inside the 3D drawing rectangle and whether it is in front of the camera, unproject_to_plane(view_position, plane_height, view_rect) computes the point where the ray from a position in the rectangle meets the horizontal plane, and read_view_depth computes view-space depth. The renderer and 2D overlays use the same camera. (Replaces Exoplanet Miner, Aberrant, Doomsday Survival rebuilding camera matrices per screen and computing projection by hand)
- ToonRenderer: set_screen_rect(x, y, width, height), clear_screen_rect, get_screen_rect. Draws only inside the node rectangle. begin_frame moves the clip space of view and projection into the rectangle and cuts off the outside with scissor, and end_frame releases the scissor. Off-screen culling uses the frustum before the move. begin_frame_with_camera(Camera3D), draw_mesh_outline (draws only the outline, not counted). Added casts_shadow (read by ToonDrawQueue) and is_body_drawn to ToonDrawOptions. (Default true; without a screen rectangle, behavior is unchanged)
- ToonDrawQueue: collects the models to draw in a frame, then draws opaque bodies, outlines of opaque ones, and translucent ones (farthest from the camera first, depth write off) in that order. add_mesh, add_mesh_instanced, draw_shadows, draw(gl, renderer, camera). Borrows the models it holds, so it has the lifetime 'a. (From the queued drawing of Doomsday Survival ModelRenderer3D)
- Graphic: run_external_pass(is_depth_cleared, pass), clear_depth_buffer. Inserts a GL pass between 2D draws. Flushes the preceding 2D batch, clears depth, then calls pass(gl) and calls restore_render_state. Clearing depth after setting a clip (stencil) once caused no 3D to be drawn at all on Galaxy Fold3 (Adreno 660) (original game), so nodes that draw 3D inside a clip call clear_depth_buffer before begin_clip_rect and pass is_depth_cleared as false
- ToonView3D, ToonViewDrawer, ToonViewPass: a component that draws toon 3D inside the node rectangle. Transforms the content area with the current transform into a drawing buffer rectangle, and inside run_external_pass sets the renderer's screen rectangle and calls the drawer (ToonViewDrawer::draw_toon). The renderer is created on first draw, and on devices where it cannot be created it is not retried and draw_fallback draws 2D instead. The aspect ratio of the camera (get_camera_mut) is matched to the rectangle on every draw. Holds the drawer as a type parameter instead of the original's draw function, and the original's setRenderer (renderer sharing) was not ported
- ToonPostProcess: set_color_grade(saturation, contrast, tint color, tint amount, haze color, haze amount), set_vignette (darken edges). Applied after tone mapping and gamma. The tint color is multiplied after normalizing its brightness to 1, and haze lifts darker areas more toward its color. With default values there is no grading, so behavior is unchanged. To output to a node rectangle, call resize (rectangle size), then pass the rectangle as the viewport of end. (From the color grading of Doomsday Survival SceneEffects3D)
- MeshBuilder::combine(&[ToonMeshPiece]) offsets multiple static pieces and joins them into one array. Outline shells, shell reference positions, and inner ranges are also offset and joined, skeletons are not joined. create_faceted_chunk_geometry(radius, vertex scale, axis scale) is a faceted rock made by stretching and shrinking each of the 12 icosahedron vertices. (Doomsday Survival combineMeshArrays, Exoplanet Miner meshbuilder.js)
- GraphicsQualityGovernor, GraphicsQuality (Auto, High, Low): decides the lite path (is_lite) in the order override (apply_search_text, ?light of the page URL via apply_page_query on the web, set_lite_override) → setting (low always, high never) → auto (set_auto_lite_default, or FrameProbe measures the device as slow). update(frame seconds, maximum frame) measures only in auto and returns true on the frame it changes. set_render_pixel_ratio_limits(normal, lite path) and apply_render_pixel_ratio(view_manager). What to reduce on the lite path is up to the game. (Exoplanet Miner readIsLite, Aberrant isLight)
- Loading, saving, and time features that shipped games built separately are added as engine defaults. (The same features added to vanilla.js; the games' screen looks and release platform code were not brought over, the only changed default behavior is LocalStorage reads)
- TimeManager: set_maximum_time_delta(seconds), get_maximum_time_delta(). Changes the cap on a single frame interval. (Previously hardcoded at 0.25 seconds, the default is unchanged) Below 0 or not finite gives 0.25
- Engine: set_maximum_frame_per_second(n), get_maximum_frame_per_second(). Changes the maximum FPS at runtime. (Until now it could only be set at startup via EngineConfiguration) Writes to the configuration, and the desktop and web platforms read that value every frame. Below 0 or not finite gives 0 (no limit)
- FixedStepper: fixed step. advance(time_delta, step_function) of FixedStepper::new(step_seconds, maximum_steps_per_frame) calls step_function(step_seconds) for the accumulated time and returns the remaining fraction (0 ~ 1). If steps remain after running up to the per-frame cap, the remaining time is discarded, and if step_function returns false, that frame stops there and the time stays accumulated. (The original stops only on false and need not return anything, but the Rust version always returns bool) get_alpha, get_last_step_count, reset
- LocalStorage: storage swapping with set_backend(Some(Box<dyn LocalStorageBackend>)), has_backend. LocalStorageBackend is a trait with get_item, set_item, remove_item and (optional) get_keys, clear, and the original's exceptions are Err. If there is no storage (blocked localStorage on the web) or a write fails (capacity, the desktop folder cannot be created, Err from a swapped-in storage), values are kept in memory instead for this run. (is_memory_fallback) get_item, set_item (whether it was written to storage), remove_item, get_json(key, default_value), set_json(key, &value)
- LocalStorage: reads (get_string, get_boolean, get_number) no longer write the default value for missing keys. (This changes default behavior, changed the same way as the original) Merely reading created the key, so after a default changed in a new version the old default remained as if it were a saved value, and contains_key was always true. None of the shipped games using the original rely on this behavior. (2026-11-25 grep of game code, details in vanilla.js UPDATE.md)
- PersistedStore: set_storage_backend(Option<Box<dyn LocalStorageBackend>>), has_storage_backend. Places just one store elsewhere. Swapping re-reads from there and notifies subscribers
- AssetLoader: concurrent asset loading. add_image, add_json, add_text, add_blob immediately return an asset with a load handle that is still empty, add_audio returns Rc<AudioAsset> (finished only when decoding is done), add_font(engine, family, path, is_bold) a load handle, and add_load_handle adds an externally requested handle (in place of the original addTask). load(engine) requests set_concurrency (default 6) at a time, and calling update(engine) every frame requests the next ones as others finish. (On desktop they are read on the spot and finish in load) Handing get_completion_handle to the scene's track_load_handle defers initialize until everything is loaded. get_progress, get_loaded_count, get_finished_count, get_total_count, get_failed_list (AssetLoadFailure), is_finished, get_in_flight_count, set_progress_handler, set_complete_handler. It is a cheaply cloned handle
- AssetBase: load_from_handle(load_handle). Attaches a load handle that someone else fills. Engine: request_asset_bytes_into(path, &load_handle). An asset bytes request that fills an already created handle (both used by AssetLoader)
- LoadingProgress: the shown value (get_shown_progress) smoothly follows the reported progress (set_progress, 0 ~ 1, never decreases). update(time_delta) every frame, set_follow_rate (default 6 times the remaining distance per second), is_finished, reset
- GameSceneBase: loading screen customization. set_loading_colors(background, gauge background, gauge), set_loading_outside_color (outside the view), and set_loading_drawer(Some(LoadingDrawer)) replaces the whole drawing over the background. (LoadingDrawer is a function receiving graphic, view size, shown progress and elapsed seconds) When progress is reported with set_loading_progress or track_asset_loader, the gauge smoothly follows that progress instead of elapsed time. (get_loading_progress_state, the original getLoadingProgress; named this way because the Rust version already has an elapsed-time ratio under the same name) For loaders handed over with track_asset_loader, draw_on_load calls update. If nothing is set, behavior is unchanged
- BuildInfo: build version reading. load(engine) of BuildInfo::new(env!("CARGO_PKG_VERSION")) first reads the page's <meta name="build-version"> on the web, and if absent requests version.json relative to the page without cache (cache: "no-cache" of fetch). On desktop it reads version.json in the asset folder. read_text() returns the meta text, "date time (hash)" from version.json (version if there is no hash), or the version embedded at build time if neither exists. is_finished, get_load_handle (handed to a scene or AssetLoader), read_version_data, set_meta_name, set_version_json_path, BuildInfo::compose_text. meta and disabling cache exist only in browsers, so desktop does not do them. Shows the version in example loadingshowcase
- ToonScreenOutline, ToonOutlineWidthUnit, ToonLineDrawOptions: toon screen-space outline. (Same features as vanilla.js ToonScreenOutline, the shader outlines that Exoplanet Miner and Aberrant wrote separately) Draws ToonRenderer models once more with the same matrices to write normals, line ids, and depth into a line buffer (begin_line_ids, draw_mesh, draw_mesh_instanced, end_line_ids), writes a mask, then blends with draw_outline. Part ids are given with index_start, index_count, and per-instance ids with line_id_list of draw_mesh_instanced. Width in world length or pixels (set_width, set_focus_distance), orthographic and perspective are told apart by the projection matrix, and depth is linearized to meters for perspective. set_depth_threshold, set_crease, set_resolution_scale, set_sample_count, set_color, set_hdr_output
- ToonMesh: get_body, get_instance_buffer, which read the body vertex array and instance buffer within the crate. (For when the screen-space outline draws the same model)
- ToonVfx and ToonParticleOptions, ToonFireballOptions, ToonShockwaveOptions, ToonDecalOptions, ToonPlumeOptions, ToonBeamOptions, ToonRibbonOptions, ToonLightningOptions, ToonGlintOptions, ToonVfxRange, ToonVfxSlot, ToonVfxLook, ToonVfxShape, ToonVfxDecalMode, ToonVfxCounts: base for toon 3D GPU effects. (Same features and shaders as vanilla.js ToonVfx, the general-purpose parts of Exoplanet Miner and Aberrant; effect recipes and ramp colors belong to the games) An atlas built in code, instanced GPU particles (emit_particles), fireballs (add_fireball), shockwaves (add_shockwave), floor marks (add_decal, queue_decal), smoke plumes (add_plume), lathe beams (queue_beam), ribbons (queue_ribbon) and lightning (queue_lightning), glints (queue_glint), an internal clock advanced by update, a particle cap (new, set_particle_capacity) and an emission count ratio (set_count_ratio), ramp colors (set_ramps, rows of [r, g, b] in 0 ~ 1), a floor height callback (set_floor_height_reader). Takes values through per-effect structs with defaults
- Window stacking and screen frames that shipped games (Exoplanet Miner, Aberrant, Doomsday Survival, Space Creature) built separately are moved into the engine. (The same features added to vanilla.js; panel looks, themes, presentation, and release platform code are not brought over)
- UIWindowLayer: window stacking component. UIWindowLayer::create(node_tree, parent_id) creates the layer node, and open_window(tree, window_id) stacks a window on top. Only the top window is visible. close_window removes it from the list immediately and deletes the window node after the PopupMotion close motion finishes (covered windows immediately). close_all_windows, close_top_window (back navigation, does not close windows with outside close disabled), get_top_window, find_window, has_open_window, get_window_count, set_window_change_event (notification receiving the number of open windows). The layer scales by UIScale::read (set_view_size takes the CSS pixel scale, set_ui_scale_options(None) for no scaling, get_ui_scale) and tells windows the area size divided by that and the safe area width (set_view_bleed). open_window_in_tree
- UIWindow, UIWindowBehavior, UIWindowDefaultBehavior, UIWindowParts, UIWindowEvent: a single window. Shows a panel (a single Paint) centered over a dim (which swallows presses) covering the area and the safe area. The panel widens to the area width but not beyond set_maximum_width (default 480), its height comes from layout_content (default set_panel_height), and if larger than the area the whole panel is scaled down. Pressing outside closes it (set_outside_close_enabled). close_in_tree, set_close_event, refresh_layout_in_tree. The methods that the original's subclasses override (build, layout_content, layout_panel, apply_motion, set_covered, handle_wheel, handle_closed, dispose) are the UIWindowBehavior trait and are taken out with get_behavior_mut. Games change the panel look by attaching decorations to the frame (get_frame_node) in build. The wheel goes first to the scroll view at that position, then to the window, which always swallows it
- UIConfirmWindow, UIConfirmWindowOptions: confirmation window (UIWindowBehavior). Title, message, and two buttons, cancel and confirm. When the text exceeds the area height, only the text area scrolls. The line count is known only after drawing, so it is first laid out as one line and laid out again on the next tick. With set_right_to_left(true), the button order is reversed. Confirm closes after set_confirm_event, and closing via the cancel button, an outside press or the window layer calls set_cancel_event. confirm_in_tree, set_title, set_message. (UIDialog is left as is)
- UIScale, UIScaleOptions: scale that enlarges only the UI layer when one view unit is smaller than minimum_css_scale (0.8) CSS pixels. (1 to maximum_scale 1.8, short screens are not enlarged below minimum_layer_height (not checked when it is 0, the default), portrait screens (width at most portrait_ratio 1.1 times the height) have no upper limit) UIScale::read(view_width, view_height, css_pixel_scale, &options), is_portrait
- Text: get_measured_line_count(). The line count from the last wrap after drawing, while the text, font and wrap width are unchanged. (For layouts without a Graphic to read the drawn result)
- GameSceneBase: fade_screen(on_dark), ScreenFadeHold, ScreenFadeEvent. Calls on_dark(tree, engine) when fully dark, and if it returns a ScreenFadeHold, stays dark until release (in place of the original Promise). false if already fading. set_screen_fade_color (default black), set_screen_fade_seconds (default 0.35), is_screen_fading, get_screen_fade_alpha. The overlay is drawn by post_draw (newly added, called from the scene's post_draw) over the whole canvas including the safe area, and moves with unscaled time. While the overlay is up, presses and wheel are blocked and only the move, release and cancel of fingers already pressing are passed
- GameSceneBase: is_user_interface_at(view_position), set_play_input_enabled, take_play_inputs, PlayInput (Press, Move, Release, Wheel), convert_view_to_play_area. Collects presses not taken by the UI, the moves and releases of those presses (including cancel), and wheel outside the UI, as play area coordinates relative to the top-left of the safe area. (The original uses a handler object; the Rust version uses a queue because a handler cannot borrow the scene state)
- GameSceneBase: set_play_area_reference(fixed_length, is_landscape, engine), apply_play_area_reference(engine), calculate_play_area_reference_length. Extends the reference resolution so that the fixed-side length of the play area excluding the safe area is always fixed_length. initialize applies it by itself, and since resize cannot modify the engine, the scene calls apply_play_area_reference at the start of resize
- ViewManager: set_ignored_safe_area_sides(&[SafeAreaSide]), get_ignored_safe_area_sides, SafeAreaSide. get_safe_area_insets returns 0 for those sides
- TouchRecognizer: is_touching()
- GameSceneBase behavior change: when not set with set_safe_area_insets, compute_safe_area_rect reads ViewManager::get_safe_area_insets instead of measuring the platform env separately. Until now, set_safe_area_override, the URL's ?safeArea=, and (new) ignored sides did not reach the GameSceneBase safe area. Web env values are the same except that they are no longer truncated to integers, and desktop stays 0. read_platform_safe_area_insets and parse_leading_integer, which measured separately, are no longer used and were removed
- The text, node convenience, and drawing features and optimizations that the shipped games built and used separately are added to the engine defaults. (The same features added to vanilla.js together; the games' screen looks and presentation were not brought over)
- Text, UILabel: set_fit_width(width, minimum_ratio), get_fit_width, get_fit_minimum_ratio, get_fitted_font_size, calculate_fitted_font_size. When single-line text overflows the fit width, it is drawn shrunk from the original size down to the minimum ratio in steps of 0.1. The set size stays the same; if it still overflows at the minimum ratio, it is drawn overflowing, and the text rectangle for off-screen culling follows the width of the shrunk text. Wrapping text and rich text are not fitted. The shrunk size is measured when splitting lines, so a Graphic is needed to know it
- Text: set_letter_spacing, get_letter_spacing (same names on UILabel and RichText). Spacing added after each grapheme cluster (pixels, same meaning as CSS letter-spacing, negative narrows, initially 0). The text width grows by cluster count x spacing, and wrapping, fit width, alignment and underline measure with that width. Positions are set by measuring the previous/next pair, so pair kerning is kept. Right-to-left text does not use the spacing. Same as the original's setLetterSpacing
- Engine::open_url(url): opens an outside URL. Desktop uses the OS default program (macOS open, Windows ShellExecuteW, Linux xdg-open); the web uses window.open(url, "_blank", "noopener") in a new tab. On the web it opens only when called inside user input (click, tap, key) handling (the browser's popup-blocking rule). Only http, https, mailto and tel are opened; other forms return false. Same as the original's Engine.openUrl
- Engine::read_local_time(minute_offset: f64) -> LocalTime: returns the calendar time of now plus a minute offset in this machine's time zone (LocalTime { year, month 1 to 12, day, hour, minute, second, weekday with 0 as Sunday }). It reads with Date on the web, localtime_r on Mac and Linux, and SystemTimeToTzSpecificLocalTime on Windows, and applies daylight saving time at the shifted moment (same as the original's new Date(Date.now() + offset)). Same as the original Engine.readLocalTime
- UIView: set_backdrop_blur(blur_radius), get_backdrop_blur. Backdrop blur (same meaning as CSS backdrop-filter: blur() and Unreal UMG BackgroundBlur, initially 0 meaning off). The argument is the standard deviation, the same as the N of CSS blur(Npx) (node coordinate units, device pixels on screen after the transform scale). It blurs with the new ScreenEffectType::GaussianBlur (separable Gaussian, up to 3 sigma, linear sampling, edges folded as a mirror). Pixel-identical to the original engine (standard deviations 3, 8, 20, 40, max difference 1) and equal to Chrome CSS. Off leaves the screen byte for byte
- UIView: set_backdrop_corner_radius(corner_radius), get_backdrop_corner_radius. Rounded corners of the backdrop blur and background color (CSS border-radius). Initially 0 (rectangle). Same as the original's setBackdropCornerRadius
- Screen capture: giving 0 to VANILLA_CAPTURE_FRAMES or the web capture query is treated as the first frame (1). (Frame numbers start at 1 so 0 never came, and the capture never finished)
- ScreenEffectType::GaussianBlur: standard-deviation Gaussian blur (parameters = [standard deviation in pixels], same meaning as CSS filter: blur()). The existing Blur stays as it is
- SpriteAnimator: also moves a ShaderSprite on the same node (in the original, ShaderSprite inherits Sprite so it also moves the ShaderSprite on the same node). play, tick and find_sprite use ShaderSprite when there is no Sprite
- Text, UILabel: measure_text(graphic, text, font_size). Graphic: measure_text_with_font_string(font_string, text)
- TextStringTextureCache: text measurement (measure_text) does not re-measure when the font string and text are the same. (2048 entries, the least recently used half is discarded when exceeded, cleared when a new font is registered) get_measure_count
- UILabel.set_text: skipped if the text is the same. (When not in rich text mode) Text.set_text already skipped the same text. Colors are Copy, so no separate same-color skip was added
- Graphic: set_text_bake_motion_scale_step, get_text_bake_motion_scale_step (default 0.25), set_text_bake_scale_moving, is_text_bake_scale_moving, update_text_bake_scale_moving. When the text bake scale step is 0 and the transform scale of the drawn node differs from the previous frame (ButtonMotion, PopupMotion, tweens), text is baked at a scale quantized to this step, and rebaked at the exact scale when it stops. A node drawn for the first time is treated as not moving. When the step is not 0 (default), nothing is computed. NodeTree decides it per node, and ShadowText and ShadowImage use the same scale too. WorldNode: set_last_drawn_maximum_scale, get_last_drawn_maximum_scale
- ShadowText, ShadowImage, SoftShade: baked images with the same shape are shared per key. (acquire_shared_bake, read_shared_bake_count in core/sharedbakecache.rs) The Rc held by each component serves as the reference count, and ones no longer used by anyone are kept up to 128 and evicted least recently used first when new ones are added. ShadowImage uses the image's instance identifier and piece as the key
- NodeTransform, WorldNode: set_local_position_xy, set_local_scale_xy, set_content_size_xy, set_rect(x, y, width, height) (sets local position and content size, accounting for the pivot, so that the top-left is at (x, y); the anchor stays as is). NodeTree: convert_view_to_local(node_id, view_position) (same calculation as convert_view_position_to_node_position, original name)
- Localization: mirror_layout_x(x, width, parent_width), read_layout_text_align(text_align). For right-to-left languages, flips the horizontal layout position and the left and right of alignment
- Wheel: if the frontmost in draw order among those covering that position is a wheel receiver (Component::is_wheel_receiver, true for UIScrollView and UISnapScrollView), that receiver takes it. If the frontmost is a pressable node, it asks from that node toward its parents as before. (NodeTree::find_wheel_target_node, dispatch_wheel_at) Used by SceneBase.tick_touch and TouchRecognizer (GameSceneBase). Whether something took it is SceneBase::is_wheel_handled, TouchRecognizer::is_wheel_handled, GameSceneBase::is_wheel_handled (using the wheel for the game's map zoom etc. only when false does not conflict with window scrolling)
- Graphic: draw_ring(center, inner_radius, outer_radius, start_radian, end_radian) (set_fill_color), draw_arc(center, radius, start_radian, end_radian, line_width) (set_stroke_color), draw_ring_with_color. Joins one quad per segment without overlap and draws in one pass, so seams do not darken even when translucent. Segment count follows the on-screen radius like draw_circle (16 to 64 per full turn), in proportion to the drawn angle. Angle 0 is right, clockwise
- Graphic: draw_line_segments(position_values, size). Draws multiple line segments at once from one number array (x0, y0, x1, y1 per segment). When the vertex buffer fills, draws up to there and continues filling
- SpriteAtlas: reads the JSON from tools/atlas.cjs (vanilla.js) and the { pagePaths, frames } form. load(engine, json_path), load_data, update (on the web, requests page images after the JSON arrives), is_loaded, track_json_asset, read_frame, has_frame, apply_frame, get_page_count, get_frame_names, and find_frame_in_order, apply_frame_in_order, which search multiple atlases in order. Names are also found with the extension removed. Sprite.set_frame(frame)
- GamepadManager.vibrate: also vibrates on macOS desktop. (gilrs's macOS force feedback is empty, so until now it did nothing) The platform layer platform/desktop/gamepadhaptics.rs builds CoreHaptics engines via GCController.haptics of GameController, and outputs continuous vibration with the heavy motor on the left handle engine and the light motor on the right handle engine. (Pads that do not provide both use one engine at the larger magnitude) gilrs pads are paired with controllers of the same name (vendorName) first, and the rest in order. Engines are built once per controller, restarted after stop and reset, and rebuilt on failure. On macOS, a length or magnitude of 0 stops the previous vibration. Added a pad vibration test (A, B, X, Y) to example inputgallery, and it does not end by itself when a real pad is connected. Dependencies: objc2-game-controller, objc2-core-haptics, objc2, objc2-foundation, block2 (macOS only)
- Made ParticleSystem the same as the original. Defaults (max 512 particles, speed 60, size 6, cone half-angle 0.5 radians, set_cone_angle is a half-angle like the original), cone emits within the radius, box emits upward only. Random number order and computation match the original, so the same seed gives the same particle positions as the original. (Difference below 0.0002 px across five shapes) The emission origin is the component coordinate origin (top-left of the content area) like the original, simulate(time_delta), emit(count, Option origin offset). Renamed EmitterShape to ParticleEmitterShape and Rectangle to Box. Like the original, it stays playing after duration passes, and is_finished reports the end. get_particle_position_list. Particles beyond the vertex limit are also all drawn in parts. (The public API changes)
- HeatHazeEffect: draws in parts without the row limit (1365). (The original is now the same effect component too)
- ScreenEffect.set_timeline_property takes &TimelineValue. (Numbers, strings and booleans like the original; booleans as numbers 1 and 0) TimelinePropertyTarget also passes values without converting them to text. (The public API changes)
- HumanSkinRenderer: ported the original humanskinrenderer.js. One shader split into shading modes for skin (wrinkle maps, micro normals, height detail, dual-lobe GGX, vellus hair), eyes (cornea refraction parallax, iris, limbus), hair (Kajiya-Kay anisotropy, sway, cutout and fringe 2 passes), occlusion, and fluids. The GLSL is the same as the original. Outputs irradiance, albedo, specular and normal to 4 MRT targets, and has a cutout depth pass. Wraps SkinnedModelRenderer and calls the base functions as is through Deref
- ToonView3D: like the original, takes a draw function and a fallback draw function (set_draw_callback, set_fallback_draw_callback, closures), and multiple nodes share one renderer with set_renderer, get_renderer. (Rc<RefCell<ToonRenderer>>) Taken out with get_component_mut::<ToonView3D>() without a type parameter. Removed ToonViewDrawer, ToonViewPass. (The public API changes)
- Graphic::run_external_pass: a drop guard restores the 2D state even if pass panics
- ToonRenderer, SkinnedModelRenderer, HumanSkinRenderer: bind a 1x1 comparison depth texture to the shadow unit when not receiving shadows. (This was the cause of the Mac driver's "UNSUPPORTED (log once) ... sampler type (Depth)" notice; the order of filling uniforms was not the cause) SkinnedModelRenderer::get_empty_shadow_texture
- ToonRenderer: set_shadow takes (ShadowMap or None, strength) like the original. destroy, get_solid_program, get_outline_program, get_depth_program, extract_frustum_planes
- ToonVfx: rim for light particles and light dots, glow bleed color for ribbons and lightning, set_rim_color, lightning that re-bends over its life add_lightning, screen flash add_flash (ToonFlashOptions), camera shake computed with the engine Shaker add_shake, read_shake, is_shaking. set_ramps takes both "#rrggbb" text and [r, g, b] (ToonRampColor). queue_lightning does not draw when count is 0. seed is Option. Shown in example toonfx
- SkinnedModel: reads default morph weights from glTF node weights. destroy of screen-space effects also deletes the fullscreen pass. ToonScreenOutline: get_line_target (ToonLineTarget), read_outline_radius
- Camera2D: rotation (set_rotation, get_rotation, degrees). apply_transform, screen_to_world, world_to_screen, pan_by_screen, fling, zoom_at follow the rotation, and the bounds clamp is measured with the box enclosing the rotated view (get_visible_half_extent). convert_screen_delta_to_world, begin, end
- Action: callbacks of condition steps are ActionConditionCallbacks. (updated receives only the target, like the original) repeat 0 times does not run
- Pane, PaneStyle, PaneTheme (original web/pane.js): DOM split panels. Exists only in web (wasm32) builds. Lays out child panels horizontally or vertically, resized by dragging the resizers between them. Size is PaneSize (Flex, Fixed pixels, Ratio), minimum and maximum size, whether resizable and which edges (PaneResizableEdges), set_visible (hiding also removes its space and the adjacent resizer), reset_layout, refresh, attach_to, set_callback. PaneStyle::create creates elements with the original presets (toolbar, panel, button, input, textarea, text), and style names are CSS names (background-color). PaneTheme is associated constants of the form PaneTheme::COLOR_BACKGROUND
- DevTools: ported the original F2 developer tools. A panel docked to the bottom right in logical coordinates inside the window, dragging to move and resizing by edges, corners and dividers, four tabs (Statistics, Node Hierarchy, Local Storage, Settings), tree (expand, active and gizmo columns, selection, scrolling), inspector, settings saving ("hierarchy.settings"), screen ratio guides, forcing all gizmos visible. The scene calls tick(engine, node_tree, time_delta) in tick and draw(engine, node_tree, graphic) in post_draw. Component properties in the inspector are the keys and values UIDocument saves, and local storage input on desktop is an input box inside the panel. (On the web, window.prompt, window.confirm like the original)
- UIDocument: serialize_component(node_tree, root_id, component). One registered component to document data (None without a warning for unregistered types)
- UI branch: removes UI feature differences with vanilla.js. (What was not in the original was also added to vanilla.js)
- Ported UINode (original ui/uinode.js), auto layout (ui/autolayout: LayoutSolver, LayoutVariable, LayoutExpression, LayoutConstraint, LayoutStrength, LayoutPriority, LayoutRelation, LayoutConstraintAxis, LayoutError, the original's Kiwi-based solver, 12 files), and UIScene (original ui/uiscene.js). UINode is a component attached to a node, and moves solver values into the node's position (relative to the top-left of the parent UINode) and content_size. The intrinsic content size gathers Component::get_intrinsic_content_size (Text, RichText, UILabel), and constraints are reapplied by itself when it changes. Where the solver throws exceptions, it is Result<(), LayoutError>
- UIScene trait, UISceneBase, and the ui_scene! macro: the solver, screen guide (screen_node), safe area guide (safe_area_layout_guide), and every tick it attaches the solver to the tree's UINodes, solves, and moves the results to the nodes. The common frame (loading, touch, developer tools) wraps GameSceneBase
- GameScene trait and game_scene! macro: the form of subclassing and overriding the original GameScene. Calls the base first, then the scene's functions of the same name (load_assets, initialize, layout, tick, pre_draw, draw, post_draw). layout is called by the base on resize and view size changes, and the fade overlay and developer tools of post_draw are drawn by the base. Calling GameSceneBase functions directly still works
- GameSceneBase: resize reapplies the play area reference (apply_play_area_reference) by itself. (The scene does not need to call it, resize takes &Engine) tick takes &Engine
- GameSceneBase: set_play_input_handler(Box<dyn FnMut(PlayInput)>) receives input not taken by the UI through a handler, like the original. (Can be used together with collection via set_play_input_enabled, take_play_inputs) fade_screen_with_hold(on_dark) is a callback form where on_dark receives the hold, keeps it and releases it later. (In place of the original Promise resolve) get_loading_drawer, draw_screen_fade, get_dev_tools, get_dev_tools_mut
- GameSceneBase: if EngineConfiguration::use_dev_tools (default true), creates DevTools in initialize, tick passes to it and post_draw draws it. Input over the panel is not passed to the UI or play. (is_dev_tools_capturing_input takes the engine)
- GameSceneBase: when the wheel points inside the window layer (UIWindowLayer), the top window takes it first like the original, and if not taken, the scroll view at that position takes it. (UIWindowLayer::scroll_window_at, find_scroll_view_at, find_window_layer_of) TouchRecognizer: split into tick_wheel, tick_pointer, mark_wheel_handled. (tick_touch is unchanged)
- UIWindowLayer: instead of deleting window nodes whose close motion has finished, detaches them from the layer, so the same window can be shown again with open_window like the original. (Attaches it if it is not a child of the layer)
- UIWindow: handle_wheel(node_tree, view_input_position, wheel_delta), UIWindowBehavior::handle_wheel receive the position like the original. get_panel_paint(_mut), get_dim_paint(_mut), get_view_width, get_view_height, get_margin, get_panel_height, get_panel_rect, get_panel_scale
- UIConfirmWindow: measures the line count of the message without Graphic, from the first layout. (textstringtexturecache::measure_text_without_graphic, which measures with registered fonts, Text::wrap_lines_without_graphic, wrap_text_to_lines_by) set_button_texts, refresh_if_open_in_tree, set_title_in_tree, set_message_in_tree
- Text: changing the font size, name, bold or italic also updates the font string used to draw single-line text right away. (Until now, without a fit width or underline, it drew at the initial 32px)
- UIListView: set_template_node(node_tree, template_id) serializes the template into a UIDocument and clones it, like the original. For game components, pass the UIDocument in which they are registered to set_template_node_with_document
- UILabel: set_visible_character_count, get_visible_character_count. UIProgressRing::get_perimeter_points. attach_button_motion, attach_toast_motion
- UIInputField: renamed set_use_dominput, is_using_dominput to set_use_dom_input, is_using_dom_input following Rust naming rules (original setUseDOMInput)
- Aligned text and fonts with the original (vanilla.js, browser Canvas2D):
  - Text shaping (core/textshaping.rs): with bidirectional ordering (unicode-bidi) and glyph shaping (rustybuzz), draws right-to-left text (Arabic joining, Hebrew), mixed text, ligatures, kerning and combining marks like the browser. All text goes through this path
  - Text direction: Graphic.set_text_direction, get_text_direction, resolve_text_direction, TextDirection(Inherit, Ltr, Rtl, Auto), detect_text_direction. resolve_text_align(text_align, text_direction) takes the direction like the original. (This changes the public API) The key of baked text includes the paragraph direction. set_text_direction, get_text_direction of Text, RichText, UILabel, ShadowText. RichText places segments from the right in a right-to-left paragraph
  - Font faces: registers multiple faces with different weight, style and character range (unicode-range) under one name. (TextStringTextureCache.register_font_face, unregister_font_face, set_font_face_order, clear, FontFaceDescriptors, Engine.register_font_face_when_loaded, unregister_font_face, set_font_face_order, clear_text_cache, FontAsset.load_font_with_descriptors, unload) Selection follows CSS order (style, weight), and faces registered later come first. Reads numeric weights (500 etc.) in the font string
  - Synthetic italic uses the same slant of 1/4 as Chromium (previously 0.2), and synthetic bold the same thickness as Skia (1/24 of the size at 9px or below, 1/32 at 36px or above), applied per glyph. Italic and bold faces are used when present. The web default_font_url font is registered only at normal weight, so bold text becomes synthetic bold. (Same as the original)
  - Registering a face discards only the baked text within that name and character range. (original invalidateFontFaces) ShadowText also rebakes when a font is registered
  - Fallback fonts: on desktop, when a character not in any registered font appears, loads and uses the system fonts in EngineConfiguration.fallback_font_paths from the front. (In place of the original browser's system font fallback) On the web, characters not in the registered fonts are drawn as browser system font pieces. Combining marks are drawn with a face that has the whole cluster
  - On the web, ShadowText and DynamicFont bake with the browser system font even without font bytes. (Previously drew without the shadow)
  - Added actual_bounding_box_left, right, ascent, descent to TextMetrics
  - Line wrapping (Text.wrap_text_to_lines): splits at spaces, between words (CJK and Thai without spaces), then grapheme clusters, in the same order as the original. Words use ICU4X (icu_segmenter) on desktop and the browser Intl.Segmenter on the web like the original. A run of Hangul is its own word, as in the browser. split_graphemes, split_words, segment_words, count_graphemes, find_grapheme_prefix_length, wrap_text_to_lines_with (takes a measuring function)
  - Visible character count (set_visible_character_count) and Typewriter count in grapheme clusters. (Emoji sequences and combining marks are not split) Typewriter's character reveal notification receives (&str, index). (This changes the public API) Added set_visible_character_count, get_visible_character_count to UILabel
  - Text: measure_wrapped_size(TextWrappedSize), calculate_intrinsic_content_size, calculate_text_bounds (original measureWrappedSize, getIntrinsicContentSize, calculateTextBounds)
  - ShadowText: get_font_family, get_font_size, is_bold
  - DynamicFont, GlyphInfo (misc/dynamicfont.rs, original misc/dynamicfont.js): bakes characters together into a single atlas and draws them as cut-out pieces. build_atlas, rebuild_atlas, draw_text, measure_text, get_glyph, clear_atlas
  - uifont (misc/uifont.rs, original misc/uifont.js): registers font subsets for multiple scripts under one name with their character ranges, places the selected language's group right before Latin, and downloads only the subsets for characters to be used. load_ui_font, update, apply_ui_font_group, load_ui_font_text, request_ui_font_text, is_ui_font_ready, read_ui_font_face, build_ui_font_string, configure_ui_font(UiFontOptions), read_ui_font_family
  - languagepack (misc/languagepack.rs, original misc/languagepack.js): language list and language tables as asset JSON. load_language_list, load_language, apply_language_setting, update, is_loading, match_language_tag, resolve_language_code, translate, format_text, read_text_direction, isolate_text, mirror_layout_x, read_layout_text_align, read_all_texts, set_language_paths, set_document_title_key (tab title and html lang on the web, window title on desktop), set_language_loaded_handler, set_language_list_from_json, set_language_texts_from_json
  - Color::from_cache: instead of clearing everything beyond 1024 entries, discards the least recently used first, like the original. get_cached_color_count
  - Localization: treats the whitespace around the slash in named placeholder groups as any whitespace character, like the original
  - New dependencies: rustybuzz, unicode-bidi, unicode-segmentation, icu_segmenter (desktop). The web wasm grew (uigallery after wasm-bindgen 1.14 MB → 1.93 MB, gzip 0.40 MB → 0.68 MB)
- Aligned core, platform and foundation with vanilla.js. (What the original had and the Rust version lacked, and what was ported differently. General-purpose features that existed only in the Rust version were also added to vanilla.js)
- Changed SoundSystem to the original usage. (This changes the public API) SoundSystem::new(engine, sound_table), update(), play_effect(sound_id, volume, pan), play_music(sound_id, fade_seconds, is_resumed) do not take the engine and time. Music and effect volumes follow with a 0.05 second time constant like the original, the same-sound interval and re-waking are counted on the wall clock, and fade-outs and the paused position of music on the AudioContext clock. Calling fade_out_effects again on effects that are fading out starts a new fade from the current volume and removes them from the list. (They are not counted by stop_effects or the voice limit) Background music is not played if its first file failed to load. Added load_sound, get_external_mute_provider, get_autoplay_allowed_provider (providers are Rc<dyn Fn() -> bool>), get_audio_manager, and the shared sound set_sound_system, read_sound_system. Removed set_page_hidden and fade_out_music, which existed only in the Rust version. (Same via engine page events and play_music("", seconds))
- AudioManager: Clone (a handle to the same AudioContext), get_context_time, get_audio_context, is_context_running made public. AudioPlayer: get_audio_context. get_audio_context_time in the audio backend
- math: original names floor, ceil, sqrt, abs, sin, cos, tan, asin, acos, pow. round leaves infinity as is like the original. (Previously NaN)
- Color: to_rgba_string, to_hex_string (appends alpha only when it is below 1 like the original, renamed the Rust version's to_hexstring to the original name), from_hex_cached. Version: get/set accessors, get_version_string. TransformMatrix: copy_from, renamed write_to_array to the original name write_to_float32_array
- The desktop render pixel ratio cap actually takes effect. Draws at the reduced size in the bottom left of the default framebuffer and stretches it to the window size at the end of the frame. (platform/desktop/renderscaler.rs) Changing the cap readjusts on the next frame
- EngineConfiguration: auto_resize_on_window_resize (web, when off the page's canvas size, on by default in the Rust version), preserve_drawing_buffer (web context), ignore_virtual_keyboard_resize (web on-screen keyboard), max_canvas_aspect_ratio (on the web shrinks the canvas and centers it like the original, on desktop draws in the center of the window and leaves the rest black). The web uses the visualViewport size
- Desktop page events: combines window occlusion, minimization (size 0, is_minimized) and app suspension to emit Hidden and Visible (+ on_page_visibility_restored). (Windows reports it as minimization) On waking from system sleep (the wall clock advanced more than 2 seconds beyond the monotonic clock), on_page_process_restored
- On desktop, page query values are environment variables in upper snake case after VANILLA_. (VANILLA_SAFE_AREA=44,0,34,0, VANILLA_QUALITY=lite) Input coordinates are converted with the window's scale factor. (Independent of the render size)
- ViewManager: convert_client_to_view, get_client_native_size. read_canvas_client_position, read_client_native_size, save_capture_file in the platform layer
- Input: like the original, any mouse button is touch at first, and set_touch_from_left_button_only limits it to the left, set_context_menu_prevented (web right-click menu), find_touch_point, is_touch_button. touch_moved is set on press and cleared on release like the original. (Previously cleared every frame) Scene and TouchRecognizer check the release first in the original tickTouch order, and do not pass Moved on the press frame. When the window loses focus, it is passed as a release. On desktop, leaving the window does not break a drag
- Scene: finalize, unload hooks (on unload, in the order finalize, unload, destroy), scene touch hooks touch_press, touch_move, touch_release, touch_cancel, touch_wheel (the engine calls them after tick in the original order). Engine.unload_scene also accepts &SceneBase
- Engine: the first frame number is 1 like the original, request_frame_capture (passes PNG bytes, FrameCaptureHandler), web screen capture set with the URL query capture, captureName, captureExit and saved as downloads like the original, remove_page_event_listener, resize, get_canvas, is_text_input_focused, request_asset_bytes_with_cache
- Nodes: from the original Node, set_parent, remove_child, remove_child_at, remove_children, remove_child_by_name (only detaches, does not destroy), find_child, find_child_recursive, find_child_recursive_by_name, is_root, is_leaf, has_parent, has_child, get_child. From the original TransformNode, global get/set_position, get/set_scale, get/set_rotation, get_opacity (NodeTree). get_or_add_component, get_components. Component.require (RequiredComponent, attached with default values if missing before attaching), detach (called by remove_component)
- AssetLoader: decodes downloaded images to check them like the original, and puts broken ones in the failure list. Decoded images are kept in the handle (AssetLoadHandle.get_decoded_image), so ImageAsset does not decode them again
- TextAsset, JsonAsset: set_no_cache, is_no_cache (cache: no-cache of web fetch). FontAsset: load_font_from_bytes, load_font_from_bytes_with_descriptors (original loadFontFromBytes, font face descriptors as is)
- SpriteAtlas: search atlas list add_search_atlas, remove_search_atlas, clear_search_atlases, find_frame, apply_search_frame (Rc<RefCell<SpriteAtlas>>), get_page_images
- BuildInfo: new() and set_version_json_path, is_loaded (false before load), read_meta_text is an instance function, the build-time version via set_package_version. (This changes BuildInfo::new(version))
- PointerCursor: get_button_cursor_name, get_default_cursor_name, is_coarse_pointer. FrameProbe: functions returning the settings. Platform: is_coarse_pointer, get_safe_area_rect, get_resouce_usage (original name as is). Identifier (original sequential number, reset goes back to the initial number, a bug where the original did nothing)
- Localization.text_named: accepts tabs and line breaks too as whitespace around the slash, like \s in the original regular expression. WebSocketClient.disconnect: only requests the close like the original and treats it as disconnected on the next tick
- Added finalize, unload, on_page_process_restored, on_page_visibility_restored and the scene touch hooks (touch_press, touch_move, touch_release, touch_cancel, touch_wheel) to the GameScene, UIScene traits, and game_scene!, ui_scene! forward them to the same functions of Scene. (What subclasses of the original GameScene, UIScene overrode)
- Callback getters (original names): UIButton.get_click_event, get_pressed_event, get_released_event, get_clicked_event, get_hover_event, UISlider.get_value_changed_event, UIToggleButton.get_toggled_event, ButtonMotion.get_lit_handler. The given callback is stored in an Rc<RefCell>, and the getter returns that Rc. The caller borrows it with borrow_mut and calls it. (The set side still takes a Box) The engine also holds another clone of that Rc when calling, so a callback may set a new event, and calling the same event again while it is being called is skipped. GameSceneBase.get_loading_drawer (previously an uncallable &Box) and WebSocketClient.get_receive_event (previously a &mut from &mut self) were changed to the same form
- AudioBus (added to the original in the same shape): AudioManager.create_audio_bus, AudioBus.create_audio_player (a player that plays through that bus), set_volume, get_volume, mute, unmute, is_muted, is_available, get_gain_node (web only). On desktop it is a sub-track under the kira main track (tracks of players created from the bus go under it), on the web a GainNode connected to the output. Volume and mute follow the same rules as AudioPlayer
- LocalStorage.get_backend, PersistedStore.get_storage_backend (original getBackend, getStorageBackend): return the swapped-in storage as Rc<RefCell<Box<dyn LocalStorageBackend>>>. In exchange, has_backend, has_storage_backend above were removed. (Check with get_backend().is_some()) Calling LocalStorage while the retrieved storage is borrowed uses the default storage
- SafeAreaInsets { top, right, bottom, left } (the original's insets object): ViewManager.set_safe_area_override, get_safe_area_insets, GameSceneBase.set_safe_area_insets, calculate_safe_area_rect take and return this instead of a [top, right, bottom, left] array. GameSceneBase.calculate_play_area_reference_length(fixed_length, is_landscape, canvas_native_size, safe_area_insets, inset_scale) takes insets in view coordinates and the canvas unit scale like the original. (Previously an inset array with the scale already multiplied in)
- Changed the default of EngineConfiguration.auto_resize_on_window_resize to off like the original. Turn it on to fit the canvas to the window on the web. (The examples and README turn it on, desktop always fits)
- Platform.get_resource_usage: added the correct name. The old name get_resouce_usage remains as an alias that calls the same function. (getResourceUsage was also added to the original)
- Color: From<&str> goes through from_cache like parseColorValue of the original Graphic. from_hex_cached, like from_cache, also discards the least recently used entries beyond 1024. (Previously cleared everything at 1024, the same rule was added to the original fromHEXCached) Both caches find the least recently used entry directly without scanning
- UIToggleButton.get_clicked_event: returns the toggle button's internal click handler like the original (getClickedEvent inherited from UIButton). Calling it flips the on state and calls the toggled event and the clicked event
- Web: toon 3D restores the previous GL state like the original. The glow web context panics when reading a binding while nothing is bound (null), so until now the web did not read the previous framebuffer and restored to the default framebuffer. The web platform layer also holds the WebGL2 context and checks for null first (platform::is_gl_binding_present), reading with glow only when something is bound. (read_framebuffer_binding, read_texture_binding, read_program_binding, read_vertex_array_binding of core::graphic, re-exported by graphics3d)
  - end_shadow_pass of ToonRenderer and end_line_ids, draw_outline of ToonScreenOutline restore the previous framebuffer on the web too. The restriction that the shadow pass had to come before ToonPostProcess.begin on the web is gone. ToonScreenOutline also restores the previous texture after building the line buffer
  - ToonRenderer, ToonScreenOutline, ToonVfx restore the previous shader program and vertex array like the original. (Until now even desktop left them unbound)
  - Fixed the panic, for the same reason, when Graphic read back the pixels it placed from a texture (ShadowImage) while the default framebuffer was bound on the web
  - Example toonshowcase: draws the shadow pass after binding the HDR target (ToonPostProcess.begin). Shows end_shadow_pass returning to the HDR target the same way on desktop and web
- ToonInstance.line_id: per-instance screen-space outline id. (original instances[i].lineId, None uses the common id, ToonRenderer does not read it) ToonInstance::default() (identity matrix, white tint, no id). Removed the line_id_list argument of ToonScreenOutline::draw_mesh_instanced. (This changes the public API, same usage as the original) Code that builds ToonInstance as a struct literal gives line_id or appends ..ToonInstance::default(). Updated the examples toonfx, toonshowcase, toonview
- Color emoji: bakes a font's color glyphs in their own colors. (core/colorglyph.rs, until now desktop showed them in black and white or blank because fontdue cannot draw color glyphs) Like the original (browser Canvas2D), bakes them in their own colors among white glyphs, and the text color is multiplied in when drawing
  - Bitmaps: PNG and premultiplied BGRA from sbix (Apple Color Emoji) and CBDT/CBLC (Noto Color Emoji bitmap version). Among the strikes that have the glyph, picks the smallest one at or above the font size and downscales it with area averaging. (Apple Color Emoji has glyphs missing in some strikes)
  - Outlines: COLR/CPAL v0 and v1. Receives them through ttf-parser's Painter and paints them directly with an area accumulation rasterizer, solid, linear, two-circle radial and sweep gradients (Pad, Repeat, Reflect), transforms, clips and 28 composite modes. Like Chrome, does not draw OT-SVG
  - Same as Chrome: synthetic italic is applied to color glyphs too, synthetic bold is not. When baking as an outline (Stroke), color glyphs are placed in their colors without a border. ShadowText multiplies emoji only by the alpha of the text color, and the shadow follows the emoji shape too. The DynamicFont atlas also bakes color glyphs in their own colors. (Confirmed with Chrome Canvas2D on Mac)
  - Face selection: emoji presentation sequences (VS16 FE0F, Emoji_Presentation, skin tones, flags, keycaps, tags, ZWJ sequences) prefer a face with color glyphs, and others (bare ❤, VS15) prefer a non-color face. Chrome too, when the specified font has a monochrome ❤, draws ❤️ with the color emoji font and bare ❤ with that font. On the web, if the registered font has no color glyphs, emoji presentation sequences are left to browser pieces (color emoji). (textshaping::is_emoji_presentation, enabled the emoji feature of unicode-properties)
  - Fallback fonts: added C:/Windows/Fonts/seguiemj.ttf, /System/Library/Fonts/Apple Color Emoji.ttc, /usr/share/fonts/truetype/noto/NotoColorEmoji.ttf to the defaults of EngineConfiguration.fallback_font_paths. When a candidate is added, only the table directory in the file header is peeked to note whether color glyph tables (sbix, CBDT, COLR) are present, and emoji presentation characters load color candidates first, other characters non-color candidates first. (The roughly 190MB Apple Color Emoji is not loaded for CJK characters)
  - GlyphRaster.color_pixels, TextRaster.color_pixels (the color glyph portion, premultiplied RGBA). coverage is the coverage of the text excluding color glyphs. The structs gained fields, so code that builds them directly must be updated
- Aligned the core and platform share of the final comparison with the original.
  - Scenes: on load, right after create, fits the root to the view size like the original Scene.load. (Position 0, top-left pivot, content size is the view size) After the tracked assets have all finished, shows the loading screen (draw_on_load) for 0.3 seconds more like the original SceneManager.loadScene, then calls initialize.
  - Made Engine.get_all_loaded_scenes (original SceneManager.getAllLoadedScenes, SceneId handles instead of scenes), SceneBase.has_ever_touched (original Scene.hasEverTouched), Engine.dispatch_page_event public.
  - Tween: ends without callbacks like the original when the target node is detached from the node tree it first ran in (when the topmost node changes). (Previously ended only on destroy) Tween::find_root_node (original Tween.findRootNode)
  - Web maximum FPS: sets the slot by the number of frames since counting started, like the original. (platform/framelimiter.rs, 60 FPS no longer becomes 45 at 90 Hz)
  - Web exit_application: tries Capacitor's App.exitApp, or window.close if absent, like the original. (platform::exit_application)
  - Web GL context: forgets the GL state cache on the canvas webglcontextlost, webglcontextrestored like the original WebGLStateCache. (reset_gl_state_cache)
  - Desktop Engine.is_text_input_focused: was always false, now reflects the focus of engine input fields. (Same as InputManager.is_typing_in_text_field)
  - Clipboard: Engine.read_clipboard_text_with_callback (in place of the then of the original readClipboard, after navigator.clipboard.readText on the web, immediately on desktop). Calling web UIInputField.paste from code also reads and pastes asynchronously like the original. (Previously did nothing on the web)
  - Desktop image cursors: builds the images of PointerCursor.register_image_cursor into a winit CustomCursor. (1x image on Mac, on Windows and Linux scaled by the window scale factor, using the 2x image if present) CursorValue gained image_url, image_url_2x, hotspot_x, hotspot_y, and platform::set_cursor takes a CursorValue.
  - Desktop keys: maps winit's SuperLeft, SuperRight to W3C MetaLeft, MetaRight, and winit's Meta to Super.
  - KeyCode: added the original's punctuation (SEMICOLON etc.), SCROLLLOCK, META, COMMAND, PAUSE, 7 audio keys (AUDIOVOLUMEUP etc.), NUM_LOCK, 16 numpad keys (NUMPAD_DIVIDE etc., NUMPAD0 ~ NUMPAD9) and the original names ARROWLEFT, ARROWUP, ARROWRIGHT, ARROWDOWN. (LEFT and the like are kept)
  - Fixed an original bug together: the mute key value "AudioMute" is not a name in the W3C code table, so pressing the key did not match. Fixed to "AudioVolumeMute".
  - Gamepads: on the web, instead of gilrs, reads navigator.getGamepads() directly like the original and receives all buttons and axes the browser gives (previously cut to 17 and 4), with connection and disconnection via gamepadconnected / gamepaddisconnected. On desktop, after the standard 17 buttons and 4 axes, appends the buttons and axes that gilrs could not map to the standard layout, in the order they are first moved. (gilrs does not give the device's button list, so they appear only after first being moved) The state slots grow when the button or axis count grows. gilrs is now a desktop-only dependency.
  - Steam Deck: on desktop Linux, the environment variable SteamDeck=1, or DMI board_vendor Valve with board_name Jupiter, Galileo, gives PlatformType::SteamDeck.
  - Desktop Platform.get_resource_usage: was empty, now filled with files the engine read as assets (asset byte reads, Engine::load_image, audio files, image cursors). (Kind "file", transfer size and decoded size are the file byte count)
  - Windows wake from sleep: instead of the clock difference check (on Windows the monotonic clock keeps running during sleep, so it did not work), subclasses the window to receive PBT_APMRESUMEAUTOMATIC of WM_POWERBROADCAST and calls on_page_process_restored. (platform/desktop/windowsplatform.rs, windows-sys 0.52 dependency on Windows only) Mac and Linux keep the clock difference check.
  - Desktop is_coarse_pointer: on Windows, ported Chromium's (pointer: coarse) check. (True when in tablet mode or when there is only touch and no mouse) On Mac it is always false, as in Chromium, and on Linux it was false at first because the device list could not be read. (Fixed later, see the Linux entry below)
  - FiniteStateMachine: a transition requested inside a handler with StateChangeRequester.change_state, obtained via get_state_change_requester, is carried out in order after that handler finishes. (Previously could not transition inside a handler)
  - format: a locale not in the table uses the system language (web navigator.languages, desktop the first of LANGUAGE / LC_ALL / LC_MESSAGES / LANG), as the original uses the browser default locale, and en-US if that is not in the table either.
  - Color: create_from_hex, like the original createFromHEX, requires #, reads #rgba, and reads each two digits the parseInt way. to_hex_string, to_rgba_string do not clamp components outside 0 ~ 1, like the original.
  - TimeManager.set_time_scale: accepts negative values as is like the original. (Previously clamped to 0)
  - EngineConfiguration.rebake_text_on_font_load (original rebakeTextOnFontLoad, off by default): only when on, registering a font face discards strings baked with that face's characters. (Previously always discarded)
  - NodeTree.get_world_corners, get_world_bounds (original WorldNode.getWorldCorners, getWorldBounds)
  - Cooldown.r#use, FullscreenPass.r#use, ShaderProgram.r#use: use the original name use as is with r#. activate, use_program remain as names that do the same thing.
- Aligned the UI, effect, animation and 3D share of the final comparison with the original:
  - GameSceneBase: like the original, when the tracked assets excluding the loading gate have all finished (if progress has ever been reported), fills the progress to 1. (complete_loading_progress_if_assets_finished, previously 1 only when the tracked AssetLoader finished) SceneBase::are_tracked_assets_finished_except, AssetLoadHandle::is_same_load
  - DevTools: writes clientNativeSize in Statistics from ViewManager::get_client_native_size, and web memory from Chrome's performance.memory like the original. ((N/A) on desktop and browsers without it) set_ui_document, get_ui_document_mut attach the UIDocument in which the game registered its components to the inspector
  - UIDocument: writes and reads ShadowText including TextDirection, Italic, Underline, Strikethrough, like the original reflection-based save. create_component(tree, node, name), in place of the original getComponentType, builds and attaches the component of that name
  - UIConfirmWindow: for right-to-left languages, sets the Rtl direction on the title and message like the original. (Otherwise Inherit, at the next layout) set_right_to_left_in_tree applies the text direction immediately like the original
  - UIScrollView::set_shows_vertical_scroll_bar_in_tree, set_shows_horizontal_scroll_bar_in_tree: create the scroll bar node on the spot, turn it on or off, and return the handle, like the original
  - UIInputField: counts character positions in public functions (get_cursor_index, get_selection_start, get_selection_range, move_cursor, measure_index_at_local_x) and max_length in UTF-16 units like the original. (The counting of the public API changes. Hangul is the same, and only characters such as emoji differ) Internally it holds positions per char and does not split surrogate pairs. The count now matches maxlength of the web DOM
  - Timeline: handlers receive the timeline itself like the original. Event (target name, event name, key, &mut Timeline, &mut NodeTree), marker (marker name, marker, &mut Timeline, &mut NodeTree), complete (&mut Timeline, &mut NodeTree). pause, seek can be called inside handlers. (This changes the public API)
  - Timeline: TimelineTarget::External holds an Rc<RefCell<dyn TimelinePropertyTarget>>, and evaluate calls set_timeline_property on the spot like the original. Removed apply_external_properties. get_external_properties holds the values applied by the last evaluate. TimelineTarget is not Copy, Eq. (This changes the public API, the order of applying values on the final tick and of the complete handler also matches the original) The example timelineshowcase holds ScreenEffect in an Rc<RefCell>
  - Timeline: applies text properties (text, number, fontSize, visibleCharacters, color) to RichText nodes too, like the original. data: URLs of stage sprites first decode the percent-encoding in the body like the browser, and are read even without ;base64. emit events emit at the node position at that moment
  - ParticleSystem::emit_in_tree(tree, node, count, offset), set_node_position: in world space, emits at the node position at the time of emitting, like the original. (Calling only emit uses the position read on the last tick)
  - 3D URL functions on both desktop and web like the original: FbxLoader::load_from_url(engine, asset path) → FbxLoadHandle (get_scene_data), SkinnedModel::load_from_url, load_from_fbx_url → SkinnedModelLoadHandle (create_model(gl, renderer)), SkinnedModel::add_animations_from_fbx_url(engine, path, clip name, ignore translation) → FbxLoadHandle (adds the clips on the next update or play_animation once downloaded), Material::load_image_description(engine, path, options) → ImageDescriptionLoadHandle (get_image_description, mime_type from the extension via Material::find_image_mime_type). Uses the engine's asset download, from the asset folder candidates on desktop and from asset_base_url on the web. Download handles can be tracked with SceneBase::track_load_handle. Removed load_from_path, load_from_fbx_path, add_animations_from_fbx_path, which read relative to the current folder on desktop, and the path-taking load_image_description. (This changes the public API) The example modelviewer loads with the URL functions
- Desktop capture mode (VANILLA_CAPTURE_PATH) runs with the window hidden. No window appears on the user's screen when verification tools capture examples. A hidden window has no redraw requests or vertical sync, so it runs frames directly in about_to_wait, and without a maximum FPS matches the speed of a visible window at the monitor refresh rate (60 if unknown). Occlusion notifications are ignored. On Mac it also takes no Dock icon or focus (activation policy Accessory). To see the window, VANILLA_CAPTURE_SHOW_WINDOW=1. (Confirmed by capturing toonshowcase, uigallery, textshaping hidden on Mac)
- Desktop AudioContext suspension now works like the original suspend. When creating the context, places a root track (in place of the original destination) under the main track and hangs players, buses and beeps under it, and on suspend stops the root track with kira pause. Sounds stop where they are and continue when resumed, the context clock (get_context_time) also stops, and is_context_running is false. (Previously the main track was only muted, so sound and the clock kept running and it always reported running) AudioPlayer.play wakes a suspended context before playing, like the original
- Made AudioPlayer::new(audio_manager, output_node), AudioBus::new(audio_manager) public. (original new AudioPlayer(audioContext, outputNode), new AudioBus(audioContext)) The output (platform::audio::AudioOutputNode) is &AudioNode on the web and kira &mut TrackHandle on desktop. AudioBus::get_gain_node lends the bus track (RefMut<TrackHandle>) on desktop too. (This changes the public API: the audio backend's create, is_audio_context_running, play_beep_tone take the manager state)
- SoundSystem: picking from a group and pitch variation use math::random (seeded by time), in place of the original Math.random, instead of a fixed seed (SeededRandom 0x50f7). Changed SoundRow.maximum_voices to Option<usize>. (This changes the public API) None allows up to the overall effect count, Some(0) plays only one like the original. (Previously 0 meant 12)
- Desktop sound files: enabled kira's flac, isomp4, aac features to also read FLAC and M4A (AAC). (New crates: symphonia-bundle-flac, symphonia-format-isomp4, symphonia-codec-aac 0.6.1)
- BeepPlayer computes the desktop waveform the same way as Chrome WebAudio OscillatorNode (PeriodicWave). Band-limits by blending between two tables whose Fourier coefficients are trimmed every 1/3 octave, and normalizes the amplitude by the peak of the table with all harmonics. The maximum difference from oscillators rendered with headless Chrome OfflineAudioContext (square, sawtooth, triangle, sine, 150 / 440 / 1000 Hz, 2048 samples) is 0.0003. (Previously square and sawtooth waves without band limiting)
- WebSocketClient: opens wss:// on desktop. (ewebsock's tls feature, newly pulls in rustls 0.23 and ring 0.17. Sets the rustls crypto provider to ring when connecting) Made receive_message (original receiveMessage) public
- CameraGestures follows the original rules: going from two fingers to one continues the gesture until all are lifted (the movement is not used), and the reference is reset when the finger count changes. set_thresholds takes a fourth argument (milliseconds to ignore emulated mouse events, initially 800). (This changes the public API) Added is_touch_input (initially whether the device's primary input is fingers), is_coarse_pointer, is_last_wheel_ctrl. The initial value of InputManager.is_touch_input is also whether the device's primary input is fingers
- AssetLoader.add_font takes FontFaceDescriptors (weight, style, character range) instead of a weight and passes them to register_font_face_when_loaded. (original addFont descriptors, this changes the public API)
- JsonAsset: JSON that fails to parse is treated as not loaded, like the original. (is_loaded false, included in AssetLoader's failure list) Added get_text (text of the original TextAsset), and get_data is called with &self
- PersistedStore: read_stored_text made public. Merging like the original Object.assign: arrays (even when the stored state is an array) are merged by index keys, and key order puts integer-like keys first in ascending order, like JS objects. (Previously an array state gave the default)
- LocalStorage: converts numbers to text and reads text as numbers exactly like the original String(number), Number(text). Values of 1e21 or more and 1e-7 or less are written in exponent form like 1e+21, and 0x, 0o, 0b notation, "1.", ".5" and JS whitespace are read like the original. (Compared against values printed with node)
- Localization.detect_language, the device language of languagepack: on desktop reads the system preferred language order with sys-locale 0.3. (Windows and Mac too, like the original navigator.languages, previously only environment variables like LANG were read, so Windows always got the default language)
- GraphicsQualityGovernor.apply_search_text decodes + and %XX and skips empty pieces like the original URLSearchParams
- Added hooks push_transform, pop_transform to components, around the node's draw state. (Called wrapping its own components, children and gizmos, in place of the original nodes overriding pushTransform, popTransform) With these hooks TouchEffect draws its children too with additive blending, like the original. (Previously only its own particles)
- Graphic blend modes: correctly draws the 17 modes that were drawn as source-over instead. All 26 BlendMode modes now work (same behavior as the original, same shader source)
  - SourceOut, SourceAtop, DestinationAtop, Xor are set with blend_func using the Porter-Duff coefficients of W3C Compositing and Blending Level 1 as is
  - Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity copy only the area to be drawn (the bounding box of the vertices) from the current framebuffer with blit_framebuffer into a buffer of the same format at the same position on each draw and blend in the shader. The formulas follow W3C as is (separable blending, non-separable blending, Cs' = (1 - αb) x Cs + αb x B(Cb, Cs) followed by source-over compositing) and are also correct on render targets with backdrop alpha (RGBA8, RGBA16F). Since it copies to the same position, it also works on the multisampled default framebuffer on desktop. Darken, Lighten blend in the shader because blend_equation MIN / MAX differs from the W3C formula for translucent pixels
  - Shader blend modes are not batched. One area copy and one draw call per draw (on M2 Pro with 1000 64x64 images, about 0.062 ms per draw on desktop and 0.061 ms on the web, mostly the cost of the copy breaking the render pass. Drawing source-over unbatched takes 0.002 ~ 0.004 ms)
  - Images, shapes, text, nine-slice, clipping, particles, and swapped-in shaders (ShaderSprite) all work. Particles are grouped into mutually non-overlapping quads that are copied once and drawn, so each quad blends over the previous quads. Swapped-in shaders are first drawn into an overlay buffer (RGBA16F on desktop, on the web RGBA16F when EXT_color_buffer_float is available, otherwise RGBA8) and then blended while being transferred
  - The path that used source-over for unknown modes and its warning are gone. (BlendMode is an enum, so there are no unknown values)
  - Comparing the same scene as Chrome Canvas2D (translucent images, rectangles, polygons over multicolored backgrounds) across the 26 modes, the difference inside shapes is within 2 levels. The web build matches the original engine down to the pixel, and desktop matches inside shapes and differs only in edge antialiasing. Canvas2D also clears outside the drawn shape for SourceIn, SourceOut, DestinationIn, DestinationAtop, Copy, whereas Graphic changes only the inside of the shape like the original
- Graphic: does not write alpha when drawing to the default framebuffer on desktop. In the original and on the web the canvas is alpha: false, so screen alpha is always 1, but the desktop default framebuffer has alpha, so after modes that lower alpha (SourceOut, Xor, DestinationOut and the like), modes using DST_ALPHA and shader blending came out differently from the web. (Drawing an image with SourceOut and then a rectangle in the same cell showed the rectangle only on desktop) Alpha is still written on render targets, and when handing GL out (get_gl, run_external_pass, end of frame) the mask is restored to write everything
- Extends toon post-processing, effects, and the camera so that Aberrant and Exoplanet Miner can use the engine as is. (Same API and same shader source as the original vanilla.js, with new options at their defaults the output is identical to the current screen down to the pixel, game recipes and color values are taken as parameters)
- RenderTarget: sample_count in RenderTargetOptions (2 or more draws into a multisample renderbuffer and resolve() resolves into each color texture and the depth texture, reduced to within MAX_SAMPLES and, on the web, the sample count each format accepts, without multisampling if unsupported or incomplete, desktop GL 3.3 has no per-format query so only MAX_SAMPLES) and depth_bits (16 or 24), get_sample_count, get_resolve_framebuffer, read_supported_sample_count. Places that built options as a struct literal append ..RenderTargetOptions::default(). read_renderbuffer_sample_counts (the WebGL2 SAMPLES list) in the web platform layer
- BloomEffect.set_use_float_color(gl, enabled): builds the ping-pong buffers as RGBA16F (default stays RGBA8)
- MultiLevelBloomEffect: multi-level bloom. (Same shaders as the original, half-size extraction with a soft knee, dual filter downsampling, tent filter upsampling, set_level_count, set_threshold)
- ToonPostProcess: new_with_options(gl, width, height, ToonPostProcessOptions { sample_count, use_float_color, depth_bits, use_depth_texture }) (new uses the default options), is_float_color_supported (devices that cannot use it take the RGBA8 LDR path), set_sample_count, set_resolution_scale, set_bloom_levels, set_bloom_float_color (these four take gl and return Result), set_brightness, set_lit_area and clear_lit_area, get_sample_count, get_use_float_color, get_resolution_scale, get_bloom_level_count. The color space convention in the header (the scene buffer is linear, porting gamma-encoded float buffer values is c^2.2, brightness multiplier k^2.2)
- Camera3D.set_matrices(view, projection): uses the raw matrices computed by the game as is. Extracts eye, target, up and whether it is orthographic from the matrices, and project_to_view, unproject_to_plane, read_view_depth and the renderer run on those matrices. has_raw_matrices, clear_raw_matrices. set_perspective, set_orthographic and look_at discard the raw matrices. One test
- ToonVfx: options age (an effect seen late starts from that age) and key (event key, a number or text in the original, u64 in the Rust version, clear forgets it, register_event_key) for particles, fireballs, shockwaves, marks, plumes, lightning and flashes, set_look_gain and get_look_gain, set_glint_capacity and get_glint_capacity (default 96), ToonVfxDecalMode::Stain, Sheen, Shade and mark flicker, queue_blob_shadow(ToonBlobShadowOptions), rim for fireballs, shockwaves, ribbons, lightning. Fields were added to the option structs, so build them with ..Default::default(). One default value test
- Getters that the original had and the Rust version lacked: ShadowImage.get_image, get_image_rect, get_bake_image (original getBakeCanvas), ShadowText.get_bake_image, SoftShade.get_color, get_fade_width, get_bake_unit, get_bake_maximum_size, get_bake_image
- slice_graphemes(text, count) (original sliceGraphemes, up to count grapheme clusters from the start, exported from the crate root)
- Graphic.set_image_smoothing_quality, get_image_smoothing_quality, ImageSmoothingQuality(Low, Medium, High, initially High. Only stored, like the original), get_vertex_array, get_vertex_buffer, get_vertex_data (vertex array, buffer and scratch array of the default drawing)
- create_guid() (createGUID of the original base/reflection.js, UUID-shaped text whose first 12 digits are the time in milliseconds and the rest random, exported from the crate root)
- Chains the desktop default font as a sequence of names like the original SYSTEM_FONT_STRING. (Previously only the first readable file among the candidate paths was used, so on Windows even Latin came out in Malgun Gothic) Finds -apple-system, Segoe UI, Roboto, Apple SD Gothic Neo, Malgun Gothic, sans-serif among the OS fonts, and draws characters missing from an earlier font with a later one. On Mac, Latin is SF (the system UI font) and Hangul is Apple SD Gothic Neo, and on Windows, Latin is Segoe UI and Hangul is Malgun Gothic. A face is loaded the first time text of that weight and style is used. (TextStringTextureCache.set_system_font_chain)
- Unregistered names in font strings are also looked up among the OS fonts. ("16px Menlo", "16px Helvetica" are drawn with system fonts, same as the browser) Generic names match Chrome's default fonts: on Mac sans-serif Helvetica, serif Times, monospace Courier, on Windows Arial, Times New Roman, Consolas, and on Linux fontconfig chooses
- Desktop fallback fonts: the OS chooses instead of 13 hardcoded files. Mac CoreText CTFontCreateForString (from the system UI font), Windows DirectWrite IDWriteFontFallback.MapCharacters (user language), Linux fontconfig (FcFontSort containing the character), the same APIs as Chrome, where the original runs. When bold is requested, a bold fallback face is queried separately. Emoji presentation characters check the color emoji font first. (platform/desktop/systemfont.rs: find_family_font_file, find_fallback_font_file, TextStringTextureCache.set_system_font_fallback_enabled)
- Changed the defaults of EngineConfiguration.default_font_paths, default_bold_font_paths, fallback_font_paths to empty lists. When empty the OS finds fonts as above, and when given those files are used as before. default_font_paths chains all readable files in order, and default_bold_font_paths holds the bold file for the same position. (Code that read the default path lists must be updated)
- Mac and Linux bold fonts and TTC: font collections (TTC) choose the face index by PostScript name or by weight and style. (textshaping::find_collection_face_index, the real Bold of Mac Apple SD Gothic Neo is used) Variable fonts (wght axis, Mac SF) produce the weight through axis values. (read_weight_variation) Outlines of variable fonts are obtained and drawn with skrifa. (fontdue cannot read axis values, and ttf-parser and fontdue cannot draw the outlines of Mac SFNS, which has more than 32 variations per glyph) LoadedFont.create_from_shared_bytes(bytes, face index, axis values), get_shaping_face, get_font_bytes, get_face_index, is_outline_raster, read_glyph_metrics, draw_glyph_outline. The LoadedFont.shaping_face field was replaced by get_shaping_face()
- Font unloading: LoadedFont holds the font bytes together with the rustybuzz face. (self_cell, previously held with Box::leak and not freed even when unregistered) Multiple faces from the same file share the bytes (Rc)
- Values compared against Mac Chrome Canvas2D measureText: Hangul "ganadara" (U+AC00 U+B098 U+B2E4 U+B77C) at 16px 55.360, "16px Helvetica" 113.508, "16px Menlo" 154.125 are the same. (Added as tests) SF Latin is 106.672, 2.2% narrower than Chrome's 109.072. (Did not fully match the optical size and letter spacing Chrome applies to the system UI font) (Fixed later: the gap came from font selection, since Chrome treats -apple-system as an unknown name. See the SF Latin entry below)
- New crates: self_cell 1, skrifa 0.50, Mac objc2-core-text 0.3 and objc2-core-foundation 0.3, Windows dwrote 0.11 and winapi 0.3, Linux yeslogic-fontconfig-sys 6 (dlopen, not linked at build time)
- Draws Mac color emoji with CoreText. (platform/desktop/coretextglyph.rs) Like Chrome on Mac, enlarges emoji at small font sizes and shifts them down. (20px image at 16px, the font size as is from 24px) The advance is the height of the image box drawn by CoreText rounded to an integer. Matches Chrome measureText at 23 sizes from 8 ~ 128px (8px 10, 13px 16, 16px 20, 21px 23), and the image box and alpha sum at 12, 16, 20, 32, 64px match Chrome canvas getImageData. (Color sum within 0.01%) CoreText enlarges emoji only for fonts registered with the system, so the font is built by PostScript name
- Mac: fonts whose outlines are not in glyf, CFF, CFF2 are also drawn with CoreText. The Chinese fallback font PingFangUI.ttc of macOS 26 keeps its outlines in the Apple-only hvgl table, so open parsers cannot draw it. (Previously Simplified Chinese characters were blank) LoadedFont.with_source_path, is_core_text_raster, read_advance_scale, is_integer_advance
- New crate: Mac objc2-core-graphics 0.3
- Aligned desktop word segmentation with Chrome Intl.Segmenter (ICU4C dictionary). Thai, Lao, Khmer and Burmese are split by dictionary instead of LSTM. (ICU4X WordSegmenter::new_dictionary) For CJK runs, ICU4X picks the longest word first while ICU4C picks the split with the smallest sum of word costs, so Japanese differed ("今日|はい|い"). Ported the computation of ICU4C CjkBreakEngine (cost 255 for characters not in the dictionary, length costs for runs of 1 ~ 8 katakana, NFKC before dictionary lookup) and re-splits with the same dictionary of ICU4X (cjdict). 22 sentences in Japanese, Chinese, Thai, Lao, Khmer and Burmese match Chrome. (Added as tests)
- New crates: icu_provider 2, icu_collections 2 (the versions icu_segmenter already uses), unicode-normalization 0.1 (desktop)
- UIFont: when characters not fetched in advance are measured or drawn with that font, update fetches the subsets for those characters. (In the original, the browser starts fetching a FontFace registered in document.fonts when the canvas draws characters within its character range. Previously only characters requested via load_ui_font_text, request_ui_font_text were fetched) Until fetched, they are drawn with another font like the original, and rebaked once fetched. The text cache collects characters, from text measured or baked with a watched name, that fall outside the character ranges of the registered faces. (textstringtexturecache::watch_unresolved_family_characters, take_unresolved_family_characters)
- Image formats: the original Image accepts every format the browser decodes. Desktop adds GIF (first frame), BMP, ICO from the image crate, and draws SVG with resvg at the image size (width, height, or viewBox if absent). (SVG with text loads the system fonts once the first time) On the web, when downloading an asset with an image extension (png, jpg, gif, webp, bmp, ico, svg, avif), decodes it with the browser (decode of HTMLImageElement) like the original and keeps it in the handle. ImageAsset and AssetLoader use that image as is. Added Image::create_from_premultiplied_pixels
- New crate: resvg 0.50 (desktop)
- Web rasterization uses browser Canvas2D like the original: even with font bytes, does not bake with fontdue and always bakes and measures with the canvas fillText, strokeText, measureText. Registered font bytes (FontAsset, default_font_bytes, default_font_url, UIFont subsets) are added to document.fonts like the original new FontFace(name, bytes, descriptors), and the browser chooses and draws. (Within the same name later faces come first, the default font is named VanillaEngineDefault and fallback fonts VanillaEngineFallback1, 2 …, placed after the font string names and before the system fonts) When registered fonts finish loading (loadingdone), baked text is discarded at the start of the frame. (TextStringTextureCache.is_browser_raster)
- Web ShadowText: like the original bakeText, sets the shadow (shadowColor, shadowBlur, shadowOffsetY) on the canvas and bakes with fillText in the text color, and underline and strikethrough with fillRect. The margin (2 + blur rounded up) and position calculation are the same as the original. Web ShadowImage: like the original readScaledImage, bakeImage, scales down with drawImage (imageSmoothingQuality high), paints the color with source-in, then lays the canvas shadow underneath. (Desktop still computes it directly)
- ToonRenderer extension points and light model: (same API and same shader source as the original vanilla.js) standard features come first so that Aberrant and Exoplanet Miner can move onto the engine toon renderer without modifying the renderer per game, with a place to insert shader chunks only for patterns the standard features cannot do. With the new options at their defaults the screen is the same as now. (Drawing the same scene as the old renderer on the original side gives LDR pixel difference 0, and in the examples toonshowcase, toonview, toonfx the pixels of static things (floor, instanced rocks) are the same)
  - ToonLightSet(toon/toonlightset.rs): one bundle of light values. The renderer holds a default set, and set_light, set_sun_direction, set_fill_light, set_rim_light, set_specular, set_point_lights, set_point_light_limit, set_band_count, set_band_ramp, clear_band_ramp, set_light_model modify it. create_light_set, get_light_set, get_light_set_mut, ToonDrawOptions.light_set per draw. ToonPointLight, ToonLightModel, ToonBandRamp, TOON_MAXIMUM_POINT_LIGHTS 8, TOON_MAXIMUM_BAND_STEPS 8. A clone gets a new version number
  - Meaning of sun direction: the direction light travels (from the sun to the surface). The received share is max(dot(N, -sun_direction), 0). Code that used the direction from the surface toward the sun passes it with the sign flipped
  - Point light attenuation = window (1 - (d / range)^range_exponent) clamped and squared x 1 / max(d^decay, 0.01), the received share is (dot + wrap) / (1 + wrap). Defaults decay 2, range_exponent 4. decay 0, range_exponent 1 gives (1 - d / range)^2
  - Light model is_energy_normalized: ÷π and normalized Blinn-Phong (exponent + 8) / 8π
  - ToonDrawOptions: added tint_amount, glow_scale, color_scale, emissive_color, emissive_intensity, base_color_texture, emissive_texture, uv_transform, decal_texture, decal_color, decal_emission, decal_uv_transform, alpha_cutoff, blend_mode(ToonBlendMode), soft_edge, is_mirrored(if None, decided automatically from the determinant), index_start, index_count, outline_index_start, outline_index_count, material, textures(&[(uniform name, texture)]), on_before_draw(&dyn Fn(&ShaderProgram, &glow::Context, ToonProgramKind)), light_set, group, is_depth_prepassed. Code that built it as a struct literal with every field written out appends ..ToonDrawOptions::default(). Debug is implemented by hand (callbacks show only whether they are present)
  - ToonMaterial(toon/toonmaterial.rs): create_material(ToonMaterialChunks { name, uniform_chunk, surface_chunk, light_chunk, vertex_chunk }) (an options object in the original). prepare_material, delete_material, get_program(material, instance layout, ToonProgramKind). Passed to ShaderWarmer via read_material_program_sources(material, instance layout) and compose_toon_program_sources(ToonProgramSources, including attribute locations). (In place of the optional arguments of the original readProgramSources, read_program_sources stays the default program)
  - Instance layout: create_instance_layout(&[(name, size)]) → ToonInstanceLayout, create_instance_buffer(gl, layout, count, ToonBufferUsage) → ToonInstanceBuffer, update_instance_buffer, delete_instance_buffer, draw_mesh_instance_buffer(gl, model, buffer, count, layout). TOON_MAXIMUM_INSTANCE_ATTRIBUTES 3, TOON_FIRST_INSTANCE_ATTRIBUTE_LOCATION 13
  - Textures: create_texture(gl, width, height, RGBA bytes, ToonTextureOptions { is_mipmapped, is_repeated, is_filtered }), delete_texture. TOON_MAXIMUM_MATERIAL_TEXTURES 9
  - Frame: begin_frame_with_matrices(gl, view, projection), get_frame_camera, read_frame_camera(ToonFrameCamera), apply_frame_state, create_reflection_matrix, read_matrix_determinant
  - Performance: per program, frame values and the light set are uploaded only when changed
  - vertexUv(12) was added to TOON_ATTRIBUTE_LOCATIONS, so its length is 13. ToonMesh::has_uv, get_index_counts, has_outline
- ToonDrawQueue: add_pass(ToonDrawStage::BeforeOpaque | AfterOpaque | AfterOutline | AfterTransparent, callback(gl, renderer)), options group and is_depth_prepassed (draws depth only first for a translucent group, then colors only at equal depth), blend_mode other than Alpha goes to the translucent order, draw_with_matrices(gl, renderer, view, projection). Stage callbacks are held in a RefCell, so draw(&self) calls them as is. clear also empties the callbacks
- MeshBuilder: added uv_data, material_ranges(ToonMaterialRange) to ToonMeshArrays and uvs to ToonGeometry. (Code that built them as struct literals with every field written out appends ..Default::default()) create_box_geometry, create_sphere_geometry build uvs and add_part stores them. add_triangles_with_uvs (the last optional argument of the original addTriangles), add_material_range, combine joins uv_data and material_ranges
- GLB reading: TEXCOORD_0, per-primitive material ranges (material name, extras, alpha_mode, alpha_cutoff, linear colors, texture image indices), read_glb_images(ToonGlbImage), decode_glb_image (RGBA via the image crate)
- Value conversion when porting Aberrant: same as the corresponding item in the original UPDATE.md. (sign of the sun and bounce light, ÷π, specular times 8 / 56, point lights with decay 0 and range_exponent 1, readjusting light intensity and exposure instead of min(lit, 1), linear values and multipliers to the power of 2.2 instead of HDR gamma values, material ranges and UV textures instead of color keys, face screens as surface chunks)
- Made NodeTree.get_position the same as the original WorldNode.getPosition. Offsets the local position relative to the parent pivot point (parent content size x parent pivot), then applies the parent's global rotation and scale, so it matches where the draw transform (calculate_world_matrix) places the pivot point. Until now, like the original TransformNode.getPosition, it did not subtract the parent pivot, so it differed when the parent's content size and pivot were nonzero. set_position is its inverse. (Fixed together with the bug where the original setPosition did not undo the parent pivot) Inside the engine only set_position calls get_position, and UI, layout, tweens and timelines compute with the local position and the world matrix, so the example screens are unchanged
- When drawing Multiply to a render target, the area under the draw region is copied and blended in a shader per the W3C formula (B(Cb, Cs) = Cb x Cs). (Fixed together with the original) Fixed blending drops the cs x (1 - αb) term when the backdrop is translucent and leaves the alpha as the backdrop alpha, differing from Chrome Canvas2D by up to 221. The default framebuffer keeps fixed blending and batching, so the screen, draw calls and copy count are unchanged. Multiply on a render target, like the 13 shader blend modes, costs one region copy and one draw call per draw. Added scenes 6 and 7 to the blendmodes example (a translucent backdrop and scene 0 drawn into a render target cleared to transparent, then transferred over black and over white). On both desktop and web, within 1 level of the Chrome canvas inside shapes, and 0 for Multiply
- The system language Format uses in place of a language not in its table is the first entry of the shared function (localization::read_preferred_language_tags) that Localization.detect_language also uses. The "desktop LANGUAGE / LC_ALL / LC_MESSAGES / LANG" in the format line above applies to Linux. The desktop reads macOS CFLocaleCopyPreferredLanguages and Windows GetUserPreferredUILanguages through sys-locale. (On macOS, changing LANG to de_DE or fr_FR still follows the system preferred language ko-KR) Corrected the header comment of format.rs
- Aligned fonts more closely with Chrome 158 Canvas2D on macOS:
  - macOS system UI font (system-ui, BlinkMacSystemFont, SFNS): like Chrome, sets the opsz axis to the font size (clamped to 17 ~ 96 for SFNS) and adds the tracking from the trak table. Weight is applied as the wght axis value as is (including weights like 300). 16px "Hello World Wifi" is 115.867, the same as Chrome. (Previously 106.7 with the initial opsz 28 and no tracking) Within 0.004 of Chrome across 19 sizes from 8 ~ 128px and weights 300, 400, 700. Chrome applies opsz to macOS system fonts and registered fonts (web fonts), and not to Windows or Linux system fonts. Follows that as is. (Chromium font_platform_data_mac.mm, font_custom_platform_data.cc)
  - trak tracking is computed and added the way HarfBuzz 15 does, not rustybuzz. Interpolated linearly between sizes without rounding, end values outside the table, only for fonts with a STAT table, and added only to the advance of the first glyph of each cluster. (Chrome harfbuzz_face.cc gives the font size via ptem, and on macOS the advances of fonts with trak are computed by HarfBuzz) Apple Chancery, which has no STAT, matches Chrome without tracking
  - LoadedFont: with_optical_sizing_auto, read_optical_size, read_horizontal_tracking, create_sized_shaping_face. draw_glyph_outline takes the font size. (This changes the public API, since axis values differ per size)
  - The "SF Latin 106.672 vs Chrome 109.072" in the earlier entry was a value where Chrome skipped -apple-system as an unknown name and drew Latin with Apple SD Gothic Neo from the default chain. Like Chrome, -apple-system and ui-serif, ui-sans-serif, ui-monospace, ui-rounded are treated as unknown names. The Latin of the macOS desktop default font (the SYSTEM_FONT_STRING chain) changes from SF to Apple SD Gothic Neo. (Same as the screen of the original running in Chrome. Safari uses SF) BlinkMacSystemFont is the same as system-ui, like Chrome
- Generic family names (serif, sans-serif, monospace, cursive, fantasy, math) are resolved per Chrome's default font table. (platform/desktop/systemfont.rs: GenericFamily, resolve_generic_family_name, read_browser_locale) The table is IDS_*_FONT_FAMILY from Chromium locale_settings_mac.grd, _win.grd, _linux.grd and the UI language translations (platform_locale_settings/*.xtb). Chrome resolves a canvas without a document lang by the default locale (UI language), and does not register the per-script values for that script (prefs_tab_helper.cc), so it uses the Common values of the UI language. The canvases the original bakes into are not attached to the document, so changing the document lang has no effect. (Confirmed in Chrome) The Rust version takes as the UI language the first of the system preferred languages that has a Chrome translation. A value starting with a comma is the first installed font
  - macOS Korean: standard and sans-serif Apple SD Gothic Neo, serif AppleMyungjo, monospace Menlo, cursive Apple Chancery, fantasy Papyrus, math STIX Two Math. 16px "Hello World Wifi" matches Chrome (serif 124.097, sans-serif 109.072, monospace 154.125, cursive 111.352, fantasy 109.156, math 115.472). Previously serif was Times 110.961 and monospace Courier 153.625. English is Times, Helvetica, Menlo
  - Windows: like Chrome, monospace is Courier New, or Consolas when ClearType is on, and Korean is Batang, Malgun Gothic, Gulimche, Gungsuh. system-ui is the menu font (lfMenuFont of NONCLIENTMETRICS), like Chrome. Linux: names in the table such as Times New Roman, Arial, Monospace are looked up with fontconfig, but like Chrome (Skia SkFontConfigInterface_direct.cpp) a result is accepted only when the name matches, when it is a metric-compatible substitute (a table such as Liberation, Arimo), or when it is sans, serif, monospace. For Windows and Linux, only those branches were compiled for x86_64-pc-windows-msvc, x86_64-unknown-linux-gnu, and they were not run and compared against Chrome
  - Characters for which the name list is exhausted are drawn, like Chrome, with the standard font of the UI language, then the OS fallback font, then the last resort font (Times on macOS). "é" (e + U+0301), whose combining mark is missing from the default font, is drawn in Times as in Chrome on macOS
  - macOS: fixed font collections whose name table has only Mac records (such as Papyrus.ttc) drawing in Condensed because the face could not be selected by PostScript name. Puts normal width in the font descriptor
- Like the Chrome canvas (PlainTextNode in plain_text_node.cc), splits text into words and shapes them separately. No kerning or ligatures across spaces. Spaces, tabs and ZWSP are one each, and CJK characters and emoji are separate per character. (textshaping::find_chrome_word_end) The space and W kerning of STIX Two Math is gone, now matching Chrome. Canvas tabs, line feeds, form feeds and carriage returns are shaped as spaces. (Chrome IsNormalizedCanvasSpaceCharacter)
- Computes the font string size like the Chrome canvas. (parse_font_string) Matches values measured in Chrome on a canvas not attached to the document, as the original uses:
  - ex, ch, cap, ic, lh are the x-height (top of the 'x' glyph), the advance of '0', the cap height, the advance of '水' (1em if missing), and line height normal of the parent font (Chrome's last resort font, Times on macOS) at 10px. rem, rex, rch, rcap, ric, rlh use the document root (the standard font of the UI language) at 16px. (Previously rem was computed as 10px) vw, vh, vi, vb, vmin, vmax with the sv, lv, dv prefixes, and cq units without a container, use the logical size of the window. (textstringtexturecache::set_font_viewport_size, the desktop reports it when the window size changes)
  - When the name list is just an unquoted monospace, relative sizes are multiplied by 13 / 16 and keyword sizes use the monospace table (medium 13, large 16). Evaluates calc(), min(), max(), clamp(), abs(), sign(), round(), mod(), rem(), hypot(), sqrt(), pow(), exp(), log() and pi, e, infinity. Negative values inside functions become 0, values over 10000 become 10000, "+2px" ".5px" "1e1px" are accepted and "2.px" is invalid
  - On the web, sizes other than absolute lengths are set into the font of a browser canvas not attached to the document, as the original does, and read back. (resolve_font_size in platform/web/systemfont.rs) The parent font metrics on Windows and Linux (choosing win or hhea values for line height) were ported following the Chrome source and not compared
- macOS-only Chrome comparison tests: system_ui_font_matches_chrome_on_macos (19 sizes x 3 weights), generic_families_match_chrome_korean_defaults_on_macos (when the UI language is Korean), font_size_units_match_chrome_on_macos (75 unit and calc cases, plus 12 root units when Korean). Comparing the textshaping example with the original JS of the same scene in Chrome on macOS, the horizontal extent of the text on each line is within 1 pixel on a 2x display. (Rust on the web differs from the original JS screen by at most 11 in pixel values)
- Remaining difference: rustybuzz holds positions as integers in font units and rounds GPOS variation deltas (such as the kerning between W and o in SFNS). HarfBuzz 15 holds them as fractions. "Hello World Wifi" in SFNS at 18, 20, 21, 24px differs from Chrome by 0.002 ~ 0.004px
- New crate: unicode-script 0.5 (the version rustybuzz and usvg already use). Enabled the general-category feature of unicode-properties and the Win32_Graphics_Gdi feature of windows-sys on Windows
- Moved desktop wss:// into a tls feature that is on by default. (tls of ewebsock and rustls) Default behavior is unchanged. The crypto provider ring builds C, so checking the Windows target on macOS was blocked by missing Windows C headers. Now the whole engine is checked against the Windows target with cargo check --target x86_64-pc-windows-msvc --no-default-features. (0 warnings, also fixed the naming warning for userProfilePath in LocalStorage, which compiles only on Windows) With default-features = false, the desktop opens only ws://. For the Linux target, alsa-sys of cpal and libudev-sys of gilrs call pkg-config, so on macOS it is checked by passing a pkg-config that prints empty flags via PKG_CONFIG, with PKG_CONFIG_ALLOW_CROSS=1
- AudioBus.get_gain_node returns AudioGainNode on both platforms. (GainNode on the web, on desktop an Rc<RefCell<kira TrackHandle>> that shares the bus track) Its as_deref() is the output of AudioPlayer::new, so AudioPlayer::new(&audio_manager, audio_bus.get_gain_node().as_deref()) compiles as is on both platforms. (Previously split into as_deref on the web and as_deref_mut on desktop, this changes the public API) On desktop, other bus functions can now be called while the bus track is borrowed
- The web platform, like the original engine.js, only keeps mouse events within 800 milliseconds after a finger out of the last device and last hand records, and passes the buttons, position and touch through as is. Until now the events were discarded entirely, so making the fourth argument of CameraGestures (the time to ignore emulated mouse events) shorter than 800 had no effect. (In headless Chrome, a right button 300 milliseconds after a finger is a gesture with threshold 100 and ignored with 800. Before the fix, both were ignored)
- Desktop PlayStation pads (Sony 054c DualShock 4 05c4, 09cc, 0ba0, DualSense 0ce6, 0df2, 0e5f) get 18 buttons like Chrome MapperDualshock4, MapperDualSense, with raw button 13 always at TOUCHPAD(17). (macOS IOKit button usage 14, Windows Windows.Gaming.Input button 13, Linux hid-generic BTN_GAMEPAD + 13) gilrs maps touchpad:b13 of the SDL mapping only to an unnamed button (Button::Unknown, same as misc1), so it is found by raw code. Other buttons (DualSense microphone) and axes are not mapped. Linux hid-sony (from 4.10) and hid-playstation (from 5.12) expose the touchpad as a separate device and add 0x8000 to bcdHID, so they have 17 buttons like Chrome MapperPs4Ps5. Until now, the first pressed button not in the mapping became 17. (Verified through mapping data and code paths without a real pad)
- is_coarse_pointer on Linux and other Unix systems: like Chromium on desktop Linux, true when there is a touchscreen and no enabled mouse, touchpad or pointing stick. (Previously always false) The device list is read from the display server, like Chromium. Wayland uses the pointer, touch capabilities of wl_seat, and X11 the device type from XListInputDevices and the use, enabled state, direct touch and Abs MT Position axes from XIQueryDevice. (Chromium's evdev classification is for ChromeOS) It is called every frame, so the read value is used for 2 seconds. x11-dl, wayland-client are the same versions glutin, winit already use
- The desktop also decodes AVIF. The engine reads HEIF boxes per libavif rules (joining grid tiles, both auxiliary alpha types, prem, colr nclx, clap only when the origin is (0, 0) like Chrome, irot, imir) and decodes AV1 with rav1d (a Rust port of dav1d, built with asm off, without nasm or a C compiler). The YUV to RGB conversion is libavif's reference computation. Maximum difference 1~4 from Chrome 158's decoding, and grid (1600 x 1200, 12 tiles) and alpha images made with macOS ImageIO also match. Color profile conversion and animated AVIF are not supported. rav1d is slow at opt-level 0. (1600 x 1200 takes 2.9 seconds in a dev build, 0.9 seconds with only rav1d at opt-level 3) Putting [profile.dev.package.rav1d] opt-level = 3 in the game's Cargo.toml makes it fast in dev builds too
- Added Image::load_from_memory_with_mime_type (bytes of a known type, SVG only for image/svg+xml like the browser, otherwise raster identified by content), sniff_image_mime_type (the image table of WHATWG MIME sniffing plus AVIF)
- Image type from the response content-type, like the original: load handles keep the response headers. (AssetLoadHandle.get_content_type) On the web, if the response is an image type or the URL has an image extension, the browser decodes it with that content-type as the type. Like the original HTMLImageElement, SVG is identified by type and raster by content. (image/svg+xml decodes even without an extension, and an .svg served as text/plain does not decode, like the original) Material's mime_type is the response content-type like the original loadImageDescription, and on desktop, which has no response, the type chosen from content. (Removed Material::find_image_mime_type, which decided by path extension)
- Timeline "data:" URL images: on the web the browser decodes them like the original (including SVG, AVIF), and once decoded they are set on the sprite and the frame of the description is selected. (applySpriteFrame in the original image.onload) On desktop, if the URL type is image/svg+xml it is drawn with resvg, otherwise it is raster identified by content. (Previously drew SVG by content regardless of type)
- Corrected the header comments of Platform.is_coarse_pointer, Engine.is_coarse_pointer to match actual behavior. (Windows and Linux use Chromium's detection)
- async/await is used like the original. (Until now load handles and callbacks stood in for it. The synchronous handle-based style and the callback APIs are kept)
  - The engine contains a single-threaded executor. (core/task.rs, no external runtime, the same code on desktop and web, futures need not be Send)
    Engine::spawn_task (engine task) and spawn_scene_task (scene task) run up to the first await at the point of spawning, as when calling an async function in the original,
    and the rest is polled every frame after updating time and input, before the scenes' tick, in wake order until the queue is empty, like the original microtask queue.
    (When a task resolves a Promise or finishes, the waiting tasks continue in the same pass in the order they were resolved, and a future that wakes itself continues the next frame) Where only &Engine is available, spawn_deferred_task, spawn_deferred_scene_task
  - Tasks borrow the scene and engine only inside with(|scene, engine| ...) of a context (EngineContext, SceneContext<scene type>). Pointers kept in a thread-local slot are taken out only while polling and put back, so no second &mut arises. Graphics via with_graphic. TaskHandle tells whether a task has finished, or is awaited
  - Promise, PromiseResolver: in place of the original new Promise((resolve, reject) => ...). Promise::create, Promise::resolved, reject(reason) of Promise<Result<T, E>>
  - wait::seconds, wait::next_frame (the original base/wait.js, not ported until now). seconds is wall-clock seconds like the original setTimeout (time scale is not applied), yields once even for 0 seconds, and wraps milliseconds to a WebIDL long the same way.
    The original nextFrame finishing immediately because it did not await the Promise it created was fixed in the original too (vanilla.js dev 89847b7), so both wait until the next frame
  - Scenes: in place of the original async load, a task spawned in create and handed to SceneBase::track_task defers initialize until it finishes. One handed over in unload keeps the scene in the list until it finishes, like the original await scene.unload (it still receives tick and draw).
    Even after a scene is unloaded, its tasks keep running like the original Promise chain, and the engine keeps the scene value alive until they finish (without tick and draw, with still gives that scene). A scene unloaded while loading still receives initialize once loading finishes, like the original loadScene. destroy is called when the scene value is dropped.
    Engine::load_scene_async, unload_scene_async, unload_all_scenes_async (the original await SceneManager.loadScene family, unloading resolves only after the unload tasks also finish)
  - The loads that return a Promise in the original return awaitable handles that do not borrow the asset or scene. (The original await this.atlas.load(path) becomes the single line scene_context.with(|scene, engine| scene.atlas.load(engine, path)).await)
    ImageAsset (until decoded, fails if it cannot be decoded), TextAsset, JsonAsset, BlobAsset, BunchAsset, VisualAsset (only records the path and finishes immediately, like the original), the load_font family of FontAsset (FontLoadHandle, until added to the font list),
    load, load_from_bytes, load_from_asset of AudioAsset (AudioLoadHandle, until decoded. Immediate failures are seen through get_load_error of the handle instead of the Result it used to return), AssetLoader::load (failure list), load, load_data of SpriteAtlas (shared state that does not borrow the atlas),
    BuildInfo::load, SoundSystem::load_sounds, load_language_list, load_language, apply_language_setting of languagepack, load_ui_font, load_ui_font_text (UiFontTextLoadHandle) of uifont.
    Engine::register_font_face_when_loaded also returns a FontLoadHandle. A load already started can also be awaited with wait_for_load().await
  - FbxLoadHandle, ImageDescriptionLoadHandle are IntoFuture. SkinnedModel::load_from_url_async, load_from_fbx_url_async (once fully downloaded, built with the GL of the engine polling the task). Timeline::load_from_url (the original loadFromUrl)
  - SkinnedModel::add_animations_from_fbx_url returns an AnimationLoadHandle. When the await finishes, the clips have already been added, like the original. (The clip list is shared with the handle and clips are added in the order received) get_animation_list gives a borrowed value (Ref)
  - languagepack::set_language_loaded_async_handler: an after-load function that returns a future. Like the original applyLanguageSetting, loading is in progress until that future finishes
  - SpriteAtlas, like the original, keeps using the previous frames and page images while reloading, and finishes without frames if the JSON cannot be read or the format is unknown. (Until now it counted as loaded with empty frames)
  - Engine::read_clipboard_text_async (the original readClipboardText, None if there is no text or access is denied), request_frame_capture_async (the original requestFrameCapture, PNG bytes)
  - Screen fade: GameScene::fade_screen_async(on_dark), GameSceneBase::fade_screen_async::<scene type>. On the tick when it is fully dark, game_scene!, ui_scene! spawn on_dark as a scene task and run it up to the first await on the spot (where the original calls onDark), and it brightens when the future finishes.
    Scenes that implement Scene directly take it out with take_screen_fade_dark_starter after the base tick and start it
  - Added the SceneAny supertrait to the Scene trait (as_scene_any_mut, implemented automatically for every 'static scene). Used by SceneContext to downcast the scene to its own type
  - Example asyncawait. 17 tests (executor and immediate first poll, waking, wake-order queue, waiting and setTimeout delay, asset and image handles, handles that borrow the engine, context access, panic on an escaped context, scene loading, keeping unloaded scenes alive, waiting for unload, scenes unloaded while loading, fade, language pack async functions, animation handles)
  - README strengths and usage (scene lifecycle, original vs Rust table for asset loading, examples), technical notes, ARCHITECTURE layout, ownership structure and frame loop, chapter 9 (182 original files ported), chapter 10 (removed async from what truly cannot be matched, and put only with under deliberate design choices)
- Aligned the desktop more closely with the original running on Chrome. (Ported after confirming what Chrome does from the Chromium source, ARCHITECTURE chapter 10)
  - Wayland page event Hidden: like Chrome on Linux Wayland, if a requested wl_surface.frame callback does not arrive for 3 seconds the window is treated as occluded and Hidden is emitted, and when callbacks resume, Visible and on_page_visibility_restored. Attaches wayland-client to the wl_display of the winit window as a guest connection and requests callbacks on its own queue. So that Mesa does not block inside eglSwapBuffers on an occluded window, Wayland sets the EGL swap interval to 0 like SDL and the engine waits up to 1/20 second for the previous frame callback. xdg_toplevel suspended is held by winit and cannot be received
  - Windows touch keyboard: like Chrome on Windows, focusing or tapping a platform input field (use_dominput) with a finger or pen shows the touch keyboard through an InputPane bound to the window (debounced to 300 milliseconds), and hides it when focus leaves. The visualViewport shrinks by the height of the covered area, so the canvas shrinks with auto_resize_on_window_resize, and ignore_virtual_keyboard_resize prevents that on desktop too, like the original. macOS and Linux do not shrink the viewport, like Chrome
  - preserve_drawing_buffer: like the original, when on, color is not cleared at the start of a frame. (The original applySettings clears only the stencil. Until now the Rust version always cleared on both web and desktop, so even when on, drawing did not accumulate over the previous frame) The desktop copies the finished frame and redraws it at the start of the next frame. Graphic::new takes preserve_drawing_buffer like the original constructor
  - With auto_resize_on_window_resize off, the desktop also does not apply the canvas aspect ratio cap (max_canvas_aspect_ratio), like the original. (The original applies the ratio cap only when this setting is on. The desktop window is treated as a page whose canvas fills the window)
  - Desktop Platform browser changed from Unknown to Chrome: the desktop version produces the same results as the original on Chrome, so browser branches in game code also take the Chrome path
  - Developer tools memory fields: instead of (N/A), the desktop writes the system allocator heap (macOS malloc_zone_statistics, Windows process heap HeapSummary, Linux glibc mallinfo2) into the usedJSHeapSize, totalJSHeapSize fields. jsHeapSizeLimit stays (N/A) since there is no such limit
  - Removed from the differences table: safe area insets 0 (also 0 on desktop Chrome, SetDisplayCutoutSafeArea exists only on Android), set_prevented_keys and right-click menu blocking (a desktop window has no default browser behavior to block, so it is the same as blocked), on-screen keyboard, Wayland Hidden, preserve_drawing_buffer, auto_resize_on_window_resize, browser name
- Reflection: does the same work as the original's runtime reflection (collectReflectedProperties, getReflectedProperties, saveByReflection, loadByReflection in uidocument.js, getComponentProperties in devtools.js) with code generated at compile time. A procedural macro does it, like Unreal UHT or Qt moc
  - Made the repository a workspace and added the procedural macro crate macros/ (vanilla-engine-macros, syn, quote, proc-macro2). The engine re-exports it as vanilla::reflect, so games depend only on the engine. Generated code refers to the engine as ::vanilla, and inside the engine the same path works through extern crate self as vanilla in lib.rs
  - #[vanilla::reflect] goes on the component's impl block and its impl Component block. Collects pub get_*, is_* getters without arguments and their matching set_* to generate the Reflect implementation. Keys are the original names (get_line_width → LineWidth), in definition order. If only one side has it, a compile error points to where to add it
  - Getters of types that cannot be converted to a value are filtered out by autoref specialization, excluded from saving, and shown in the inspector as [type name]. #[reflect(skip)], #[reflect(transient)], #[reflect(name = "...")] on functions, #[reflect(base = field)] on blocks (chains to the field holding the original superclass part)
  - core/reflection.rs: ReflectValue, Reflect, ToReflectValue, FromReflectValue, ReflectedProperty, ReflectedGetter, collect_reflected_properties, read_reflected_property, write_reflected_property, collect_reflected_getters. Component::get_reflection, get_reflection_mut (None by default). Enums that are strings in the original (TextAlign, TextBaseline, TextDirection, TextWrapMode, SpriteDrawMode, BlendMode, ScrollMode, ProgressDirection, ScrollBarAxis, SoftShadeShape, ButtonMotionStyle, ToastPhase, ParticleEmitterShape, ParticleRenderShape, ShaderSpriteEffect) convert to the same strings, and ButtonState to the original Enum number
  - Applied to all 51 engine component types. Those with an original superclass (UIView for UIControl, UIScrollView, UIProgressView, UILabel, UIImageView, UIControl for UIButton, UISlider, UIDraggable, UIButton for UIToggleButton, UIScrollView for UISnapScrollView, Paint for Sprite, Sprite for ShaderSprite) chain with base, and their delegating functions were removed. TextAlign, isBold of ShadowText, the perimeter points of UIProgressRing, and isHorizontal of UIListView were moved to the original order
- UIDocument: like the original, types without write and read functions (propertyHandler) are written and read by reflection. (save_by_reflection, load_by_reflection, get_reflected_properties, the original REFLECTED_PROPERTY_EXCLUDE_NAMES) Removed the hand-written Outline, SoftShade, ShadowText, UIProgressRing serialization and switched them to reflection. The result matches the original saveByReflection down to keys, order and values. (Tested against JSON produced by running the original in node)
  - Changed the public API: register_component_type(name, constructor function) is the original registerComponentType. (reflection) With write and read functions, register_component_type_with_handler, and widgets use register_widget_type(name, constructor function, content, self-attached types) and register_widget_type_with_handler
  - Unregistered types that have reflection are also written by reflection, like the original. (type is the type name) Even for types with a write function, reflected properties that point to nodes are added and read separately, like the original saveNodeReferences, loadNodeReferences
  - Components standing in for original node types (WorldNode subclasses): register_node_type, UIDocumentNode, UIDocumentNodeParts. A node with that component attached has that name as its type, the components and children the original node constructor created are written in the original document form, and on reading they are read as settings without being rebuilt
  - register_editor_types: registers in one line the UIInputField, UIScrollBar (original node types) and UISnapScrollView found in documents saved by the original editor (tools/uieditor). Until now they were discarded on reading. UIInputField reads the background color, round size, placeholder and its color, font size, value and its color, and UIScrollBar reads the track and thumb colors
  - ShadowImage is written in the reflection save form after imagePath
- UIScrollBar: get_track_color, get_thumb_color
- DevTools: the inspector calls and shows all get*, is* getters of a component, like the original getComponentProperties. (Names in the form of the original formatMethodName, values in the form of formatPropertyValue, numbers rounded the same as the original toFixed) Components without reflection show only the UIDocument save keys or the type name, as before
- README (how to use the reflection macro in nodes and components, technical notes, the macro crate table in external dependencies), ARCHITECTURE (layout, chapter 9, the reflection line in chapter 10 differences between the two engines)
- Made desktop audio decoding the same as the original (Chrome decodeAudioData). (platform/audio/decode)
  - Chrome 158 decodes FLAC, MP3, PCM, Vorbis with symphonia 0.6, Opus with libopus, and AAC with FFmpeg. The engine also turns off kira's decoding features and calls symphonia 0.6.1 directly to use the same decoders (with the same features Chrome enables), and decodes Opus by registering opus-pure, a Rust port of libopus, in the symphonia codec registry. The webm (Opus) produced by webm.cjs now plays on desktop
  - Containers are also handled by symphonia demuxers (wav, ogg, mkv(webm), isomp4(m4a), flac, mp3, adts), and the format is identified by content rather than extension or type
  - Discards the same leading and trailing samples that Chrome discards based on FFmpeg timestamps and trim values. (Opus pre-skip, the portion caused by FFmpeg rounding the webm CodecDelay to ms, DiscardPadding, MP3 LAME delay, Ogg granules and single-page Vorbis, m4a edit lists and iTunSMPB, AAC last packet length)
  - Integer samples are converted with Chrome's formula (positives divided by the maximum, negatives by the minimum, 16-bit FLAC as 16 bits), and MP3 is clamped to -1 ~ 1. Opus output gain and the Chromium channel order for 5.1 are also the same
  - Ported Chromium SincResampler to resample to the original DECODE_SAMPLE_RATE (44100). (The same 32-tap kernel and length computation as Blink, with summation order matching the NEON, SSE, AVX2 paths Chrome selects)
  - Downmixes to 1 or 2 channels by the WebAudio speaker rules. (Quad and 5.1 by the spec formulas, others by the first two channels. Files with 3 or more channels now play too)
  - Compares 21 test sound files (tests/assets/audio, all a few KB) against Chrome 158's results (chrome_decode.json written by chromedecode.cjs). Lengths and channels all match, FLAC, MP3, PCM, Vorbis match down to the sample, and Opus, AAC are within about 1e-7
  - Remaining difference: HE-AAC (SBR, PS) and AAC with 3 or more channels are not supported by symphonia 0.6.1, so they could not be decoded on desktop. (Chrome decodes them with FFmpeg) (Fixed later: they are now decoded with oxideav-aac, see the HE-AAC entry below)
  - 7 crates added: opus-pure, symphonia-format-mkv, rustfft (enables opt-simd of symphonia like Chrome so the FFT matches) and its dependencies primal-check, strength_reduce, transpose, num-integer. None removed (the engine directly uses the symphonia kira was using)
- "data:" URLs: desktop Engine::load_audio_asset, request_asset_bytes, request_asset_bytes_into, load_image decode and read data: URLs. (data: sounds inserted by the timeline editor now play on desktop too) Moved base64 and percent-encoding decoding from the timeline to base/dataurl.rs. Fixed the web prepending the base URL to data: URLs too when asset_base_url was not empty, which made them fail to load
- Switched desktop audio output from kira to an engine mixer on top of cpal. (platform/audio/mixer.rs) The original sound API and the Rust API (AudioPlayer, AudioBus, get_gain_node, BeepPlayer) are unchanged
  - Builds the same WebAudio graph the original builds. AudioBufferSourceNode → player GainNode → (once a nonzero pan is first set) StereoPannerNode → bus GainNode or output, beep oscillator → output. Renders in 128-frame quanta
  - The computation is the same as Chrome. The source is ported from audio_buffer_source_handler.cc (start position rounded with 1024x oversampling, a straight copy at rate 1 and linear interpolation otherwise, linear extrapolation at the end, whole-buffer looping, playbackRate as f32 like AudioParam). Pan uses the formula from stereo_panner.cc (mono x = (pan + 1) / 2, stereo with pan <= 0 L += R cos, R *= sin), GainNode multiplies, mono goes to both sides by the speaker rules, and the output is clamped to -1 ~ 1. kira differed from Chrome with 4-point cubic interpolation and a sqrt pan law
  - Pan and volume take effect from the next quantum. (Pan in the kira version applied from the next play) Beeps render at the context (device) sample rate
  - The context clock is the rendered time. (The original currentTime, 128 / sample rate seconds per quantum) Nothing renders while suspended, so sound and clock stop in place
  - A management thread holds the stream, and when the device is removed (or, except on macOS, when the default device changes) it reopens with the same mixer. (Same as kira did)
  - AudioContext (desktop) belongs to the engine mixer and exposes sample_rate(), current_time() under the same names as the web AudioContext. AudioBuffer exposes duration(), length(), number_of_channels(), sample_rate(). (This changes the public API: until now they were kira's AudioManager, StaticSoundData)
  - Players created from a bus and players given an output directly keep the bus node alive while connected, like the original WebAudio
  - Added tests comparing five graphs (sources at the same and a different sample rate, rate with loop and start position, mono and stereo pan and 0, bus, mixing) against Chrome 158 OfflineAudioContext results (chrome_mixer.json written by tests/assets/mixer/chromemixer.cjs). They match within 1e-6
  - 8 crates removed: kira, atomic-arena, crossbeam-utils, glam, mint, pastey, rtrb, triple_buffer. The only direct dependency is cpal (the same cpal 0.18 kira used, realtime feature)
- ToonScreenOutline: rebuilt the screen-space outline in the standard form of real-time toon rendering. (Same shaders and values as vanilla.js)
  - Detection: in the line buffer (normal, line id, depth), each edge between a pixel and its four direct neighbors is tested once, and the line is placed at the middle of that edge. Until now crease lines were judged from the normal at a single point creaseRadius away, so both sides of a crease formed bands, and half-size buffers produced dotted lines, parallel second lines, and bands inside the silhouettes of curved surfaces
  - Depth: reconstructs two neighboring pixels to view-space positions and detects occluded silhouettes by their distance from each other's tangent plane. Twice the pixel size at that depth is added to the threshold
  - Widening: propagates the distance to edge segments with jump flooding. (log2 steps, outline and crease lines separately) The 3-pixel radius limit is gone
  - Blending: each pixel of the drawing area is covered by clamp(width / 2 - distance + 0.5, 0, 1) from the distance to the nearest edge. Lines do not break even with a reduced line buffer
  - Per model: has_screen_outline of ToonLineDrawOptions (false only occludes), has_crease_line, is_mirrored (None uses the determinant)
  - read_jump_flood_steps(distance): list of jump flooding steps
- ToonDrawOptions: line_id (None uses the order in the draw queue + 1), has_screen_outline, has_crease_line. (Per-model options for the screen-space outline, ToonRenderer does not read them)
- ToonDrawQueue: set_screen_outline(Option<&'a mut ToonScreenOutline>), has_screen_outline(). When set, draw and draw_with_matrices draw the opaque items into the line buffer before the bodies, and blend after the outline shells, before the AfterOutline stage. If there is a screen rectangle, that rectangle is used as the drawing area
- Fully aligned reflection with the original. (Tests compare against expected values extracted by running the original in node, and generate.mjs in src/ui/testdata/uidocument regenerates them)
  - Reflection calls &mut self getters (get_reflected_value_mut, collect_reflected_getters_mut), getters that take the tree (collect_reflected_getters_in_tree), and setters that take the tree and a value (set_reflected_value_in_tree). When reading, UIDocument briefly takes the component out of the tree (NodeTree::with_component_at_mut) and calls tree-taking setters on the spot like the original, and to_json_text_mut, serialize_node_mut also write &mut self getters. The DevTools inspector reads &mut self getters in tick and calls tree-taking getters when drawing
  - Macro: pairs are formed by key (baseName) like the original, and getting and setting are each looked up separately starting from the most derived type. Added #[reflect(unsaved)] (kept in the list but excluded from saving) and #[reflect(after = "...")] (places a getter from the impl Component block at its position in the original class body)
  - The inspector getter list and the reflected property list match the original. Removed Rust-version overrides not in the original classes (such as isTickNeeded), and moved Text, RichText, UILabel, UIButton into the original definition order. They show under the original names, such as getTargetButton (tree) of UIHitArea, FontFace of ShadowText, and BakeCanvas of SoftShade, ShadowText, ShadowImage
  - register_editor_types registers 35 engine component types and 12 node types (FloatingText, TouchEffect, UIConfirmWindow, UIContextMenu, UIDialog, UIDropdown, UIInputField, UIScrollBar, UISpinner, UIToast, UIWindow, UIWindowLayer), like the original editor. register_node_type_with_match distinguishes node types that use the same component (UIConfirmWindow is UIWindow plus a behavior)
  - UIDocument reading: document values go into the components and children built when a node type or widget attaches, and into components attached together via require, without rebuilding them. The embedded Sprite of UIImageView is written and read as a following Sprite, like the original. A hidden UIToast is written and read as active false, like the original
  - NodeTree::add_component, WorldNode::add_component reserve the component's slot first, like the original, and place components added during attach after it
  - Fixed to match the original: the title and message of UIConfirmWindow are UILabel. UIWindow disables the node in create rather than on attach. FloatingText sets the pivot and anchor to the top left on attach. The UIDropdown arrows use the original characters (▴, ▾) and font size. The UIScrollBar thumb starts as an enabled zero-size rectangle like the original thumb node. UIInputField writes the text label size laid out by tick to the document. UIImageView holds the image path separately from the embedded Sprite. UISpinner dot positions are computed in f64 like the original
  - DevTools: components with neither reflection nor registration show a "no reflection" line to flag the missing macro
- What the browser used to provide, part 2 (the remaining differences that could be closed)
  - LocalStorage: keeps two keys that differ only in unpaired surrogates (different keys in the original) separate. Previously they became one key on the Rust side, so on desktop one of two such keys saved by the original was lost on reading and also removed from the file on the next write. Added get_keys_code_units, get_item_by_key_code_units, set_item_by_key_code_units, remove_item_by_key_code_units, contains_key_code_units, which also address keys in their original code units. A Rust string key refers to the key that is exactly that string if there is one, otherwise the first of the unpaired surrogate keys that appear as that string. get_keys yields keys that appear as the same string only once
  - PaneStyle (desktop): reads the CSS that the original's tools use. Flex layout (flex-direction column, flex, flex-grow, flex-shrink, flex-basis following the length computation of CSS Flexbox, justify-content values such as space-between, align-items with stretch by default), min and max sizes, right and bottom, per-side padding, margin and border, line-height, text-align, overflow (clips overflowing children, auto and scroll can be scrolled with the wheel and by dragging the thumb, and hand the wheel to the parent once they reach the end, scrollbar-color). Elements with auto size are measured by adding up their children's sizes. PaneElement::get_scroll_offset, set_scroll_offset
  - UIInputField::set_multiline: multi-line input like Chrome's textarea. Splits at newline characters and by width (pre-wrap, break-word, ICU4X Unicode line breaking on desktop), Enter inserts a line break, Up and Down (keeping the horizontal position), Home and End (visual line), Ctrl + Home, End (Cmd + Up, Down on Mac), PageUp, PageDown (Blink's 87.5% distance), tab stops, selection and dragging, composition underline, wheel and thumb drag scrolling, scrolling to follow the cursor. set_line_height, set_tab_size, get_scroll_top, set_scroll_top. The web DOM input is a hidden <textarea>. The textarea of desktop PaneStyle takes text through this field
  - TextInputKey: Up, Down, PageUp, PageDown, DocumentStart, DocumentEnd. TextInputFieldState.is_multiline. Desktop single-line DOM input fields move Up and Down to the start and end of the text like Blink, and turn line breaks in inserted text into spaces (trailing line breaks are removed). Cmd + Left, Right on Mac go to the start and end of the line
  - Canvas2D, Path2D: stores arc, ellipse, arcTo, roundRect as Skia conics, like Chrome. (Blink canvas_path.cc angle adjustment and degenerate ellipses, Skia SkPathBuilder::arcTo, SkConic::BuildUnitArc, SkRRect radius reduction and addRRect point order) On desktop, filling subdivides them into quadratic curves within 0.25 device pixels, like Skia's CPU raster. (Previously a cubic Bezier approximation)
  - Canvas2D, Path2D: roundRect accepts elliptical corners. (CanvasRadius::Elliptical, (x, y), DOMPointInit in the original) The web Path2D calls functions of the browser Path2D such as arc and roundRect directly, like the original
  - Canvas2D: also draws engine Images that released their CPU pixels when uploaded to the GPU. (Reads back the texture the image remembers, previously reported and skipped)
  - Input fields (desktop, fields whose DOM input is pressed directly): like Chrome desktop touch, a 650ms long press with a finger (Chrome aura long press 500 + show press 150, movement tolerance 15 DIP) selects the word at that spot and shows touch selection handles (shaped like Chrome's vector icons, dragging them changes the selection) and the quick menu (Cut, Copy, Paste, "...", 100ms after release, centered above the selection). If nothing is selected and there is nothing to paste, it is the engine context menu. On Windows this is decided on release (Blink context_menu_on_mouse_up). Keys, mouse presses and the wheel dismiss the handles and menu. "..." shows the engine context menu at the top center of the selection
- The desktop now decodes HE-AAC v1 (SBR), v2 (PS) and AAC with three or more channels the way Chrome does. (platform/audio/decode/aac.rs)
  - AAC-LC up to two channels is still decoded with symphonia (identical to Chrome down to PNS noise); what symphonia does not accept (SBR or PS written in the ASC, three or more channels) and streams that carry SBR only in the payload (such as HE-AAC in ADTS, detected by whether the first packet doubles the sample rate) are decoded with oxideav-aac
  - oxideav-aac (MIT) is a pure Rust decoder written from the ISO/IEC 14496-3 and 13818-7 specifications. The commit history of its public repository (OxideAV/oxideav-aac) records it being written clause by clause from the specification, with no trace of porting LGPL code such as FFmpeg. The other candidate, rusty_aac (Apache-2.0), has no public repository or commit history for its decoder source (the crate's repository URL points to another repository that uses it), so its origin could not be verified and it was not used
  - The floating-point output before integer rounding (set_float_pcm_capture) is not in the crates.io release 0.1.7, so the dependency is pinned to repository commit eac68f3. It will switch to crates.io when the next release is out
  - Added six test sounds (HE-AAC v1 m4a and adts, v2 m4a, 5.1 AAC m4a and adts, stereo AAC using PNS), and 27 files are now compared with Chrome 158. Lengths and channels match and samples are within 1.5e-7
  - Remaining difference: when PNS is used in AAC with three or more channels, the noise samples of that band differ from Chrome. (The specification does not define the random number generator; matching it would require porting FFmpeg's generator)
  - Four more crates: oxideav-aac, oxideav-core, thiserror, thiserror-impl
- The x86_64 summation order of resampling (AVX2 with FMA, SSE) was written to match Chrome, but the expected values were generated on an Apple silicon Mac and it has not been run on real x86 hardware
- SoundSystem's effect fade-out, playing only the beginning, music crossfade and bus volume following now use AudioParam automation like the original. Until now both web and desktop computed the same formula on every update and set the volume
  - Same calls as the original soundsystem.js: effects assign gain.value and then setValueAtTime, linearRampToValueAtTime(0), source.stop(when); fade-out is cancelScheduledValues, setValueAtTime, linearRampToValueAtTime(0), stop(when) from the current gain.value; music is setValueAtTime(0), linearRampToValueAtTime(volume) and fading down from the current value with stop(when); the bus is setTargetAtTime(volume, now, 0.05). Finished sounds are removed from the list by update, in place of the original onended
  - On the web these go straight to WebAudio AudioParam and AudioBufferSourceNode.stop(when). (A stop received while the context is being resumed is applied at start)
  - The desktop mixer's GainNode gain is now an AudioParam. (platform/audio/audioparam.rs, ports event insertion, removal of past events, pulling in new events, linear and exponential ramps, set target, ramps after a target and cancellation from Chromium audio_param_handler.cc; on x86_64 the same four-lane SSE grouping as Chrome) Quanta with automation are multiplied per sample, quanta without it by a single value, and automation advances even without a source. A source's stop(when) cuts at the frame that time rounds up to. The clock is rendered frames / sample rate
  - Added apply_gain_automation, get_gain_value (reading the original gain.value) and stop_at_time, used inside the engine, to AudioPlayer and AudioBus. (The public API is unchanged)
  - The Chrome 158 OfflineAudioContext graphs in the mixer tests went from five to nine. (Playing only the beginning with bus setTargetAtTime, fading out from the current gain.value after a suspend during rendering, music crossfade, exponential ramps with ramps after a target and cancellation) All match within 1e-6
- BeepPlayer's desktop tone is now computed in the mixer with exactly the graph of the original playTone. Until now the same envelope and waveform were drawn with formulas and the samples mixed
  - Graph: OscillatorNode(type, frequency.setValueAtTime(frequency, start)) → GainNode(setValueAtTime(0.0001, start), linearRampToValueAtTime(peak, end of attack), setValueAtTime(peak, start of release), exponentialRampToValueAtTime(0.0001, end)) → output, start(start), stop(end + 0.01). Times are the context clock at the time of the call plus the delay (added in the same order as the original; the web version uses the same BeepSchedule)
  - OscillatorNode ports Chromium oscillator_handler.cc, periodic_wave_handler.cc and the per-CPU kernels. (platform/audio/oscillator.rs) Band-limited tables (2048, 4096 or 16384 entries depending on the sample rate, one per third of an octave, normalized to the peak of the first table), start and stop frames (rounded up, starting between samples), a step per sample (a-rate) in quanta where frequency is automated and one per quantum (k-rate) otherwise, and two-point, three-point and five-point interpolation are computed in the same order and with the same f32 and f64 precision as Chrome. Four-sample groups use a NEON version on aarch64, an SSE2 version on x86 and a scalar version elsewhere
  - Automation times are pulled in with the clock at the time of the call, like the original main thread, and pulled in once more to the current quantum before rendering. (AudioParam::apply_automation_at_call_time) Tables are built once per sample rate, like the context
  - Added a test comparing, sample by sample, nine cases of the original playTone graph in Chrome 158 OfflineAudioContext (four waveforms, a preset sequence, starting between samples, calling during rendering, sample rates 22050 and 96000, three-point and five-point interpolation, close to Nyquist). (chrome_beep.json written by tests/assets/mixer/chromebeep.cjs) All are within 1.2e-7
  - The x86 SSE2 version was written to match Chrome, but the expected values were generated on an Apple silicon Mac (arm64 Chrome) and have not been compared with x86 Chrome. (On a different CPU the test uses 1e-4)
- Rebuilt toon shading in the standard form of real-time toon rendering. (Same shaders and values as vanilla.js)
  - Shade ramp: multiplies the received light share (half Lambert by default) by the shadow and looks it up in the ramp to pick the color. Each step has a position, linear color and softness, and boundaries are anti-aliased with fwidth so they have no stair steps. Shadows come in as the shade color
    - ToonLightSet::set_shade(ToonShade { step, feather, color, second_step, second_feather, second_color, is_half_lambert }), set_shade_ramp(positions, colors, softness, half Lambert), clear_shade_ramp, set_ramp_texture(Option<GlTexture>, half Lambert)
    - set_band_count, set_band_ramp build the same ramp
  - Per light: the sun receives the full ramp color, and the fill light, point lights and spotlights receive the brightness step of the ramp
  - Highlights: set_specular(intensity, exponent, softness, color), for both the sun and point lights. Rim light: set_rim_light(color, power, softness, sun-side mask), added rather than multiplied by the base color
  - Spotlights: direction of ToonPointLight (a spotlight if Some), inner_cone_angle, outer_cone_angle (default 0 and π/4)
  - ToonDrawOptions: receives_shadow, shade_offset, specular_scale, rim_scale, matcap_texture, matcap_strength, matcap_blend (ToonMatcapBlend), outline_color, outline_width_scale
  - shadeOffset, specularMask, rimMask in the surface chunk, rim, sunLevel in the light chunk
  - Transforms normals by the inverse transpose. (Corrects the lighting and screen-space crease lines of stretched and squashed models)
  - Default lights: sun [0.84, 0.8, 0.74], sky [0.3, 0.33, 0.42], ground [0.17, 0.16, 0.15]
- ToonRenderer: pushes out the shell outline in the shader. (Base position and push direction, outline_color, outline_width_scale, set_outline_distance_scale, get_outline_distance_scale) Exports read_view_rotation, read_outline_vertex_data
- ToonMatcapBlend: how the matcap is blended. (Multiply, Add)
- Exports ToonShade, ToonShadeRamp, ToonRimLight, ToonSpecular at the crate root
- Filled in the header comments of the files in the toon folder. (All functions and public fields)
- Filled out toon rendering to the level Unity and Unreal provide by default. (Same shaders and values as vanilla.js)
  - ShadowMap: restores the previous texture and framebuffer bindings when built. (Building it after models left the depth texture on a unit and caused INVALID_OPERATION) When the light travels almost straight down or up, the up direction becomes the z axis. (The light matrix used to break)
  - ShadowAtlas, ShadowAtlasLight, ShadowAtlasLightSource, ShadowAtlasTile, SHADOW_ATLAS_MAXIMUM_LIGHTS: shadows of point lights (six cube faces) and spotlights (one perspective tile) as tiles in one depth texture. update_lights(&light_set.read_shadow_light_sources()). The receiving position is pushed toward the normal by (1 + 3 x (1 - dot(N, L))) tile texels to prevent shadow acne
  - ToonRenderer: set_local_shadows(Option<&ShadowAtlas>, strength), begin_shadow_atlas_pass, set_shadow_atlas_tile, set_outline_fade_distance, get_outline_fade_distance, set_light_color_usage, set_shade_rim_light. ToonDrawQueue::draw_local_shadows
  - ToonPointLight: casts_shadow, shadow_near (default false, 0.05). When building it with field names, add ..ToonPointLight::default()
  - ToonLightSet: set_light_color_usage(ToonLightColorUsage), set_shade_rim_light, get_shade_rim_light (ToonShadeRimLight), read_shadow_light_sources. Rim, matcap and shell outlines now also multiply by the sun color by default. The previous look is ToonLightColorUsage { rim: false, matcap: false, outline: false, ..Default }
  - ToonDrawOptions: outline_offset_z, angel_ring_texture, angel_ring_color, angel_ring_offset_u, angel_ring_offset_v, is_angel_ring_alpha
  - Second UV: ToonGeometry.uvs1, ToonMeshArrays.uv1_data, the last argument uvs1 of add_triangles_with_uvs (changed the public API, None without a second UV), read_glb_arrays reads TEXCOORD_1. read_uv_data
  - Texture units: point light shadows 0, angel ring 7, materials 8 ~ 15. TOON_MAXIMUM_MATERIAL_TEXTURES 9 → 8. begin_frame records unit 0 and end_frame restores it
- ToonScreenOutline: removed the stair steps of half-size buffers. The line buffer and seeds are at drawing area resolution, only the jump flooding runs on a reduced buffer (a gather pass collects the seeds), and seed positions are drawing area pixel coordinates. set_resolution_scale is the fraction (drawing area x fraction) for the line buffer and the widening buffers. ToonLineTarget: seed_framebuffer, seed_texture, jump_flood_framebuffers, jump_flood_textures, jump_flood_index, jump_flood_width, jump_flood_height. read_program_sources gives five
- tools/apidoc (workspace crate vanilla-engine-apidoc, uses only syn and serde_json): extracts the API documentation data docs/api/<version>.json from doc comments. Adds the class kind (struct, trait, type), traits and counterpart to the same data format as vanilla.js tools/apidoc.cjs. --check (format check and counts, comparing the ko and en guides), --missing (ko text not in the translation table), --gaps (places where documentation is empty), --counterpart (pairing with the vanilla.js data by name). since is decided by comparing against the source at the v0.3.2 tag. Usage is in tools/TOOLS.md
- docs/api/0.4.0.json (216 modules, 496 classes, 4930 members, 354 functions and constants, 89 enums), the English translation table docs/api/translation.en.json, and docs/api/counterpart.0.4.0.json, the table pairing entries with the same items in vanilla.js (also used when the vanilla.js side data fills in its Rust counterparts)
- Angel ring: rotates the UV back by the camera roll. (Same computation as vanilla.js, read_camera_roll) The ring stays attached to the head even when the camera is tilted
- Light intensity limiting: ToonLightSet::set_light_intensity_limited, is_light_intensity_limited (set_light_intensity_limited on the renderer too). Same computation as Limit Light Intensity of the Unity toon shader, on by default. The previous look is set_light_intensity_limited(false). When porting an old game shader (one that did not limit light intensity), or when using point lights above intensity 1 or HDR bloom, use set_light_intensity_limited(false). The intensity of colors with light color usage turned off and the sun color of shell outlines also match the Unity toon shader
- ShadowAtlas::new(gl, resolution, tile resolution): like the Unity URP default, aims for 1024 per tile and halves the tile size if they do not all fit. DEFAULT_SHADOW_ATLAS_RESOLUTION (2048), DEFAULT_SHADOW_ATLAS_TILE_RESOLUTION (1024), get_tile_resolution. (new gained one argument)
- Bone matrix uniform block (same as the original's JointBlock; the same road as Unity's GPU skinning constant buffer and Unreal's bone buffer): 96 bone matrices are 384 vec4 slots, which exceeds the minimum vertex uniform limit WebGL2 guarantees (MAX_VERTEX_UNIFORM_VECTORS 256 slots), so it ran on desktop (4096) but failed to link on Android (Galaxy Z Fold3). Bone matrices now go through the std140 uniform block JointBlock (6144 bytes, within the guaranteed MAX_UNIFORM_BLOCK_SIZE of 16384 bytes). Added: JOINT_BLOCK_GLSL (the declaration to put in a shader), JOINT_BLOCK_MAXIMUM (96), JOINT_BLOCK_NAME, JOINT_BLOCK_BINDING (3), JointBlockBuffer, MORPH_WEIGHT_VECTOR_COUNT (24). The toon renderer, toon outline, skinning renderer and skin renderer all use this road, and ShaderProgram binds the JointBlock block to the same place after linking. The morph weight array went from 96 floats (96 slots) to 24 vec4 slots. tests/uniformlimit.rs checks in the hidden-window GL that every program the engine builds stays within the limits (256 vertex, 224 fragment). The screen is unchanged.

## Performance

- Toon program variant prewarm (same as the original 5b8ae8c, the standard way, like Unity ShaderVariantCollection.WarmUp and Unreal PSO caches: build before the first draw, picture unchanged): body feature variants were built in the first frame that drew a combination not seen before, which could hitch once. Added ToonRenderer::prewarm_draw_queue(gl, queue). It builds, without drawing and with the same keys the draw uses, the variants the items in a draw queue will use (material, body feature bits, ambient occlusion body, outline, shadow depth). With GL_KHR_parallel_shader_compile (the web uses the same extension) it only hands off compiling and ToonProgramPrewarm::step finishes the compiled ones up to three per step each frame so the main thread is not blocked; without it, it builds inside the call. The returned ToonProgramPrewarm tells the end with is_ready() and wait(gl, renderer) (finishes the rest on the spot). Drawing before it finishes is fine, and a variant not built yet is built on the spot as before. ShaderProgram gained ShaderProgram::create_deferred, is_deferred(), is_build_complete(gl), finish_build(gl) and the static is_parallel_compile_supported(gl) (default behavior unchanged). A place is left to attach the variants of the instance layout once the draw queue gets a way to add instance buffers. Test: without prewarm the first draw frame builds 6 programs and after prewarm 0, with a byte-identical picture. (Mac GL has no parallel compile extension, so the handed-off path is run too with a test-only switch)
- Toon prewarm (same as the original jsprewarmwait): fixed prewarm possibly not advancing on a loading screen that only skips frames while waiting for the prewarm to finish without drawing (in the original, the game session measured on headless Chrome on a Mac: still not finished after 45 frames, then one 8,183 ms frame when everything was finished at once). Handed-off compile and link commands may not flow to the GPU by themselves in frames with no draw or clear (the KHR_parallel_shader_compile spec text says nothing about flush, and the Chromium source was not checked), so ToonRenderer::prewarm_draw_queue and prewarm_draw_queue_with_options now call GlContext::flush after handing off, and ToonProgramPrewarm::step calls it every step while work remains. ShaderProgram::is_build_complete no longer asks again once it has seen completion. The picture and the public API are unchanged. This machine (Mac GL) has no parallel compile extension, so a test forces the hand-off path and checks the flush counts (at least 1 after hand-off, 1 per remaining step) and that drawing after skipping 0, 1, 2 and 45 frames without drawing still produces pixels. It was not run on a machine with the real parallel extension (Windows, Linux).
- Toon body shader skips the point-light loop body outside the light radius (same as the original): outside the radius (lightRange > 0, rangeExponent > 0 and lightDistance >= lightRange) the attenuation window is exactly 0 and the contribution is 0, yet the body shader still ran two pow calls, the shadow read and the shade-level reads for every such pixel. Derivatives (fwidth) are now computed outside the branch where every pixel runs together (derivatives inside a branch are undefined when a quad neighbour skips), and the derivative-free heavy work (attenuation, shade-level reads, color limit) is skipped there. The point-light shadow read feeds the ramp coordinate, so it stays outside the branch. The skipped contribution was exactly 0 (readLimitedLocalColor(0) and readLightColor(0) are 0, the shade values are clamped finite numbers), so the screen is byte-identical. The miner game (iPad mini 6, one lantern, range 2.6) bisected it: one point light cost about 4 ms per frame.
- Toon frame block ToonFrame (same as the original jsubo, std140, binding 2, 172 floats): camera, light, shadow, outline distance, point light shadow, and the ambient occlusion origin and direct lighting strength, which were uploaded per program as separate uniforms, now go in one block. The slot order and the shader block declaration are identical to the original character by character (a test compares with the original file). The solid, outline and depth programs read the same block at binding 2; once per pass (frame_serial) the values are written once, then if a buffer holds the same values it is bound (no upload), and new values are written with buffer_sub_data into a buffer not written for eight begin_frame calls (a new one is created if none is free). Without a shadow or point light shadow, the light matrix, shadow strength and atlas slots keep their previous values (same as the original). The pictures of the room corner, ambient occlusion, highlight, style, showcase, post process and view examples are byte-identical to before.
- Toon material block, automatic instancing and line pass batch slots (same as the original f3f18e5, 5221c43, 1ffc38b, 90e3286 and 3fd1a61, in the shape of Unity SRP Batcher UnityPerMaterial, GPU instancing and Unreal auto-instancing): the nineteen material values of the body program (tintColor, tintAmount, alpha, glowScale, colorScale, emissiveColor, softEdge, alphaCutoff, premultipliedOutput, textureEnabled, uvTransform, decalUvTransform, decalColor, receivesShadow, shadeOffset, highlightScale, matcapSettings, angelRingSettings, angelRingColor) now live in one std140 uniform block ToonDrawMaterial (binding 0, 44 floats), and the six outline shell values (outlineColor, outlineLightColor, outlineWidthScale, outlineOffsetZ, alpha, premultipliedOutput) in ToonDrawOutline (binding 1, 12 floats). Field order and the shader block declarations are identical to the original down to the letter. Blocks with the same values are shared (FNV-1a hash and bit comparison), each draw does one bind_buffer_base (skipped when already bound), and at 1024 blocks per kind the least recently used block is evicted clock style and the new values are written into its buffer with buffer_sub_data (no buffer is deleted or created). ToonDrawQueue sorts with the material block as the fourth key and merges consecutive opaque plain meshes with the same mesh, material block, winding and draw options (everything equal except line id, group, depth prepass, shadow casting and culling; meshes with joint matrices or on_before_draw, and transparent ones, are excluded) into one instanced draw (body, outline shell, shadow depth, and each point light shadow tile). Batch slots (a buffer and per mesh vertex arrays) are handed out in the same order every frame, are not re-uploaded when the matrices equal the previous frame, and the body and the shell share a slot. ToonScreenOutline also batches the line id drawing by mesh and line options (accept_mesh culls and adds the focus distance, then draw_mesh_batch), keeps its own batch slots and skips the upload when equal (the id goes in tint x). The instanced, instanceLineIds, skinned and lineFlags uniforms of the line pass are uploaded only when they change. The screen is byte for byte the same (the screen hash equals the code before the change) and the draw calls of the same scene drop from 28 to 4. The instance count list of the same scene as the original toonautoinstancechrome is identical ([11, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2]).
- Toon screen outline thin line path, resolution scale and clearing before buffers (same as the original bf61a70, 2d1dad4, 1dce73d, 12f654c and 8ade0ed, the same shape as the Unity URP screen-space outline, looking at the neighbors inside the radius at once): up to a width of about 3.24 pixels (2 x sqrt(4.5) - 1), ToonScreenOutline skips the jump flooding (seed, gather and three widening passes). It picks a buffer (R8UI, one byte) holding the first boundary side of the contour and crease lines per pixel in the same order as the seed pick, and the blend reads the seeds of the 3 x 3 pixels around in the same order as the last jump flooding step (nine reads, a branchless pick) to work out the coverage from the distance to the nearest one. The full-screen passes after the line buffer drop from six (seed, gather, three widening, blend) to two (mask, blend), and the buffers written per pixel drop from three RGBA16UI (24 bytes) to one R8UI (1 byte). Thick lines and the line color table keep the current path, and the seed buffer and widening buffers are created the first time a thick line is drawn. set_resolution_scale now shrinks every buffer before the blend (line buffer, mask, seed, widening buffers) to the drawing area x the scale (before, only the widening buffers). The default 1 leaves the picture byte for byte the same. Below 1, a thin line (width x scale at most about 3.24 line buffer pixels) works out the coverage (an RGBA8 buffer multiplied by intensity and the id color, get_line_target().coverage_texture) once at the line buffer resolution, and the last blend reads it bilinearly once (nine reads become one). Thick lines run the jump flooding at the line buffer resolution and measure the distance in drawing area pixels when blending. The line width (set_width) is in drawing area pixels at any scale. Passes that overwrite a whole buffer (mask, seed, gather, widening, coverage) clear the buffer first (clear_buffer_u32_slice, clear_buffer_f32_slice) so a tile GPU does not load the old contents (the original replaced invalidateFramebuffer, which added 10 to 25 ms per frame on Safari, with clearing, and Rust has no invalidate so only the clear at the same place is there). The shader text is the same as the original down to the letter. On the same room scene in both engines (640 x 360, widths 2, 2.62, 3, 6 x scales 1, 0.75, 0.5, with the id color table, fifteen pictures) scale 1 differs in 4 pixels (a body shading band unrelated to the outline) and scales 0.75 and 0.5 differ in 0 pixels (before the fix, 5792 to 8176 pixels at scale 0.5, largest difference 211). The original line buffer batch slots (3fd1a61) are not ported because the Rust ToonDrawQueue has no automatic instancing batches yet.
- Subtree draw skipping (same as the original jssubtree set, scene graph bound dirtying like OSG dirtyBound and Godot item_rect_changed): every node keeps the union of its own drawing and the bounds of its enabled, visible children (subtree draw bounds, in node content coordinates), recomputed only when something changed, and drawing skips the node and its descendants as a whole when those bounds are outside the screen and the active clip (tick still runs). While computing, a parent writes each child's bounds in parent coordinates so children are culled before their transform is applied, and with many children the visible child range is narrowed by binary search. Transform, node and component setters report dirtiness only when the value changes (not for the same value) and NodeTree spreads it to the ancestors before drawing. A component that does not report its bounds or a node that draws gizmos keeps its ancestors from being skipped. Components that draw nothing (draw not overridden, like ButtonMotion and UINode) count as drawing nothing (the reflect macro generates Component::is_draw_overridden). Added Graphic::set_subtree_culling_enabled (on by default), is_subtree_culling_enabled, get_last_frame_culled_subtree_count, add_culled_subtree_count, read_local_visible_bounds, NodeTree::read_subtree_draw_bounds, read_parent_draw_bounds, draw_children, WorldNode::mark_draw_bounds_dirty, mark_parent_draw_bounds_dirty, get_last_drawn_frame_number, ComponentBase::mark_drawn_rect_dirty, mark_all_drawn_rects_dirty (the engine calls it when a font is registered), get_drawn_rect_generation and Component::mark_drawn_rect_dirty. A node not drawn last frame gets its text bake scale as if drawn for the first time. UILineChart reports a drawn rect up to the lines of out-of-range values, UIBarChart up to overflowing bars, UISlider up to the thumb circle (before the fix, out-of-range lines of a line chart whose content area was off screen disappeared from the screen). The subtreecull example (SUBTREECULL_CHECK=1) captures the scenes of the original tests and benchmark with culling on, off and all off and compares screen bytes and per-frame draw counts. In the engine scene of the original benchmark: culled subtrees with culling on 231 (original 231), nodes with a transform applied with culling off 2164 (original 2164), on 79 static and 85 scrolling (original nodes 79 and 85, the original count also includes one clip of the scroll view); the Rimminer settings window scene (SUBTREECULL_SCENE=rimminer) applies a transform to 59 nodes static and 55 scrolling with 281 culled subtrees (original 59, 55, 281), and 1274 with culling off (original 1274). Added LayoutVariable::set_value_changed_event and get_value_changed_event (LayoutVariableEvent, called only when the value differs, original setValueChangedEvent). The Rust UINode writes the solved values into the node transform, so the transform setters report dirtiness. ShadowImage reports a generous rect with twice the blur, the bake padding and the shadow offset regardless of baking and bake scale (same as the original).
- Graphic no longer remembers bindings and 2D state separately and compares against the GL state cache before drawing (same as the original db99208, the three.js WebGLState form): removed the program last made current, the textures of units 0 and 1 and of the batch units, and the color write mask that Graphic remembered by itself; it now sets them only when the state cache differs. Right before a draw it matches blending (on, FUNC_ADD, the factors of the current blend mode), depth test and face culling off, scissor off unless it is the clip scissor, and a full drawing buffer viewport against the state cache (apply_draw_state), and the unbatched path also compares and binds the default vertex array and vertex buffer. The state cache remembers the ARRAY_BUFFER binding (added GlContext::bind_buffer, create_buffer, delete_buffer; the check mode also compares ARRAY_BUFFER_BINDING) and gains comparisons that do not ask GL. So when a game changes blending, depth, face culling, scissor, viewport, vertex array, vertex buffer, or the active unit through get_gl outside run_external_pass and comes back, the next 2D draw is right (before, batched drawing got the blend factors and equation, depth, face culling, scissor, and viewport wrong, and unbatched drawing also the vertex array and vertex buffer). restore_render_state no longer touches the stencil clip, like the original, and run_external_pass restores the stencil clip state at the end (also when there is no shader clip). The web build forgets the state cache when the GL context is lost or restored.
- GameSceneBase loading time and skipping moved to the engine's frame slot (same shape as the original df379ce): the loading gate (minimum display time and touch skipping, counted from the first loading frame if called before the first frame) is held by SceneBase and updated every frame for each loading scene by the engine (after time advances, before the loading screen's draw_on_load) with the engine clock and input. Until now it was updated only inside GameSceneBase::draw_on_load, so a scene that implements Scene directly and holds a GameSceneBase without calling the base draw_on_load stayed on the loading screen without an error (game_scene! and ui_scene! always call the base, so they did not stall). The gate opens before drawing, so initialize may be called one frame earlier than before. update_loading, begin_loading, get_loading_progress and is_load_touched_to_skip are used as before.
- Fewer shadow redraws (same as the original 4dabf62 and 2eefc5a, in the style of Unity HDRP's per-light shadow update mode and Unreal's cached shadow maps): ShadowMap and ShadowAtlas gain set_update_mode(ShadowUpdateMode, frame count), get_update_mode, get_update_interval and request_update. ShadowUpdateMode is EveryFrame (everything every frame, the behavior so far), OnChange (default) or Interval (everything every N frames, frames in between reuse the previous shadow). With OnChange, ToonDrawQueue::draw_shadows and draw_local_shadows compare the casters with the previous frame in the order they were added (mesh, material, model matrix and instance matrices, joint matrices, index buffer range, frustum culling, mirroring, light matrix and atlas tiles). Casters unchanged for 30 frames are baked into a separate target, and only the moving ones (and materials with a vertex chunk) are drawn every frame over the baked target copied into the target (blit_framebuffer). It rebakes when a baked caster changes or disappears or a new one is ready to bake, and a frame whose light changed draws everything straight into the target. When nothing changes it draws nothing. Depth keeps the nearest with LEQUAL, so the baked and overdrawn target is bit-identical to drawing everything at once. The original compares meshes and materials by reference; the Rust version compares mesh ids and material ids (a mesh rebuilt at the same address still counts as different). The original's instance buffer comparison (the buffer and generation of addMeshInstanceBuffer) is not included because the Rust ToonDrawQueue has no way to add an instance buffer yet. The capture test (tests/shadowcache.rs) draws the same 110-frame scene as the original Chrome test (tests/graphics3d/shadowcachechrome.test.mjs) and checks that EveryFrame and OnChange give the same screen every frame, that fully unchanged frames (45 to 59) draw nothing, that frames where only the box moves draw 7 or fewer, that Interval 4 draws only every fourth frame, and that a request_update frame draws as many as EveryFrame. The OnChange shadow draw count matches the original on all 110 frames, and the screens of frames 60 and 65 differ from the original in only 4 pixels by 1. (Before the change OnChange drew 12 to 16 every frame, and the test catches it at frame 1 of Interval) Measured on the original's heavy toon scene ported over (ground, 48 shapes, six skinned models, 400 rock instances, sun and two point light shadows, screen-space outline, 960 x 540), release build on a Mac mini M2 Pro: shadow draws per frame 238 → 0 with everything still and 238 → 39 with the six skinned models moving, median CPU frame time 1.48 → 0.79 ms still and 1.51 → 1.32 ms moving, and the screen is bit-identical to EveryFrame in both cases.
- UI draw cache and fewer uploads (same shape as the original, in the spirit of Unity UGUI Canvas rebuilding only changed graphics): Graphic caches the vertices each component drew (components that report inputs with Component::write_geometry_key, Graphic::draw_component, set_geometry_caching_enabled, is_geometry_caching_enabled, get_last_frame_geometry_cache_hit_count, get_last_frame_geometry_rebuild_count, get_last_frame_retained_batch_count). If the inputs are unchanged draw is not called, and if only the translation changed only the matrix is applied again. A batch is kept in a GPU buffer per draw order in the frame, so when nothing changed only the draw call is issued, and only changed ranges are updated with buffer_sub_data. Directly written vertices without a cache no longer stop a batch from being kept; their values are compared with the same place last frame. The 2D batch CPU array starts at 512 quads and doubles, and the frame-end batch GPU buffer allocates no storage at first. RenderTarget::resolve discards attachments that are not read again after resolving (mobile tile GPUs), and resolve_with_attachment_kept(gl, true) keeps them to continue drawing (original resolve(isAttachmentKept)). Glyph ink padding equals the original (fill 2, outline ceil(width / 2) + 2), and ShadowText adds the shadow offset only to the bottom height, not to the padding on every side.
- Reads without allocation (same names as the original readXxx): WorldNode::read_content_size, read_pivot, read_local_position, read_local_scale, NodeTree::read_position and read_scale write the value into a given place (&mut Vector2) without creating a new one. The value equals get_xxx.
- The toon shadow cache (ShadowUpdateMode::OnChange) no longer re-bakes on values that do not affect depth, such as the base color texture (same as original cee86b9; casters are compared per object, as in Unreal and HDRP cached shadows): ToonDrawQueue::draw_shadows and draw_local_shadows compared caster records in the sorted order of opaque items (material, mesh, base color texture). When the base color texture of one shape changed, the order shifted and unchanged casters looked changed, which either re-baked the whole cached map or never baked at all and redrew everything every frame. Records are now compared in submission order, while baked and overlaid casters are still drawn in sorted order. The compared values (mesh, material, matrices, joints, draw range, culling, mirroring) are unchanged; tint, color and base color texture do not affect depth and do not trigger a re-bake. A moving object still re-bakes in that frame. A capture test tests/shadowcasterorder.rs checks that frames where only the texture changes (40 to 79) draw no shadow depth (15 draws every frame before the fix), that moving a baked box re-bakes in that frame and then overlays only that box, and that the screen matches EveryFrame on every frame.
- Fewer active_texture calls in toon drawing (same as original cee86b9): ToonRenderer switched the active texture unit back to 0 after every draw, so the next draw called active_texture(4) and active_texture(0) again even when only the base color (unit 4) changed. Draws no longer switch back (stage callbacks and on_before_draw of body draws are still called with unit 0 active, and end_frame restores the previously active unit), saving state does not switch units when unit 0 is already active, and restoring skips the unit 0 binding and active unit when the state cache knows they already match. For a frame whose base color texture changes on every draw, active_texture drops from 26 to 11, matching the original. A test (draw_does_not_reset_texture_unit_each_draw in graphics3d::toon::toondrawqueue) checks the call counts, that callbacks see unit 0 active, and that the active unit and unit 0's texture are restored after the frame.
- GL state cache (same remembering rules as the original WebGLStateCache, the pattern of three.js WebGLState and Chrome's GPU command buffer client): Graphic attaches one state cache per context as soon as it receives the context. glow cannot intercept context functions, so every engine state call (bind_framebuffer, viewport, scissor, enable, disable, clear_color, color_mask, blend_func, blend_func_separate, depth_mask, depth_func, front_face, cull_face, use_program, bind_vertex_array, active_texture, bind_texture, pixel_store_i32, and create, delete, link) goes through the cache, which calls GL and remembers the changed value. State reads during drawing (2D framebuffer restore, toon 3D state saving, ToonView3D's viewport, framebuffer, clear color, color mask and five enabled flags) are answered from the remembered values without asking GL. Constant limits are queried once, untracked values are queried as before, and unknown values (first read, unchecked arguments, programs with unknown link status, deleted objects) are queried once on the next read. Where the engine hands GL to game code (get_gl, the end of a run_external_pass pass, after the toon renderer's on_before_draw, after draw queue stage callbacks) the cache does not forget (same as the original; state functions of the GlContext handed over go through the cache). A real GL test (a windowless context made with macOS CGL) calls 600 random state functions mixed with invalid arguments, deletions and resets and checks that the cache answers and comparison functions match real GL (0 differences). New public functions Graphic::get_current_framebuffer() (the framebuffer being drawn to, None means the window), get_current_viewport() (current viewport Rect, device pixels, bottom-left origin) and reset_gl_state_cache() (resynchronizes the cache), matching the original getCurrentFramebuffer, getCurrentViewport and resetGLStateCache.
- GL state cache check mode (off by default, environment variable VANILLA_GL_STATE_CHECK=1): right before every engine draw call (draw_arrays, draw_elements and their instanced versions) the values the state cache remembers (both framebuffers, viewport, scissor, clear color, color mask, blend factors and equations, depth mask and function, front face and culled face, program, vertex array, active unit and the texture of each unit, enabled flags, pixel store) are compared with real GL; on a mismatch it prints that part and the previous 48 state calls to standard error and forgets that part. The comparing reads do not change state (to read each unit's texture it switches the active unit briefly and switches back). In capture mode it prints the number of compared draws and mismatches so far at every captured frame. It is meant for finding places where a game takes the inner glow::Context out and changes state. One real GL test was added (400 random changes through GlContext and the engine path with 40 draws give 0 mismatches, changing the program and another unit's texture through raw glow is caught once each, and the active unit is unchanged after the comparing reads).
- Fewer toon 3D draw state changes (same as the original, the pattern of Unity SRP Batcher, three.js WebGLState and WebGLUniforms): for each draw ToonRenderer asks the GL state cache about the program, the nine texture units, front face winding, culled face and vertex array, and does not set them again when they are the same. Uniforms remember the last uploaded value per program and name and are not uploaded again when the value is the same (joint matrices too; 0 and -0 are distinguished and NaN is always uploaded; the memory is forgotten at the start of a frame and shadow pass, in apply_frame_state (after stage callbacks and the screen space outline), when restoring state, and after that program's on_before_draw). ShaderProgram::use_program also skips when the state cache remembers that program is already in use. ToonDrawQueue sorts opaque items (bodies, outline shells, sun and point light shadow depth) by the first-seen order of material, mesh and base color texture (ties keep the queued order; transparent items stay far to near). In toonshowcase (several models, instanced rocks, skinned models, sun shadow, outline shells, Mac mini M2 Pro release build, frames 121 to 360) GL calls per frame went 878 → 396 (useProgram 36 → 25, uniform 374 → 118, activeTexture 122 → 40, bindTexture 107 → 35, state changes 161 → 120, state reads 31 → 11, draws 35 unchanged), and in toonview (ToonView3D and the draw queue) 1328 → 615 (state reads 37 → 2). The median CPU frame time stays about the same on macOS desktop GL, where calls are cheap: toonshowcase 0.47 → 0.49 ms, toonview 0.43 → 0.45 ms (it drops where calls are expensive, like Safari on the web and mobile drivers). Both examples render byte-identical images to before (both sometimes produce another image depending on asset loading and timing, also before the change).
- Text drawing moved to a glyph atlas (same shape as the original; like the Skia glyph cache, Unity TextMeshPro dynamic atlases and the Unreal font cache): instead of baking one texture per string, only glyphs seen for the first time are baked once into an atlas (1024 x 1024 pages, appended to the most recently opened page, a new page when it is full, up to 8 pages, and the least recently used page is cleared beyond that), and strings are drawn as glyph rectangles in the batch. Baking a new string no longer breaks the batch, and glyphs on the same page are drawn in one draw call. The pending batch is drawn before a page is cleared. There is one cell per text chunk, the same chunks as the original: Hangul, Han, kana, digits, punctuation and emoji get one cell per grapheme cluster, letters such as Latin and Cyrillic get one cell per word, and fonts above 256px, right-to-left text and the web (baked with the browser Canvas2D) get one cell for the whole string like the original. The cell key is, for every glyph in the chunk, (face, glyph index, size, Skia 1/4 subpixel slot) and its integer offset, plus mode and line width and antialiasing (it tells apart the same rasters as the original's 1/8 position slot key). So a new string made of known glyphs (such as a changing number) bakes nothing new. Where the ink of neighboring chunks touches, each cell is drawn separately, so linear filtering at fractional positions and blending of overlapping ink can differ slightly from the whole string (the same as the original, the shape of the Skia glyph cache and TextMeshPro). One row above and below each cell is baked as a repeat of the edge row, so sampling past the cell edge at a fractional vertical position returns the edge row like the old string texture's CLAMP_TO_EDGE instead of another row of the atlas. Chunks without ink (spaces) are not baked. The entry limit goes from 512 to 1024 like the original. 50 lines of text go from 51 draw calls to 2 (including 1 for the background), and a frame with 300 new strings from 351 to 2. On macOS, compared with grouping only glyphs whose ink touches, the glyphparity scene has 1 differing pixel (difference 1) and the difference from the original in Chrome is unchanged (0 pixels over 8 in every region), and the scene with strokes at four widths differs in 69 pixels where the stroke bands of neighboring chunks overlap (the original also strokes chunk by chunk). Baking 300 new strings (release) goes from 23ms to 15ms, known glyphs only from 17ms to 8ms, and 200 new strings made of known digits go from 200 uploads to 0
  - TextStringTextureCache::read_atlas_statistics and TextAtlasStatistics (atlas_page_count, glyph_count, baked_glyph_count, upload_count, entry_count; the original readAtlasStatistics)
- JPEG decoding speed (desktop): the result bits are unchanged while Huffman decoding (11-bit lookahead, a table that decodes the AC code and value at once, a bit buffer that takes 8 bytes without 0xFF at a time), the inverse DCT (8 lanes at once for blocks that do not overflow 32 bits, 64-bit arithmetic when they do) and upsampling and color conversion (per row directly to RGBA, without three image-sized component planes) were reworked. One 12 MP 4:2:0 image went from 124.6 ms to 69.8 ms in median thread CPU time, on par with the old zune-jpeg (image 0.25.10, up to RGBA) at 69.4 ms.
- Shared 3D asset cache (SkinnedModelAsset): skinned model instances built from the same file share one copy of the mesh buffers and vertex arrays, the material prototypes and their textures, the morph textures, the node and skin prototypes and the animation clips, by reference count. (like Unity's mesh and sharedMaterial, or three.js clones, same as the original) The load handle's create_model and load_from_url_async, load_from_fbx_url_async look the cache up by shader program and normalized path (SkinnedModelAsset::normalize_key) and on a hit return an instance without parsing or uploading. The async loads do not even read the file on a hit, and concurrent loads of the same file read the bytes once. (a handle reads the bytes because it does not know the renderer when the load is requested) Added create_instance(), create_from_asset(asset), get_asset(), get_material(index) (Unity Renderer.material: the first call forks a copy that borrows the textures), get_shared_material(index), Material::create_instance(), set_base_color_factor, get_texture_byte_count, SkinnedModelAsset (find, register, clear_cache, get_cached_count, normalize_key, retain, release, get_reference_count, get_gpu_byte_count and more) and SkinnedModelAssetContent. An instance's destroy deletes only its own resources (wireframe buffers, forked morph textures and materials) and releases the asset; when the last instance releases it, the asset deletes its GPU resources and leaves the cache. The clip list is shared by the instances, and adding a clip with an existing name through add_animations_from_fbx_* replaces it in place. add_morph_target forks only that instance's target list and morph texture. Measured (Mac mini M2 Pro, VANILLA_MEASURE_ASSET_CACHE=1 cargo run --release --example modelviewer, 20 copies of one model, building from bytes already loaded): fox.glb from 186 ms and 113.8 MB of GPU memory to 8.8 ms and 5.7 MB, mannequin_female.glb from 45 ms and 32.0 MB to 2.0 ms and 1.6 MB. The GPU byte counts match the original edition exactly. Same API and same test as the original (asset_cache_shares_resources_and_releases_by_reference_count in skinnedmodel.rs).
- Canvas2D (desktop): set_font reads the CSS font shorthand form like Chrome and ignores invalid text (no size or family, CSS-wide keywords such as inherit, an invalid line height and so on), and get_font returns the text as Chrome serializes it (keywords lowercased, relative sizes in px, line height and font width dropped, family names quoted, system font keywords). put_image_data does not write pixel data that is not width x height x 4, and added put_image_data_region in the dirty rectangle form (both versions). Unpremultiplying in get_image_data now uses the same Skia computation as the Chrome CPU canvas (it was off by 1 at values falling exactly on a half). (Blink base_rendering_context_2d.cc font getter and putImageData, shorthands_custom.cc ConsumeFont, Skia SkSwizzler_opts.inc, 225 strings and 65536 pairs measured in Chrome 158)
- DynamicFont::rebuild_atlas: skips characters that cannot be baked and bakes the rest. If none can be baked, leaves the atlas as is. (A single character kept the whole batch from being baked)
- ToonRenderer: GPU instancing (draw_mesh_instanced, matrix and tint per ToonInstance, for both body and outline, skinned models share the same pose), off-screen culling (model bounding sphere against the frustum; instances are culled one by one and only the remaining ones are uploaded, ToonDrawOptions.is_culled), shadows (begin_shadow_pass, draw_mesh draws depth only, end_shadow_pass restores the framebuffer and viewport, received with 3x3 PCF via set_shadow(ToonShadowInput::from_shadow_map)), HDR output (set_hdr_output outputs linear color), drawn count, culled count and draw calls for one frame (get_frame_statistics)
- AudioPlayer: set_playback_rate. Playback speed (pitch changes too, from the next play). kira playback_rate on desktop, AudioBufferSourceNode.playbackRate on the web
- Color::from_cache(color_string): a color cached by color string. (From<&str> builds a new lowercase string on every call; beyond 1024 entries it is cleared and refilled)
- Reads font strings in the CSS font shorthand form, like font of browser Canvas2D. (parse_font_string) Sizes besides px include pt, pc, in, cm, mm, q, em, rem, %, larger, smaller and named sizes (xx-small ~ xxx-large) (relative sizes are based on 10px like the original canvas), the line height of "16px/1.5" is skipped, and small-caps, stretch keywords and oblique angles are accepted. A comma-separated family list looks for faces from the earlier names first for each character. (Previously only the first name was used) An invalid string is treated as the canvas initial value "10px sans-serif". Added FontDescription.family_name_list. (Code that builds the struct directly must be updated) Checked against Chrome's parsed values with tests

## Fixes

- Sun shadow focus step (same as the original 0733926; reduces the OnChange cache redrawing every frame when the focus follows a camera): added ShadowMap::set_focus_step (world step) and get_focus_step. With a step, update_light_matrix snaps the focus to multiples of the step on world x, y and z so the light matrix is identical within a step, and widens the covered width and depth by the step so the area around the focus stays inside the map. Texel snapping still applies on top. The default 0 is unchanged (texel snapping only).
- Toon body variants: reduced the hitch when a combination first appears mid-scene (a light set turning on rim, shade rim or a ramp texture changes the body feature bits) (same as original issue #2). (a) Added ToonRenderer::prewarm_draw_queue_with_options(gl, queue, &options) (the original takes an optional options argument on prewarmDrawQueue; Rust has no optional arguments, so it is a companion function). Pass the combinations the game will use, like Unity ShaderVariantCollection, with ToonProgramPrewarmOptions (Default): light_feature_list (per combination, the light feature names that turn on additionally, e.g. [["rim"], ["rim", "shadeRim"]]; the names are rampTexture, shadeStops, rim, shadeRim, intensityLimit, and a wrong name returns Err), light_set_list (the light sets to be used) and queue_list (draw queues holding materials and instance layouts that appear later), and those combinations are prewarmed. (b) Added ToonRenderer::set_async_program_build(is_async) and is_async_program_build() (default true). With GL_KHR_parallel_shader_compile, a body variant first seen mid-scene only has its compiling handed off and is drawn with the default body program (every feature on) until it finishes, so the frame is not blocked (the picture is byte-identical). Without the extension it is built on the spot as before. Test (a scene whose light changes four times): builds per frame built on the spot [1, 1, 1, 1], combination list [0, 0, 0, 0], light set list [0, 0, 0, 0], and the pictures are all byte-identical. (Mac GL has no parallel compile extension, so the handed-off path runs the same code with a test-only switch)
- Fix: every web example stopped before the first frame (after the global engine change, borrowing the configuration title while building the canvas was extended to the end of the function, so attach_graphic panicked with already borrowed when it modified the configuration).
- Fix (matches the original): the Rust desktop looked up only the regular (400) and bold (700) faces of a system font family, so weights such as 200, 300 and 500 were all drawn as 400 (Chrome picks the family's named weights such as UltraLight, Light and Medium). Every weight and slant face of the family is now a candidate, chosen by the CSS Fonts font-weight matching rule (a desired weight of 400 to 500 looks up to 500 first, then below, then above; below 400 looks down first; above 500 looks up first). macOS reads the family faces and weight trait from CoreText, Windows the family fonts from DirectWrite, Linux the FC_WEIGHT from fontconfig. Added platform::list_family_font_faces. Regular and bold are unchanged. Helvetica Neue, Apple SD Gothic Neo, Avenir Next and Helvetica pick the same face as macOS Chrome 158 (CSS.getPlatformFontsForNode) for every weight 100 to 900, upright and italic.
- Fix: on the web, a canvas without a CSS size (examples with auto_resize_on_window_resize off, such as batchclip) grew by the pixel ratio every frame to tens of thousands of pixels (the pixel size became the CSS size, so each resize multiplied the re-read size by the ratio). It is now pinned to the CSS size first read. A panic on the web now writes its message to the browser console (before, only unreachable showed). Self-exiting examples (batchclip, inputgallery, modelviewer, subtreecull, subtreecullinside, uigallery, uigallery2) also called exit_application on the web, which calls window.close and closed the Safari tab (the original does the same, so the engine is unchanged; the examples now keep running on the web). The modelviewer example clock now uses web_time, which works on the web (std::time::Instant panics on wasm).
- Fixes (same as the original eb4338b, 4e05c55, 61f4793): giving a shader blend to a swapped shader inside an axis aligned clip (shader clip) covered the area outside the clip when the overlay target was moved and blended (the shader clip scissor is set again after clearing the overlay target). Opening an opacity layer cleared only the stencil, so the depth of the previous layer remained and a 3D pass inside the layer that does not clear depth (is_depth_cleared false in run_external_pass) was hidden (depth is cleared to 1 together with the stencil to the current clip depth). ShadowMap::begin_render did not turn off the scissor test, so an outside pass inside a 2D clip cleared only part of the map (turned off in the map binding shared by the sun shadow map and the point light map).
- UIDocument image and node data fixes (same as the original): a copy written and read with the same document uses the original's image as is. Writing (serialize_node, to_json_text) remembers the image of a component that wrote imagePath by its path, and the resolver and load_images assets put that image in when they cannot find it (like Unity Instantiate). So an item cloned with UIListView::set_template_node shows its image (before, without a resolver the item had no image). A custom handler remembers it too when it writes the path with UIDocumentSaveContext::write_image_path(document value, path, image). bind_pending_images does not overwrite a component the game gave an image or changed the path of in the meantime, so UIDocumentLoadContext::bind_image takes two more functions that look at that place (current path, current image). An image that load_images could not read is requested again by the next load_images. Writing warns when a node reference points to a node that has an earlier sibling with the same name (the path is written by name only, so reading it back lands on the earlier sibling). A hidden node (set_visible(false)) writes and restores visible: false in the node data (a visible node writes nothing, so documents written so far and their expected values stay the same; UIToast, which uses active as visibility, writes only active as before).
- Fix: the joint index vertex buffer of skinned models (SkinnedModel::bind_integer_attribute) converted the u16 indices to f32 before uploading while the pointer reads UNSIGNED_SHORT (slipped in when logic numbers moved to f64), so the shader read outside the jointMatrices array with broken indices (undefined behavior). It now uploads u16 as is, like the original (Uint16Array). Because of this the two mannequins in modelviewer stood in a T pose, and depending on what the driver read outside the array the arm triangles sometimes stretched far (removing the state cache resets at the boundaries made them stretch and asking GL anything made it vanish, so it looked like a state cache problem). Now the mannequins walk with their clips, and the four toon examples (toonshowcase, toonview, toonfx, toonpost), modelviewer, blendmodes and batchclip render pixel-identical images with the safety net, without it and in check mode (frames 60 to 590 for the four toon examples and modelviewer, 60 to 240 for blendmodes, 149,037 draws compared in check mode with 0 mismatches).
- Shadows of the desktop dialog, context menu and touch quick menu: drawn with a Chrome-like Gaussian blur instead of overlapped rounded rectangles. The context menu uses the original CSS box-shadow 0 4px 16px rgba(0, 0, 0, 0.18) with sigma 8 (half the blur radius) like Blink; the dialog and quick menu use Chrome views BubbleBorder's two layers (down 2, blur 8 and 12, #3C4043 alpha 0x33 and 0x1A) with ui/gfx RadiusToSigma (blur / 2) as sigma. The rounded rectangle is baked on the CPU (device scale, reused for the same values). On the Mac the right-hand shadow cross section of the context menu matches the original DOM menu in headless Chrome within 1/255.
- Desktop window: when a GL 3.3 core context was requested and the driver gives a lower version (like the GDI GL 1.1 on Windows without a driver), the panic inside glow for missing shader functions is now reported as the error "OpenGL 3.3 core is not available: <version>" and ends.
- Corrected the description of UIInputField::set_use_direct_touch to match the facts. It is not web-only; on desktop it does what Chrome does for that DOM input in the original (word selection by a long finger press and touch handles, while the right button opens the engine context menu)
- Scene touch: the original vanilla.js Scene was also changed to pass touches to nodes through the scene's TouchRaycaster regardless of the scene type, so the two engines are the same. (The Rust version's SceneBase.tick is unchanged; fixed the documentation text "the original default scene does not pass them")
- Engine: sets the view coordinates (view_manager.apply_view_rect) before drawing for each scene (before pre_draw, or before draw_on_load while loading). (Fixed in the original too) Until now a scene that did not call draw_scene_background or apply_view_rect in pre_draw drew in the physical pixels of the drawing buffer, so on screens with a device pixel ratio of 2 (Retina Macs, high-density screens on the web) it drew only in the top-left 1/4 of the canvas. How to migrate: a scene that drew in physical pixels calls graphic.set_transform(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) in pre_draw
- format_compact_number: when the rounded text reaches 1000, moves up to the next unit. (999999 is "1M", not "1000K"; fixed in the original too)
- UIScrollBar: auto-hide no longer disables the node, it only makes it invisible. (Disabling it stopped tick, so it never came back; fixed in the original too) Added is_auto_hidden()
- Sprite: flipping (set_horizontal_flip, set_vertical_flip) used to draw outside the content area (on the negative size side); fixed to mirror within the content area. Atlas pieces, nine-slice and tiles all flip. Even when flipped, is_drawn_inside_content is true, so it gets off-screen culling. (Same as the original)
- Web audio: fixed an earlier request that finished late making sound when stop or play again was called while a suspended AudioContext was being resumed. (Playback request numbers)
- ParticleSystem: fixed bursts at the loop seam (the repeat boundary) firing only in the first cycle. Bursts at 0 seconds and right before the boundary also fire every cycle, and when one frame skips over several cycles they fire that many times. (Same as the original)
- Position of the web hidden input: adds the document scroll, like the original. (A bug where it was misplaced when the page was scrolled)
- VisualAsset: fixed load, which only recorded the path and finished immediately, to work like the original. load(engine, path) requests the bytes, and when the bytes arrive it checks for the visual editor document form (JSON object, root object); if it matches, it is loaded and holds a Visual with that text. Added create_visual_from_text, load_from_bytes, unload. How to migrate: change load(path) to load(engine, path).
- HumanSkinRenderer: corrected the eye iris order in the texture unit comments. (12 iris normal, 13 iris color; the behavior was already correct)
- SkinnedModel: fixed, in the original too, the vertex arrays, buffers, morph textures and materials of the old drawables being left behind and leaking when upload_meshes_and_materials is called again. (destroy first) upload_wireframe_indices also deletes the line buffer already uploaded and uploads anew.
- Material::create_from_description: if an image partway through cannot be decoded, deletes the textures built so far and returns an error. (The original was fixed the same way)
- ShaderProgram::new, create_with_attribute_locations: if the fragment shader or the program cannot be built, deletes the shader built earlier. (The original was fixed the same way)
- Localization::is_right_to_left: reads in lowercase with underscores as hyphens, like set_right_to_left. ("ar_EG" was not detected as a right-to-left language; the original was fixed the same way)
- UINode::add_constraint: constraints the solver did not accept (already added, contradictory) are not kept in the list. (The next set_solver stopped at the same error and later constraints were not applied; the original was fixed the same way)
- Sound decoding (WebM, MP4 trimming): prevented overflow panics from EBML signed integers longer than 8 bytes, extreme-value cluster timestamps and CodecDelay, very large MP4 box sizes and edit lengths, and iTunSMPB priming longer than the sound. (Even broken files are trimmed without panicking)
- UISpinner::calculate_dot_opacity: with no dots (dot_count 0) it no longer becomes NaN from dividing by 0. (The original was fixed the same way)
- UIListView::set_horizontal: when changed, re-measures the scroll area on the next tick and lays out the visible items again along the new axis. (The original was fixed the same way)
- Original bug found while porting UIDocument: Sprite's nineSlice was written but never read. The Rust version reads it by decoding the form the original writes (left, top, right, bottom of a Rect)
- ParticleSystem changed behavior: instead of always drawing with the image once an image is set, draws with the image only when the render shape is image, like the original. The description's edge, which was read as a flat rectangle spreading upward, now emits downward like the original. Because a wobble phase is drawn per particle, particle positions of particle systems with a fixed seed (timelines) differ from before. Like the original, circle uses unrotated quads, size does not go below 0.1 and alpha does not go outside 0 ~ 1
- SoundSystem: filled in what was missing from the original core/soundsystem.js. set_autoplay_allowed_provider (asks for permission once on the first update and tries waking before a press), muting when the window loses focus on touch-primary devices (released on a press, on regaining focus, or on becoming visible again), muting on the spot via the engine's page events when the page is hidden, pausing the AudioContext while muted (web suspend, desktop silences the main track) and waking it again every 0.5 seconds after unmuting, not playing sound effects before the first press or while the AudioContext is not running, left-right pan of play_effect, remembering requested background music and playing it once loaded and stopping it with "", "" (all) and 0 seconds (cut immediately) for fade_out_effects, picking only loaded recordings, volume sanitizing (0 if not a number), get_music_scale, is_page_hidden, is_blur_mute_enabled, is_window_blurred, is_context_paused, is_context_running, get_last_context_resume_time. update takes the engine (update(engine, time_delta)), play_effect takes pan, and get_music_id returns the requested id (&str, "" if none). (This changes the public API) Fixed resumed playback always starting from the initial position (AudioPlayer.get_time does not advance during playback) to start from the position computed from elapsed time, like the original
- Aligned what differed from the original vanilla.js in effects, 3D and animation. (Reverted forms that had been made different back to the original's usage, ported what existed only in the original, and fixed bugs present in both engines in both)
- Fixed the toon examples (toonview, toonfx) stopping immediately on the web. On the web, glow panics when reading the binding while no framebuffer or texture is bound, so they are read with graphics3d::read_framebuffer_binding, read_texture_binding (treated as the default on the web), and empty depth texture bytes are read from a u32 aligned to 4 bytes
- Animation: filled in pause and resume. (goto_and_stop stops) stop returns to the first frame even when stopped. (Fixed the original bug too)
- Timeline: attaches to the stage parent if the parent is itself or a cycle. Fixed the header comment saying the original easing was wrong. (The original pow was already fixed, so the easing values of the two engines are the same)
- SoundSystem.get_music_bus, get_effect_bus (original getMusicBus, getEffectBus, None before the first press): music and effect volumes, previously multiplied per player, are applied to these buses. Players created from a bus also follow the settings volume and mute. The bus volume is applied only when the computed value changes, so a value set with the bus's set_volume, mute lasts until SoundSystem applies the volume again (the original also applies to the same node)
- Web: fixed text baked by the browser when there are no font bytes (platform/web/systemfont.rs) taking only the canvas alpha and uploading it as white, which made color emoji appear as white silhouettes. Uploads RGBA as premultiplied like the original. System font pieces (characters not in the registered fonts) are split into coverage for white pixels and the color portion for colored pixels. With antialiasing off, thresholds by alpha and fills with straight color. (The original thresholds the alpha channel of straight alpha)
- The original bugs fixed first in the Rust version (UIDocument nineSlice reading, UIDropdown header button tint, UIInputField paste cursor, LayoutSolver artificial rows) were also fixed in vanilla.js and now match, so they were removed from "differences from the original" in the header comments. The UILabel background order was already the same in the original
- The OBB.overlaps, NodeLayout.arrangeFan and SoundEffectPool voice count 0 bugs were fixed in vanilla.js too and AudioAsset.getLoadError was added, so those 'differences from the original' were removed from the header comments of this version. (obb, nodelayout, soundeffectpool, audioasset)
- Changed the value of KeyCode::AUDIOPLAY to "MediaPlayPause", the name in the W3C KeyboardEvent.code table (2025-04-22 Recommendation). (Fixed together with the original) "MediaPlay" is neither in the table nor in winit KeyCode, so it never matched on desktop. Chrome emits "MediaPlayPause" for the common play/pause key (USB 0x0C00CD) and "MediaPlay" only for the play key on Linux and ChromeOS (USB 0x0C00B0)
- Fixed AssetLoader.get_in_flight_count to follow the definition of the original getInFlightCount: items picked up and started but not yet finished. (Images through decoding, sounds through audio decoding) External handles added with add_load_handle (in place of the original addTask) are also counted until they finish, and the concurrency count uses the same count. (An original worker occupies one slot with an addTask until it finishes) Until now external handles were excluded and an item counted as finished when its bytes arrived
- What the browser used to provide, now with the same API on desktop too (the original runs on Chrome, the Rust web version uses the same browser features, and on desktop the engine does the same work)
  - Canvas2D, Path2D, CanvasGradient (linear, radial, conic), CanvasPattern, ImageData: the canvas and 2D context the original and games use through document.createElement("canvas") and getContext("2d"). The web uses a browser canvas not attached to the document, and the desktop paints with tiny-skia (the same version resvg uses). Paths, strokes and dashes, clipping, shadows, 26 compositing modes, images, text (engine text cache), pixel read and write, to_image
  - Engine::alert, confirm, prompt and alert_async, confirm_async, prompt_async: in place of the original window.alert, confirm, prompt. Both the web and the desktop use a dialog drawn by the engine like a Chrome tab-modal dialog (title "This page says", an input field with the default value fully selected, [OK][Cancel] on Windows and [Cancel][OK] on macOS and Linux, Chromium translations for 82 locales). While it is up, scenes and async tasks pause. The Local Storage tab of DevTools also uses it (removed the in-panel input window)
  - Document: html lang and the meta in head. The web uses the browser document, and the desktop values held by the engine (EngineConfiguration.document_language, document_meta_list). BuildInfo reads build-version from meta first on desktop too, and LanguagePack changes the document language on both platforms
  - Pane, PaneStyle: split panels built from engine nodes on desktop (the same size and drag computations, theme colors, resizer cursors), PaneStyle preset nodes (PaneElement, set_on_click). PointerCursor::request_element_cursor
  - Input fields: undo and redo for desktop DOM input fields (Blink grouping rules, Ctrl+Z, Ctrl+Shift+Z, Ctrl+Y, Alt+Backspace on Windows), and the Chrome editable field context menu for direct-touch fields (Emoji, Undo, Redo, Cut, Copy, Paste, Paste as plain text, Select all, Writing Direction, Inspect). Inspect makes the developer tools select that node via Engine::request_dev_tools_inspect
  - LocalStorage, PersistedStore: preserve unpaired surrogates saved by the original (truncated emoji, \ud83d from JSON.stringify) as the original UTF-16 units. Previously such JSON could not be read, so PersistedStore fell back to defaults and overwrote the original's save on the next write. get_item_code_units, set_item_code_units
- Fix (matches the original): a tab at the end of a line in the multi-line input field (UIInputField) now hangs like a space, as in Chrome pre-wrap (removed from the line width when breaking lines). In a column narrower than the tab width, "tab\there" broke at [0, 4] in Chrome but [0, 3, 4] in the engine (added the tab to trim_hanging_spaces in textarealayout).
- Fix: UISpinner dot positions were off by one in the last digit on Linux (glibc cos differs from Chrome V8 in the last digit, so the test comparing with the original values failed only on Linux). cos and sin now come from the pure Rust libm crate (fdlibm family), so macOS, Linux and web give the same values as V8. No new dependency (a version other crates already used, already in the license notices).
- Fix: the audio thread could render one more quantum (128 frames) right after the AudioContext was suspended by Hidden, so currentTime still advanced (the Linux CI test page_events_mute_and_unmute failed now and then). Like Chrome audioContext.suspend(), whose promise resolves after the clock has stopped, the desktop suspend_audio_context now waits (up to 200 ms) until the audio thread has received the suspend. The clock does not advance after it returns.

## Tools, docs and examples

- Example toonshading (same scene and screen layout as the original examples/toonshading: title, VANILLAPUNCH.COM link below, copyright notice at the bottom left): reads a VRM 1.0 character (VRM1 Constraint Twist Sample, pixiv Inc., VRM Public License 1.0) with the engine SkinnedModel and cel-shades it with the original shader source. The scene MRT, hair depth pass (bangs shadow and see-through), shadow map, bloom, rim light and ACES composite, and FXAA run in the same order. Six expression buttons with blinking and eight Quaternius animation (CC0) buttons retarget world rotation changes against the T pose onto the VRM bones, and the roll and aim of VRMC_node_constraint are followed. Drag orbits, the wheel zooms, right-drag moves the focus height. Assets are read from the original repository. Not there yet: spring bones, head and eye following, the options panel and sliders (values fixed to the original defaults), wireframe, the rendering info display, the context menu.
- Example cameratour (same screen and behavior as the original examples/cameratour): Camera2D slowly turns left and right while following a target and shakes every 3 seconds (Shaker). Dragging pans in the rotated direction (pan_by_screen), the wheel zooms keeping the point under the cursor fixed (zoom_at). The node at the top left has its scale moved by Tween::create_node_tween, and an Indicator spins at the top right.
- Examples ancientmountain and neonhorizon were ported from the original vanilla.js. ancientmountain is a third-person mountain climb (procedural terrain with grass, a dirt path and three-way cliff textures, mannequin run, jump, climb, drop down, six foxes, summit flag, OFF, SIMPLE and REALTIME shadows, bloom, motion blur, option panel, gamepad) and reads its assets from the original repository. neonhorizon is a neon-grid terrain run (stars, meteors, a fleet, boost light streaks, dust, bloom, chromatic aberration, film grain, option panel) and keeps two models in examples/assets/neonhorizon. It runs the original's shaders and formulas on the engine's ShaderProgram, FullscreenPass, RenderTarget, ShadowMap, BloomEffect and SkinnedModelRenderer. Asset licenses are written in THIRD_PARTY_LICENSES.md.
- Crate license files: vanilla-engine-macros, vanilla-engine-apidoc and vanilla-engine-licenses also get the same LICENSE as the root (copyright holder vanillapunch), listed in include so it ships in the cargo package. authors are written for apidoc and licenses, and licenses also carries the SPDX full texts.
- Example asset license cleanup: matches the original vanilla.js repository replacing the Mixamo original files with the Quaternius Universal Animation Library (CC0). modelviewer reads mannequin_female.glb (Idle, Walk, Run, Dance) and mannequin.fbx instead of soldier.glb and Remy.fbx, and toonshowcase reads mannequin_female.glb. The FBX test (walk_fbx_from_examples) checks the Blender-written 7.4 format and the pelvis bone. The Remy.fbx and centimeter scale lines of the 15-3d guide changed too. The doc images model-viewer and toon-showcase and the upper left cell of README's modelviewer.jpg and hero.jpg were retaken with the new scene (1280 x 720).
- License notices: files ported from other sources (mixer, decode/opus, decode/trim, textinput, canvas2d, textshaping, maskgamma, coretextglyph, systemfont, linuxplatform, browseruitext, colorglyph, component/text, format, autolayout, tween, matrix4, subsurfacescatteringeffect, and the experimental tilemap, physics2d, dynamictree) got the source and a one-line license right under the header block. THIRD_PARTY_LICENSES.md gained Skia's maskgamma and coretextglyph, Chromium's opus_audio_decoder, opus_constants.h, audio_file_reader and audio_discard_helper in the bundled materials section, and a public domain and CC0 code section.
- cargo package: Cargo.toml's include ships only the source (and its data), LICENSE, THIRD_PARTY_LICENSES.md and README.md. (docs, examples, tests and test assets, and tools stay in the repository only)
- License: the engine's copyright holder is now vanillapunch. (LICENSE reads "Copyright (c) 2026 vanillapunch", the README and the guide overview read "© vanillapunch", still MIT) Third-party license notices are collected in one file, THIRD_PARTY_LICENSES.md, and a workspace tool that builds it, tools/licenses (vanilla-engine-licenses, uses only serde_json), was added. It holds the license expression, the license used, the copyright lines and the full texts (each identical text once) of the crates the engine uses (normal and build dependencies) on the three desktop OSes (x86_64, aarch64) and wasm32, and lists crates used under licenses that require no notice on one line each. Bundled materials that are not crates (the IRCAM notice of the HRTF data Composite.flac, and code and tables ported from fdlibm, Chromium and Blink, Skia, ICU4C and CLDR, font-rs, Kiwi, tween.js, gl-matrix, Separable SSS, and libtiled and Box2D in the drafts) are written in the file's bundled materials section with the engine files, the original files and the original notices. The Cargo.toml of the engine and macro crates now has authors = ["vanillapunch"]. (Used in the notice of the macro crate package, which has no license file) Games build their own file with the same tool, covering their dependencies and the materials the engine bundles. (The license section of the README, licenses in tools/TOOLS.md)
- Tests: the desktop platform test tests/desktopplatform.rs (#[ignore]; system font and fallback font lookup, fallback font text and color emoji raster, comparison with the same machine's Chrome measureText, clipboard round trip) and tests/assets/systemfont/chromemeasure.cjs, which records Chrome values. The mixer's Chrome comparison accepts a sum of squares within 1e-5 (relative) when the operating system and CPU the expected values were recorded on (platform and architecture in chrome_mixer.json) differ (automation's exp and pow are the operating system math library, so the last digits differ).
- CI: .github/workflows/platforms.yml runs cargo test, the desktop platform test, example capture (Mesa llvmpipe software GL), audiotone on a virtual sound device, re-recording the sound Chrome expected values with that machine's Chrome and comparing, capturing the original example pages with headless Chrome for pixel comparison, and the wasm32 example build on Windows, Linux (X11, Wayland) and Intel Mac (.github/scripts). Instead of the Chrome installed on the runner (versions differ by machine; the Intel Mac had 151), browser-actions/setup-chrome installs the version the expected values were recorded with (Chrome for Testing 158.0.8127.88) on all three machines and hands it over through CHROME_PATH. Example capture reads the GL renderer line and the per-frame progress line ("Engine: capture progress frame N / last, T seconds") that the engine leaves in capture mode, and classifies no progress for 180 seconds as stuck and exceeding the time limit while progressing (default 900 seconds, oldface 2700 seconds) as slow.
- Doc text: restored to the original names the original JS names that were changed to snake_case during the renaming (original playTone, audioContext, Graphic.drawNode and the like, 105 places), shader uniform names (modelMatrix, tintColor, globalAlpha) and Canvas2D names
- Guide: updated chapter 13 Animator, the destroy() of ScreenEffect and HeatHazeEffect in chapter 14, and VisualAsset and Visual::create_node in chapter 19 to the changed APIs
- Docs: corrected InputManager.set_touch_pressed (Moved stays on while pressed), Engine's desktop occlusion (minimization, app suspension and Wayland frame callbacks are also Hidden), load_scene_async (it fails to resolve only when unloaded before create in the same frame), and Scene::initialize (0.3 seconds after create even when nothing is entrusted) to match actual behavior.
- Doc comments: LayoutTerm (the solver skips the original's terms without a variable), UIView (the original's setBackgroundColor(null) corresponds to a color with alpha 0), NodeLayout (anchored_position is applied at build, same as the original), UIScrollBar (removed the line about the thumb color difference; the original was aligned to (1, 1, 1, 0.6))
- Tests: zero_value_terms_add_nothing, fast_short_drag_flings_one_page, snap_to_nearest_crosses_pages, line_chart_max_sample_count_trims_oldest, background_color_can_be_cleared, image_asset_gives_its_image, anchored_position_follows_call_order, language_list_without_aliases_is_accepted, frame_per_second_overlay_text_and_box
- Matched doc text to the code: ShaderProgram (original name attributeLocationTable), Mask (NodeTree::draw_node clips), TweenProperty::get_name (first letter lowercase), ButtonMotion (the tick and is_drawn_inside_content headers, set_lit_handler), GraphicsQualityGovernor (environment variables `VANILLA_<name>` on desktop), FixedStepper::new, PointerCursor::is_coarse_pointer (Windows tablets, Linux touch), ViewManager render scale cap (desktop uses it too), AudioBus::get_gain_node (desktop Rc<MixerGainNode>), UIWindow (as_any, dispose, set_dim_color, set_panel_color), the coordinates of UIContextMenu::show, the ui module header, README asset loading example names (C-CASE)
- Example: toonshowcase. Draws seven basic shapes and the walk of soldier.glb in toon style. Giving a GLB path in TOON_MODEL_PATH places that model too. (Desktop)
- Example toonshowcase: draws 2,000 rocks around the edge with a single instanced draw and culls off-screen ones. (690 drawn, 1320 culled, 20 draw calls) Shadows, HDR bloom and tonemapping
- Example: engineextras. Places borders, progress rings, expanded hit areas, button feedback and toasts, shadow text and shadow images, soft shades, the mouse cursor, camera gestures and input state on one screen. Input is not emulated, so press them directly on desktop and web
- Example: nodebasics. Creates nodes and attaches Paint, Text and a custom component (Spin). (The code from the README section 'Nodes and components')
- Example: scenedocument. Reads and draws a scene file made in the original UIDocument and editor save format (examples/assets/scenedocument.scene.json), exports it again and shows on screen whether it matches the document read
- Example effectgallery: placed eight ParticleSystem cells at the bottom right (circle fountain, rect confetti, streak sparks, image stars, attractor vortex, wobble droplets, edge snow, world space trail). The trail below moves only on the left
- Examples particleeffects, spriteeffects, uisample: ported with the same scenes as the originals. particleeffects has eighteen particle effects (list, usage code panel with COPY, stats panel), spriteeffects has a list of sprite shaders, screen effects and twenty-five staging scenes, uisample loads a uiasset with UIDocument and wires buttons and a progress bar. The environment variable VANILLA_EXAMPLE_MODE picks the first mode. The hero sheet animation in spriteeffects is stepped by the example because SpriteAnimator cannot find the Sprite inside a ShaderSprite
- Example uishowcase: ported with the same scene as the original VANILLA CONSOLE. UIDocument reads six uiassets and the code adds four screens (dashboard, store, settings, components), themes (Dim, Dark, Light, saved in LocalStorage), popups (PopupMotion, Typewriter), toasts, a context menu (right button or long press), drag chips and responsive layout. The environment variable VANILLA_EXAMPLE_MODE picks the first screen (home, shop, settings, components). The theme dropdown deletes and rebuilds itself, so the theme applies on the next update
- Example inputgallery: shows input actions (press, repeat count, move axis), the finger list and phases, and the last device at the bottom right, using emulated keys, fingers and external sources. Example engineextras: last device and gamepad kind in the input state line
- Example: toonview. Toon inside a node rectangle (ToonView3D), 2D labels placed over 3D points with Camera3D, three translucent balls drawn farthest first, faceted rocks joined with combine, and ToonPostProcess color grading and vignette on the right panel
- Example loadingshowcase: loads seven images and one document three at a time with AssetLoader (one missing file goes to the failure list), a customized loading screen (spinning dots, rounded bar, loaded count) whose progress fills while emulating ten post-load steps, and after loading, a ball moved with FixedStepper
- Example: toonfx. Draws screen-space outlines on shapes and instanced rocks with a perspective camera
- Example toonfx: every 3 seconds an explosion (shockwave, fireball, scorch, spark streaks, smoke, dirt grains), smoke plumes, flowing ring marks, and every frame beams, lightning, ribbons and glints, drawn together with screen-space outlines
- Example: windowshowcase. Play area reference (emulating safe areas of 40 at the top and 30 at the bottom), stacking a basic window and a long-text confirmation window, outside press and close all, screen fade (held for 0.6 seconds with a hold handle), only presses not taken by the UI go to play. For the first few seconds it tours by itself
- Example: textnodeextras. Text box fitting (Text, UILabel), text with moving scale, translucent rings, a shrinking arc and 600 line segments, an atlas baked with atlas.cjs (examples/assets/atlas), shadow text sharing baked images, the mouse position over a rotated panel (convert_view_to_local)
- Example oldface: the original OLD FACE scene (shadows, skin MRT, blending, AO, SSS, bloom, ACES, FXAA, expression morphs and wrinkle maps, blinking). Captured at the same time as the original, mean difference 0.8/255. The expression changes every 4 seconds and is chosen with number keys
- Example misctour: Camera2D rotates slowly left and right and draws with begin, end
- Example: panelayout. A particle editor style window layout (toolbar, fixed-width vertical split on the left, engine canvas in a flex panel on the right). Web only, desktop only prints a notice
- Example: devtoolsshowcase. Places a few nodes and leaves the developer tools open. (Initial tab via VANILLA_DEVTOOLS_TAB)
- Example: uiscenelayout. UIScene and UINode constraints (safe area guide, weak preferred width and range, margin guide, equal-width buttons, natural-size text). Opens the developer tools when VANILLA_EXAMPLE_DEVTOOLS=1. windowshowcase was changed to the GameScene trait, the play input handler, and fade_screen_with_hold
- Example: textshaping. Arabic right-to-left text (Rtl, Auto, RichText), synthetic italic and bold, italic, underline and strikethrough on shadow text, CJK word wrapping, visible count in grapheme clusters, DynamicFont
- Example textshaping: a color emoji line (😀👍🏽 ❤️❤ 🇰🇷 👨‍👩‍👧 1️⃣), emoji in shadow text, italic emoji, ⭐ in the glyph atlas
- Example blendmodes: the 26 blend modes, one per cell. The scene changes every 60 frames (translucent images and shapes, text with nine-slice and clipping, batched and single particles, swapped-in and default shaders)
- Example toonpost: the same scene in three setups (ToonPostProcess default, multisample 4 with depth 24 and 5-level bloom, brightness, lit area and saturation on the LDR path), stain marks, oil sheen, flickering scorch, shadow under the feet, covering-style fireballs, shockwaves and ribbons, 120 light dots (cap 160), fireball events with key and age. Time is frame count / 60, so every capture is the same
- Example toonmaterial: seven-segment digits from a material surface chunk, base color texture and decal, three point lights with specular, rim and fill light, a 4-step half Lambert band from a different light set, two additive holograms (with and without a depth prepass), a planar floor mirror (before-opaque stage), and rocks in a persistent instance buffer. The same scene as the original test page. (Frozen and captured with TOON_MATERIAL_FRAME, the pixels are nearly identical to the original) At startup, converts the Aberrant body shading formula to engine options, draws it into a float buffer and compares it against CPU computation (maximum difference 4.5e-8)
- Updated the documentation to match the current code. (the code is unchanged)
  - README: strengths and example list (seven new examples), asset formats (images gif, bmp, ico, svg, avif, sounds flac, m4a), technical notes (text rendering, render target multiply, 0.3 second loading), the tls feature flag and Windows, Linux target checks, recommended rav1d opt-level, frame capture for verification, external dependency tables (per Cargo.toml and Cargo.lock, added Windows and Linux tables), ShaderSprite effect count (49 excluding none)
  - ARCHITECTURE: layout and ownership structure, frame loop, blending, fonts and asset formats, chapter 9 correspondence with the original (181 of the original 200 files ported, the 19 files deliberately not ported and why), chapter 10 differences between the two engines (what truly cannot be matched and deliberate design choices)
  - In the header of this version in UPDATE.md, merged the duplicated lines (six copies of the capture mode) into one, and corrected the old description in the math line
  - Header comments: things now the same because they were fixed in the original too (batching and culling on by default, program and texture caching, Text culling, use_dev_tools of UIScene, WebSocket binary JSON, Identifier.reset, Vector2 bugs, pageshow restoration, DynamicFont re-placement, zero-duration tweens, set_playback_rate), UIImageView draw order (the original also draws the background first), image format lists (Material, GLB images, the unused avif-parse), web text baking, the initialize name of Scene, the place of the web module in lib.rs
- Example devtoolsshowcase: Spin has #[vanilla::reflect], so degreesPerSecond shows in the inspector
- Example toonstyle: a scene comparing toon shading and outlines. (TOON_STYLE_SCALE sets the line buffer scale, TOON_STYLE_TOGGLES=1 the per-model options) The same scene as vanilla.js examples/toonstyle. Captured in a hidden window and compared with the original (headless Chrome) at 2560x1440, the average pixel difference is 0.005 and 0.024% of pixels differ by more than 8. (A few faint crease lines at the crease angle threshold)
- Example toonfx: switched to the new set_crease, set_depth_threshold
- Example toonfx: switched to the new set_crease(60.0, 0.011, 0.8) (world units), set_depth_threshold
- Example toonmaterial: removed the comparison against the Aberrant body shading formula. (It is one game's formula, and since the engine light model changed to the standard form it no longer gives the same values) Removed the normal length correction in the rock vertex chunk
- Example toonstyle: three shade tones, hard highlights, sun-side rim, spotlights, matcap, shell outlines with TOON_STYLE_SHELL=1. Compared with the original at 2560x1440, the average pixel difference is 0.004 and 0.018% of pixels differ by more than 8 (0.279% for the shell scene, MSAA differences at geometry edges)
- Example toonstyle: point light and spotlight shadows, shade-side rim, angel ring, shell outlines fading out and pushed along the camera direction. Compared with the original, the average pixel difference is 0.005 (0.008 with the half-size buffer, 0.163 for the shell due to MSAA differences)
- Docs: changed the description lines of function and type header comments (between two `//====` lines) into rustdoc doc comments (`///`, `//!` for file headers, `///` directly above fields and enum values), and filled in a description and the `# Arguments`, `# Returns`, `# Examples` sections (headings written in Korean in the source) for the entire public API. Also added them to functions that had no header comment. The 869 examples (44 modules, 377 structs and traits, 384 members, 64 functions) are compiled and run by `cargo test --doc`. (Those that need a window or GL are only compiled, with no_run) The format is the doc comments part of chapter 8 'Code style' in ARCHITECTURE.md. Input fields, Pane, Canvas2D, LocalStorage, PersistedStore, storagetext and toon 3D only had their comment format changed, and their arguments, returns and examples will be filled in later
- Guide docs/guide/0.4.0/ko, en: overview, getting started, architecture, tools, and 05 project setup through 19 authoring tools (the same chapters as the original vanilla.js guide), plus the Rust-only 20 reflection macro, 21 async/await, 22 porting from the original. Of the 216 code blocks, the rust blocks are compiled and run as doctests by the library target of tools/apidoc. (apidoc rewrites the chapter list tools/apidoc/src/guide.rs with an include_str doc attribute for each chapter file) Update notes docs/update/0.4.0.ko.md, .en.md
- Example toonstyle: tilts the camera with TOON_STYLE_ROLL. Compared with the original, the average pixel difference is 0.005 (0.005 for the tilted scene)

## How to migrate

- A 3D color space setting: compose_toon_program_sources and ToonRenderer::read_material_program_sources take is_ambient_occlusion and color_space at the end (false and ColorSpace::Gamma to keep the old result). read_glb_arrays and read_glb_node_arrays take color_space: Option<ColorSpace> at the end (None means the engine's value). ToonScreenOutline::read_program_sources takes color_space and returns five (String, String). Graphic::new takes the color space as its third argument. ToonLineTarget::jump_flood_index is Option<usize> (see ambient occlusion below). Code that builds ToonTextureOptions or ToonPostProcessOptions by listing every field adds is_color_data or color_space, or uses ..Default::default().
- Toon ambient occlusion: ToonLineTarget::jump_flood_index is Option<usize> (None when nothing was flooded, the original uses -1). Games that used a zero-width outline (set_width(0) and crease width 0) will see that screen change.
- Toon screen outline thin line path, resolution scale and clearing before buffers: ToonLineTarget seed_framebuffer and seed_texture are Option, jump_flood_framebuffers and jump_flood_textures are Vec (empty until a thick line is drawn), and edge_mask_framebuffer, edge_mask_texture, coverage_framebuffer (Option), coverage_texture (Option) and outline_path (ToonOutlinePath: None, Thin, ThinScaled, JumpFlood) are added. read_program_sources returns nine. The line_texture and depth_texture resolution of get_line_target is smaller than the drawing area when set_resolution_scale is below 1.
- Web image decoding through the browser: on the web, Image::load_from_memory, load_from_memory_with_mime_type and Engine::load_image (data: URL) return Err. Await ImageAsset::load or load_from_bytes, or load with AssetLoader. (the original has no path that decodes image bytes on the spot either)
- Subtree draw skipping: WorldNode::set_last_drawn_maximum_scale takes the draw frame number as its second argument (original setLastDrawnMaximumScale(maximumScale, frameNumber)). A user component that overrides calculate_drawn_rect calls mark_drawn_rect_dirty from setters that change that rect. Without it a drawing that grew into the screen may not be drawn. Replacing a NodeTransform as a whole (*get_transform_mut() = ...) does not report dirtiness, so use the setters.
- Streaming audio loading: background music played through SoundSystem streams when load_type is absent, so code that used that asset's get_audio_buffer() directly sets the sound row's load_type to Some(AudioLoadType::DecompressOnLoad). Code using AudioAsset directly keeps the same default and needs no change; to stream, call set_load_type(AudioLoadType::Streaming). A streaming asset's get_audio_buffer() is None. Code that builds SoundRow as a struct literal adds load_type: None. On desktop get_stream_url is the file path when loaded from a file and None when loaded from memory (on the web it is the URL or a blob: URL as in the original).
- Graphic no longer remembers bindings and 2D state separately and compares agains: removed Graphic::invalidate_render_state_cache (the original invalidateRenderStateCache was also removed). Delete the calls. If you changed state through the inner glow::Context without going through the state cache, call reset_gl_state_cache as before. Games that called restore_render_state outside run_external_pass to turn the stencil test back on use run_external_pass.
- Bone pose hook: callers of write_skin_pose add None at the end. (write_skin_pose(skeleton, name, time, &mut joint_matrices, blend, swing_scales, None))
- glTF quantized mesh reading: code that matches every AccessorArray variant adds the Byte and Short arms. (Otherwise a new feature)
- Toon highlight: code that builds ToonInstance as a struct literal appends ..ToonInstance::default(). (The engine examples already do) Code that put values other than 0, 0, 0, 1 in the bottom row of instance matrices (projective instance matrices) is now read as affine. The ToonScreenOutline line target does the same.
- Scene hook forms now match the original: change a scene's fn create(&mut self, engine: &Engine) to fn load(&mut self, engine: &Engine). Remove the engine argument from the other hooks, and if the body uses the engine, put let engine = Engine::get_engine().unwrap(); on the first line (the same engine). Remove engine from base calls as well: self.scene_base.tick(engine, time_delta) becomes self.scene_base.tick(time_delta), game_scene_base.create(engine) becomes game_scene_base.load(engine), and game_scene_base.draw_on_load(engine, graphic) becomes game_scene_base.draw_on_load(graphic).
- 3D render scale: the fifth argument of ToonViewDrawCallback changed from i32 (drawing buffer height) to ToonViewOutput. Replace hand-computed positions such as ToonPostProcess::end(gl, None, [x, drawing buffer height - y - height, width, height]) with end(gl, output.output_framebuffer, output.output_viewport). (same place at scale 1, and the right place with a render scale or inside an opacity layer)
- Engine GL context GlContext: code that writes the type of a callback argument (`|program: &ShaderProgram, gl: &glow::Context, kind: ToonProgramKind|`, `gl: &glow::Context` of a ToonView3D draw function) changes it to `gl: &GlContext`. Change `gl: &glow::Context` taken by game helper functions to `gl: &GlContext` too (if left as is, a compile error points it out). Remove `use glow::HasContext;` (the methods are inherent methods of GlContext, so it works without it; keeping it only gives an unused import warning). Code that passes get_gl to engine functions stays as it is. glow types (glow::Texture and the like) and constants are used as they are.
- Text drawing moved to a glyph atlas: TextEntry has no texture. Draw each glyph with glyph_textures and glyph_rects (left, top, right, bottom, u0, v0, u1, v1 relative to the top-left of the string rectangle). (Inside the engine Graphic::draw_text_entry does this) TextEntry is not Copy. (clone)
- Shadow and toast argument forms: set_shadow(Color::create(0.0, 0.0, 0.0, 0.8), 3.0, 4.0) becomes set_shadow("#000000", 0.8, 3.0, 4.0). ToastMotion::new(side) becomes ToastMotion::new() plus set_enter_side(side) (attach_toast_motion is unchanged). Move the function given to set_apply_text_handler to the third argument of show: toast_motion.show(text, seconds, move |context| { .. set the text .. }).
- No reserved-word names: cooldown.r#use() becomes cooldown.activate(), pass.r#use(gl) becomes pass.use_program(gl), pointer_gesture.r#move(x, y) becomes pointer_gesture.move_pointer(x, y), action.r#loop(..) becomes action.repeat_while(..), and easing_function::quadratic::r#in becomes easing_function::quadratic::ease_in (out and in_out become ease_out and ease_in_out).
- Text antialiasing as a Graphic method: replace graphic.get_text_string_texture_cache().set_text_antialias_enabled(value) with graphic.set_text_antialias_enabled(value). (The cache method still works)
- Matching the two engines: format_number and format_number_with_unit return Result<String, FormatError> (unwrap or ? for a valid tag). to_json_text_mut and serialize_node_mut are gone; pass &mut NodeTree to to_json_text and serialize_node. The draft Tilemap::get_tilesets returns &[Rc<Tileset>], get_tileset returns Option<&Rc<Tileset>>, and get_tileset_mut is None while the tileset is shared with another map. add_tileset takes either a Tileset or an Rc<Tileset>
- Logic numbers are f64: change f32 to f64 in game code (tick's time_delta, the arguments of Vector2::create and Color::create, component fields, getters and setters; std::f32::consts becomes std::f64::consts). Matrix4's elements, get_elements, write_to_array and write_to_slice are f32 like the original Float32Array; read them with the new read_elements (f64 array) when calculating per element. TransformMatrix::write_to_float32_array writes into [f32; 9]. Graphic::get_vertex_data, get_particle_vertex_data, ToonRenderer's instance data (create_instance_buffer), and the joint_matrices of ToonDrawOptions and ToonLineDrawOptions and the target of write_skin_pose are f32, so put f64 values in with as f32. The functions of Canvas2D and Path2D take f64 like the original. The desktop, like Chrome Blink, narrows to f32 as soon as it receives a value and calculates in float like Skia (path functions such as move_to, line_to, arc and rect use base::saturated_cast, so a number beyond f32 becomes infinity, and the others use ClampTo<float>, which clamps to the f32 limits with the sign); the web hands the f64 to the browser as is. Getters (such as get_line_width, get_shadow_blur, get_miter_limit, get_line_dash_offset) return f64, and get_global_alpha and get_line_dash return the stored value as is, like Chrome. CanvasRadius is built from f64 and (f64, f64). get_entry, find_entry, rasterize_text and rasterize_text_with_color of TextStringTextureCache take line_width and bake_scale as f64. (Like the original, the scale multiplication and the division by the baked size are computed in double) The fields of CanvasMatrix and CanvasGradientKind are f32 because they are Skia's float matrix and gradient; CanvasMatrix::create takes f64 and narrows it, and transform_point calculates in f64 and returns the result. The desktop rotate, like Chrome, narrows the angle to float and rotates with the Skia setRotate calculation (float radians, with sin and cos treated as 0 when within 1/65536). (At 90 degrees cos is 0, not -4.4e-8) LayoutExpression takes f64 and i32 instead of f32. When uploading uniforms to a game shader, pass them to glow's uniform_1_f32 functions with as f32.
- Web dialogs and web context menu: Engine::alert, confirm, prompt no longer finish immediately on the web either. Get the answer from the handle's is_finished or set_callback, or await alert_async and the others (same as the desktop). Engine::is_modal_dialog_open can be true on the web too
- Reflection cannot be left out: put #[vanilla::reflect] on the impl block and the impl Component block of game components. A type without getters takes it on an empty block, `#[vanilla::reflect] impl Type {}`. Component::get_reflection and get_reflection_mut are gone (upcast `&dyn Component` to `&dyn Reflect`). collect_reflected_getters, collect_reflected_getters_in_tree and collect_reflected_getters_mut return a Vec without Option, and UIDocument::serialize_component returns a Map without Option.
- GameScene loading and touch recognizer: GameSceneBase::get_touch_recognizer and get_touch_recognizer_mut return an Option. (None before initialize, undefined in the original)
- Shared 3D asset cache: destroy used to delete materials that nothing else held by Rc; it now matches the original and does not delete materials put in with set_material, so their owner destroys them. Drawable's mesh_description is Rc<MeshDescription> and morph_target_list is Rc<Vec<MorphTarget>> (reading is unchanged, use Rc::make_mut to change them), and there is a new field is_morph_texture_shared. Code that loaded the same path several times and changed material values per model should take a copy with get_material(index). If each load needs its own parsed resources, call SkinnedModelAsset::clear_cache() or use load_from_bytes. Calling a handle's create_model again after it finished returns another instance of the same asset instead of building a new model.
- JPEG decoding: a JPEG with EXIF orientation has the width and height after rotation. Code that expected the unrotated image saves the image again without orientation.
- Input field context menu: UIInputFieldMenuAction gains SelectAll and loses Undo, Redo, PasteAsPlainText, Emoji, WritingDirectionDefault, WritingDirectionLeftToRight, WritingDirectionRightToLeft and Inspect. Undo and redo are done with the keys (Ctrl+Z, Ctrl+Shift+Z). UIInputFieldWritingDirection and UIInputField::set_writing_direction and get_writing_direction are removed (the value never affected the text the engine draws)
- Component lookup: get_component::<Sprite>() also returns a ShaderSprite, and get_component::<UIView>() returns the UIView embedded in a widget. Code that wanted only that exact type checks as_any().downcast_ref. remove_component::<Paint>() also removes subtypes such as Sprite.
- Action: change start(&mut target) to start_with(&mut target), step(&mut target, time) to step_with(&mut target, time), start_on_node to start and step_on_node to step.
- FloatingText: code that subtracted that offset should pass coordinates relative to the parent's top-left like the original.
- JSON writing: code that compared stored JSON text against text like "1.0" should expect "1" like the original. Text already stored is still read as before.
- JSON writing: change get_component::<Text>() on a spawned label node to get_component::<UILabel>().
- Fallback font choice: no code changes. Text whose font string gives a name and used to draw with the default font chain (Mac Apple SD Gothic Neo, Windows Segoe UI, Malgun Gothic) now draws with the operating system fallback font like Chrome. To use the chain, put default at the end of the name list.
- FBX multiple materials: the drawable list of an FBX model grows by the number of materials. Code that expected drawable 0 to be the whole mesh looks up by material_name or material_index.
- SpriteAnimator.play: SpriteAnimator::play_on_node(node, ...) becomes SpriteAnimator::play(node, ...), and animator.play(...) becomes SpriteAnimator::play(node, ...) when a node is at hand or animator.play_clip(...) inside the complete callback.
- GamepadManager: the returned values are copies (Gamepad), not references (&Gamepad). Remove `.into_iter().cloned().collect()` or `.cloned()` used to keep copies. Reading through get_gamepad_manager() also works.
- Dropping an AudioPlayer: code that dropped a player to silence it calls stop() before dropping it. A looping sound keeps playing until stopped, as in the original.
- Font names: a quoted generic name in FontDescription.family_name_list comes with its quotes, like "\"monospace\"". Code that compared names strips the quotes first. GenericFamily::from_family_name("-webkit-body") is Standard, and find_family_font_file looks up a double-quoted name as a font name.
- Engine: no public API changed in a way that breaks compilation. Code that built GL resources when first drawing in a draw function keeps working as is. To build them in create, initialize like the original, move it into `if let Some(graphic) = engine.get_graphic() { ... graphic.get_gl() ... }`. Calling engine.get_graphic() inside a draw function gives None, so use the graphic argument
- FbxLoader: code that called play_animation or looked up nodes with names carrying the suffix uses the names without the suffix.
- ToonScreenOutline: (the public API changed)
  - set_crease(angle, intensity, continuation pixels) → set_crease(angle, width, intensity). Width is in the units of set_width, intensity is 0 ~ 1. Continuation pixels are gone. A look similar to the old set_crease(60.0, 0.5, 2.0) is set_crease(60.0, 1.0, 0.8) in pixel units, and in world units a width of about half the outline width (set_crease(60.0, 0.011, 0.8) for set_width(0.022, World)). Since the width is in the units of set_width, giving 1 in world units makes the line 1 meter wide
  - set_depth_threshold(depth threshold, contact threshold) → set_depth_threshold(depth threshold). Its meaning changed to tangent plane distance. The contact threshold is gone
  - Meaning of set_width: the width of one line, half on each side of the edge. Default 1.5 → 2 pixels. To match the outer thickness of the old look, give twice the value. To match the overall look of the line (the sum of coverage), use about 0.9 times rather than twice. (Measured in the original by running the old shader on the same line target: Aberrant's old values 0.022 m, crease 60 degrees .5 2 px are closest to set_width(0.020, ToonOutlineWidthUnit::World), set_crease(60.0, 0.016, 0.5), set_depth_threshold(0.08); the coverage sums differ by 1 % in the toonstyle scene at 1280 x 720)
  - set_sample_count, TOON_SCREEN_OUTLINE_MAXIMUM_SAMPLES, TOON_SCREEN_OUTLINE_MAXIMUM_CREASE_SAMPLES are gone. Lightweight paths lower only set_resolution_scale
  - get_outline_radius(), read_outline_radius() → get_line_widths(), read_line_widths() ([outline, crease line] in drawing area pixels)
  - Line id limit 65535 → TOON_SCREEN_OUTLINE_MAXIMUM_LINE_ID (16383)
  - mask_framebuffer, mask_texture of ToonLineTarget are gone. Instead seed_framebuffers, seed_textures (two RGBA16UI), seed_index
  - draw_outline sets the viewport to the drawing area from begin_line_ids by itself
- Rebuilt toon shading in the standard form of real-time toon rendering.: (the public API changed)
  - For smooth Lambert, clear_shade_ramp() or set_band_count(0)
  - ToonBandRamp, get_band_ramp, get_band_count, clear_band_ramp are gone. ToonShadeRamp, get_shade_ramp, clear_shade_ramp
  - set_specular(intensity, exponent) → set_specular(intensity, exponent, softness, color). The previous look is set_specular(intensity, exponent, 1.0, [1.0; 3]). get_specular() returns ToonSpecular
  - set_rim_light(color, power) → set_rim_light(color, power, softness, sun-side mask). The same soft rim as before is (color, power, 1.0, 0.0), and it is not multiplied by the base color. get_rim_light() returns ToonRimLight
  - When building ToonPointLight with field names, add ..ToonPointLight::default(). (New fields direction, inner_cone_angle, outer_cone_angle)
- Bone matrix uniform block: in a replacement vertex shader (a shader given to SkinnedModelRenderer, the toon outline shader), put JOINT_BLOCK_GLSL in place of uniform mat4 jointMatrices[96]; (the body's jointMatrices[index] stays). Code that uploaded bone matrices directly (finding the uniform location and uploading) changes to JointBlockBuffer::upload. Where morph weights were uploaded directly, use uniform vec4 morphWeights[24] and a vec4 array upload in place of uniform float morphWeights[96].


> https://vanillapunch.com/docs/vanilla-engine/0.4.0/update/ (vanilla-engine 0.4.0)
