Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn Impeller

Impeller on desktop: SDF text and Metal/Vulkan defaults — hướng dẫn Flutter

Desktop Impeller defaults land with Signed Distance Function text and Wide Gamut on macOS. Bài này chuyển quan sát đó thành một mô hình nhỏ để bạn có thể kiểm thử, đo lường và giữ cho code dễ bảo trì khi app lớn lên. Vấn đề cốt lõi Flutter 3.47 makes Impeller the default desktop renderer — what changes for text and jank. Câu hỏi hữu ích không phải API hay pattern có đẹp riêng lẻ hay không, mà là state nằm ở đâu, boundary nào chịu trách nhiệm khi lỗi xảy ra, và người dùng phục hồi thế nào khi happy path biến mất. Mô hình thực tế Shader compilation jank dies; SDF glyphs stay sharp on lower-density desktop displays. Hãy bắt đầu bằng một owner rõ ràng cho behavior. Widget chỉ nên render và phát intent; IO, persistence, permission và retry nên nằm sau một interface nhỏ. Nhờ vậy bạn có seam để fake trong test và một chỗ ghi lại các dữ kiện cần theo dõi ở production. Trong app Flutter, boundary thường có dạng: Widget phát intent như load, submit, refresh hoặc retry. Controller hoặc ...

Impeller on desktop: SDF text and Metal/Vulkan defaults

Desktop Impeller defaults land with Signed Distance Function text and Wide Gamut on macOS. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence Flutter 3.47 makes Impeller the default desktop renderer — what changes for text and jank. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Shader compilation jank dies; SDF glyphs stay sharp on lower-density desktop displays. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an ...

Impeller thành renderer desktop mặc định — thực sự đổi gì

Impeller mặc định trên mobile đã có từ trước. Flutter 3.47 hoàn tất trên macOS, Windows và Linux . App desktop giờ nhắm Metal (macOS) và Vulkan (Windows/Linux) với tập shader cố định, compile lúc build engine. Bạn được gì Hết jank compile shader khi animation chạy lần đầu. Chữ SDF — glyph sắc hơn trên màn desktop mật độ pixel thấp hơn. Wide Gamut Color mặc định trên macOS khi phần cứng hỗ trợ. Opt-out Skia tạm thời Nền tảng Cách tắt macOS FLTEnableImpeller=false trong Info.plist Windows project.set_impeller_switch(flutter::ImpellerSwitch::Disabled) trong main.cpp Linux fl_dart_project_set_enable_impeller(project, FALSE) trong my_application.cc Hãy file bug. Fallback sẽ bị gỡ. Nên test lại FragmentShader tùy chỉnh và effect nặng saveLayer . Platform view / external texture. Luồng print/export từng giả định color management của Skia. Chạy profile mode trước. Frame vẫn dài thì vẫn là UI vs raster — Impeller chỉ lấy việc ở nhánh compile shader ,...

Impeller is now the default desktop renderer — what actually changes

Mobile Impeller defaults landed earlier. Flutter 3.47 finishes the job on macOS, Windows, and Linux . Desktop apps now target Metal (macOS) and Vulkan (Windows/Linux) with a fixed shader set compiled at engine-build time. What you gain No shader-compilation jank on first run of an animation. Signed Distance Function text — sharper glyphs on lower-density desktop displays. Wide Gamut Color on by default on macOS where hardware supports it. Temporary Skia opt-outs If a regression blocks you: Platform Opt-out macOS FLTEnableImpeller=false in Info.plist Windows project.set_impeller_switch(flutter::ImpellerSwitch::Disabled) in main.cpp Linux fl_dart_project_set_enable_impeller(project, FALSE) in my_application.cc File a bug. Fallbacks are scheduled for removal. What to retest Custom FragmentShader s and saveLayer -heavy effects. Platform views and external textures. Print/export paths that assumed Skia color management. Profile mode first. If a f...

Fragment shader trong Flutter: uniform theo tên và texture đồng bộ

Custom shader hết “ngách” khi Impeller nắm stack. API gần đây gỡ các nốt đau tồi tệ nhất. Bind uniform theo tên void setUp (ui. FragmentShader shader) { shader. getUniformFloat ( 'intensity' ). set ( 0.85 ); } Không còn đếm slot float thủ công — bớt bug off-by-one trên GPU. Texture đồng bộ trong cùng frame final image = picture. toImageSync ( 128 , 128 , targetFormat : ui. TargetPixelFormat .rFloat32, ); shader. setImageSampler ( 0 , image); decodeImageFromPixelsSync / toImageSync bỏ một frame lag khi tạo texture sampler. Format high-bit (tới 128-bit float) mở khóa LUT và SDF nghiêm túc. Workflow Viết .frag trong shaders/ . Load theo docs (ShaderLib / asset API). Preview cách ly; rồi mới integrate sau feature flag. Cạm bẫy Khác biệt tọa độ Skia vs Impeller vẫn cắn shader port. LUT lớn cần ngân sách memory — phải đo. Bài viết gốc đăng tại FlutterCook . Bản trên đó là bản được cập nhật mới nhất.

Fragment shaders in Flutter: uniforms by name and sync textures

Custom shaders stop being a niche once Impeller owns the stack. The recent API work removes the worst papercuts. Bind uniforms by name void setUp (ui. FragmentShader shader) { shader. getUniformFloat ( 'intensity' ). set ( 0.85 ); } No more counting float slots by hand — fewer off-by-one GPU bugs. Sync textures in the same frame final image = picture. toImageSync ( 128 , 128 , targetFormat : ui. TargetPixelFormat .rFloat32, ); shader. setImageSampler ( 0 , image); decodeImageFromPixelsSync / toImageSync remove a frame of lag when creating sampler textures. High-bit formats (up to 128-bit float) unlock serious LUTs and SDFs. Workflow Author .frag under shaders/ . Load via ShaderLib / asset API in docs. Preview in isolation; then integrate behind a feature flag. Pitfalls Skia vs Impeller coordinate differences still bite ported shaders. Big LUTs need memory budgets — measure, do not assume. Originally published on FlutterCook . Read the...

Impeller thành renderer desktop mặc định — thực sự đổi gì

Impeller mặc định trên mobile đã có từ trước. Flutter 3.47 hoàn tất trên macOS, Windows và Linux . App desktop giờ nhắm Metal (macOS) và Vulkan (Windows/Linux) với tập shader cố định, compile lúc build engine. Bạn được gì Hết jank compile shader khi animation chạy lần đầu. Chữ SDF — glyph sắc hơn trên màn desktop mật độ pixel thấp hơn. Wide Gamut Color mặc định trên macOS khi phần cứng hỗ trợ. Opt-out Skia tạm thời Nền tảng Cách tắt macOS FLTEnableImpeller=false trong Info.plist Windows project.set_impeller_switch(flutter::ImpellerSwitch::Disabled) trong main.cpp Linux fl_dart_project_set_enable_impeller(project, FALSE) trong my_application.cc Hãy file bug. Fallback sẽ bị gỡ. Nên test lại FragmentShader tùy chỉnh và effect nặng saveLayer . Platform view / external texture. Luồng print/export từng giả định color management của Skia. Chạy profile mode trước. Frame vẫn dài thì vẫn là UI vs raster — Impeller chỉ lấy việc ở nhánh compile shader ,...

Fragment shader trong Flutter: uniform theo tên và texture đồng bộ

Custom shader hết “ngách” khi Impeller nắm stack. API gần đây gỡ các nốt đau tồi tệ nhất. Bind uniform theo tên void setUp (ui. FragmentShader shader) { shader. getUniformFloat ( 'intensity' ). set ( 0.85 ); } Không còn đếm slot float thủ công — bớt bug off-by-one trên GPU. Texture đồng bộ trong cùng frame final image = picture. toImageSync ( 128 , 128 , targetFormat : ui. TargetPixelFormat .rFloat32, ); shader. setImageSampler ( 0 , image); decodeImageFromPixelsSync / toImageSync bỏ một frame lag khi tạo texture sampler. Format high-bit (tới 128-bit float) mở khóa LUT và SDF nghiêm túc. Workflow Viết .frag trong shaders/ . Load theo docs (ShaderLib / asset API). Preview cách ly; rồi mới integrate sau feature flag. Cạm bẫy Khác biệt tọa độ Skia vs Impeller vẫn cắn shader port. LUT lớn cần ngân sách memory — phải đo. Bài viết gốc đăng tại FlutterCook . Bản trên đó là bản được cập nhật mới nhất.

Impeller is now the default desktop renderer — what actually changes

Mobile Impeller defaults landed earlier. Flutter 3.47 finishes the job on macOS, Windows, and Linux . Desktop apps now target Metal (macOS) and Vulkan (Windows/Linux) with a fixed shader set compiled at engine-build time. What you gain No shader-compilation jank on first run of an animation. Signed Distance Function text — sharper glyphs on lower-density desktop displays. Wide Gamut Color on by default on macOS where hardware supports it. Temporary Skia opt-outs If a regression blocks you: Platform Opt-out macOS FLTEnableImpeller=false in Info.plist Windows project.set_impeller_switch(flutter::ImpellerSwitch::Disabled) in main.cpp Linux fl_dart_project_set_enable_impeller(project, FALSE) in my_application.cc File a bug. Fallbacks are scheduled for removal. What to retest Custom FragmentShader s and saveLayer -heavy effects. Platform views and external textures. Print/export paths that assumed Skia color management. Profile mode first. If a f...

Fragment shaders in Flutter: uniforms by name and sync textures

Custom shaders stop being a niche once Impeller owns the stack. The recent API work removes the worst papercuts. Bind uniforms by name void setUp (ui. FragmentShader shader) { shader. getUniformFloat ( 'intensity' ). set ( 0.85 ); } No more counting float slots by hand — fewer off-by-one GPU bugs. Sync textures in the same frame final image = picture. toImageSync ( 128 , 128 , targetFormat : ui. TargetPixelFormat .rFloat32, ); shader. setImageSampler ( 0 , image); decodeImageFromPixelsSync / toImageSync remove a frame of lag when creating sampler textures. High-bit formats (up to 128-bit float) unlock serious LUTs and SDFs. Workflow Author .frag under shaders/ . Load via ShaderLib / asset API in docs. Preview in isolation; then integrate behind a feature flag. Pitfalls Skia vs Impeller coordinate differences still bite ported shaders. Big LUTs need memory budgets — measure, do not assume. Originally published on FlutterCook . Read the...

Impeller và một frame bị giật: tìm xem 16ms đã trôi đi đâu

Tester báo bug: “danh sách sản phẩm bị giật khi cuộn nhanh trên máy Pixel”. Bạn tìm flutter jank , ba kết quả đầu tiên đều bảo chạy flutter run --profile --cache-sksl , lấy file SkSL rồi nhét vào bản release. Bạn làm theo. Cái flag đó không còn, hoặc bị bỏ qua, và chỗ giật vẫn nguyên vẹn. Lời khuyên đó đúng — với Skia. Nó không đúng với app của bạn, vì app của bạn gần như chắc chắn đang render bằng Impeller, và Impeller không hề biên dịch shader lúc runtime. Tài liệu Flutter nói thẳng: Impeller “precompiles a smaller, simpler set of shaders at engine-build time so they don’t compile at runtime”. Không có gì để warm up cả. Quy trình --cache-sksl và --bundle-sksl-path là cơ chế riêng của Skia, và issue #140310 tồn tại chính vì có quá nhiều người cố dùng nó với Impeller. Vậy là cả một nhóm nguyên nhân gây jank đã biến mất. Các nhóm còn lại thì không. Một build() đi parse JSON vẫn chậm. Một IntrinsicHeight bọc quanh Row lớn vẫn là thêm một lượt layout. Canvas.saveLayer vẫn là, the...

Impeller and a janky frame: how to find where the 16ms actually went

A tester files a bug that says “the product list stutters when I scroll fast on the Pixel.” You search for flutter jank , and the first three results tell you to run flutter run --profile --cache-sksl , capture an SkSL file, and bundle it into your release build. You try it. The flag is gone, or it is ignored, and the stutter is exactly where it was. That advice was correct for Skia. It is not correct for your app, because your app is almost certainly rendering with Impeller, and Impeller does not compile shaders at runtime at all. The Flutter docs are direct about it: Impeller “precompiles a smaller, simpler set of shaders at engine-build time so they don’t compile at runtime.” There is nothing to warm up. The --cache-sksl and --bundle-sksl-path workflow is a Skia-only mechanism, and issue #140310 exists specifically because people kept trying to use it with Impeller. So one entire category of jank is gone. The other categories are not. A build() method that does JSON parsing is...

What Flutter is: reading a 3D game built in 15 minutes to understand the whole framework

On 20 August 2026, Abdallah Shaban — who works on product for Flutter at Google — posted a video of a 3D tic-tac-toe game: the X and O pieces are characters with eyes that blink, they drop onto the board with an elastic bounce, and when one side wins, the winning pieces go and eat the losers. He said he built it in 15 minutes, and — the valuable part — published every prompt in a public repo . I built this game in 15 minutes with flutter_scene and @FlutterDev , using @antigravity and Gemini 3.7! — Abdallah Shaban (@AbdallahSh07) August 20, 2026 The original demo video by Abdallah Shaban . Every prompt is public in the repo's PROMPTS.md . I checked that number. It holds up better than I expected, but the real story is more interesting than the number: First prompt: 19 Aug at 20:27:19 (−07:00). First commit, named tic tac toe : 20:39:36 the same evening. ⏱️ 12 minutes from the first instruction to a committed, playable game. But the version in the video: 15 prompts...