Skip to content

Improve and optimize coin rendering and UI - #300

Merged
mikyar merged 7 commits into
mainfrom
feature/coinage-studio-bake
Nov 25, 2026
Merged

mikyar merged 7 commits into
mainfrom
feature/coinage-studio-bake

Conversation

@TorstenStueber

@TorstenStueber TorstenStueber commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Port of paritytech/polkadot-ios-community#395 and its latency follow-up.

  • The coin studio is baked on the GPU from a list of lamps, replacing 2.2 MB of bundled cube faces and their decoder (CPU fallback where float render targets are missing).
  • The lifted studio is the only studio.
  • Tilt turns the studio by the actual rotation between gravity readings, at 40 Hz.
  • Coins request the display's native rate (Android 15+).
  • Reworked coin materials with brushing and duller worn coins, plus the performance trims for large grids.
  • Lower motion-to-pixel latency: the light takes the latest gravity reading outright, readings arrive off the main thread, at most two frames are in flight, and the render loop is paced to vsync (it was drawing unpaced, about 1,400 frames a second while moving).
  • A debug-only latency probe overlay, for measuring on a device.

Size of the change against main:

Part Added Removed
Production Kotlin and GLSL ~970 ~440
Debug-only Kotlin ~180 0
Tests 247 44
JSON data 450 264
Gradle 4 0
Binary 0 42 HDR files, 2.2 MB
Total text ~1,850 ~750

Port of paritytech/polkadot-ios-community#395: the studio cube is baked from fifteen lamps and a room gradient when the renderer is created (a fragment pass per face and level, as GLES 3.0 has no compute; a smaller CPU bake where float targets are missing), replacing the 42 shipped Radiance faces and their decoder. A 0.10 room lift and four panels at lookup time; the studio turns by the one rotation between gravity readings and chases it at 25/s; the coin surface asks for the display's high rate; titanium, wear toning, the worn-coin matte pull, brushing and the large-grid trims as on iOS. Tests for the lamps, the prefilter and the tilt, and an on-device test of the GPU bake against the CPU one.
@TorstenStueber TorstenStueber changed the title Bake the coin studio on the device and ship the lifted studio Improve and optimize coin rendering and UI - #395 Nov 5, 2026
@TorstenStueber TorstenStueber changed the title Improve and optimize coin rendering and UI - #395 Improve and optimize coin rendering and UI Nov 5, 2026
@duewarn
duewarn requested a review from subhannaeem November 5, 2026 14:11

@mikyar mikyar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes. Debug measurement code is mixed into production classes and ships in release builds, which breaks separation of concerns and single responsibility: the renderer, the tilt sensor and the view each carry code that exists only for a debug tool. A reusable view changes settings of the window that hosts it, which breaks encapsulation, since its behaviour leaks to the whole screen and to whatever else sets those settings. The description calls the probe debug-only, while it is compiled into every build.

mikyar
mikyar previously approved these changes Nov 24, 2026
valentunn
valentunn previously approved these changes Nov 25, 2026
@mikyar
mikyar merged commit 9790611 into main Nov 25, 2026
11 of 12 checks passed
@mikyar
mikyar deleted the feature/coinage-studio-bake branch November 25, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants